Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Oct 24, 2020

Names shamelessly copied from Doctrine itself.
Internally it is still using the same flow. But I added some checks
around it.

This should make static analysis a bit more happy. Which in turn makes
me more happy.

Signed-off-by: Roeland Jago Douma [email protected]

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecate execute?

@rullzer
Copy link
Member Author

rullzer commented Oct 25, 2020

Deprecate execute?

Probably.

I was even thinking maybe we should not leak the doctrine types in the new return type. But just return our own wrapper. As to decouple the whole thing.

@MorrisJobke
Copy link
Member

I don't get this weird CI failure ... Any idea why this is happening?

@kesselb
Copy link
Contributor

kesselb commented Oct 26, 2020

  1. OCA\DAV\Tests\unit\Connector\Sabre\RequestTest\EncryptionMasterKeyUploadTest::testUploadOverWriteReadLocked
    TypeError: Argument 2 passed to OCA\DAV\Events\CalendarCreatedEvent::__construct() must be of the type array, null given, called in /drone/src/apps/dav/lib/CalDAV/CalDavBackend.php on line 790

$calendarData = $this->getCalendarById($calendarId);
$this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int)$calendarId, $calendarData));

getCalendarById returns null or array. CalendarCreatedEvent expects an array ;) But yeah maybe a check if the execute operation worked is missing here.

@MorrisJobke
Copy link
Member

getCalendarById returns null or array. CalendarCreatedEvent expects an array ;) But yeah maybe a check if the execute operation worked is missing here.

But why isn't it on all phpunit runs but only on one of them?

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine but we really should have our own abstraction of the statement class from dbal :)

@rullzer
Copy link
Member Author

rullzer commented Oct 27, 2020

Ok added the statement wrapper (to just have that right away else things might do boom)
And deprectated the main execute method.

The statement wrapper is very tiny right now. But will most likely already cover the 90%. We can extend later when needed.

/**
* @sinc 21.0.0
*/
public function fetch(): array;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array … of? 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah work your magic if you want. Array of whatever.

Copy link
Member

@ChristophWurst ChristophWurst Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return mixed[] values of a row
@psalm-return array<string, mixed>

should do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psalm-return array<string, string>

All db values returned are strings and need custom casting afterwards as far as I know

namespace OCP\DB\QueryBuilder;

/**
* @sinc 21.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @sinc 21.0.0
* @since 21.0.0

@faily-bot
Copy link

faily-bot bot commented Oct 27, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 34647: failure

checkers

mysql8.0-php7.4

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) Test\Files\Cache\UpdaterLegacyTest::testWriteWithMountPoints
Failed asserting that two strings are not identical.

/drone/src/tests/lib/Files/Cache/UpdaterLegacyTest.php:139

integration-sharing-v1-video-verification

  • build/integration/sharing_features/sharing-v1-video-verification.feature:8
Show full log
  Scenario: Creating a link share with send password by Talk # /drone/src/build/integration/sharing_features/sharing-v1-video-verification.feature:8
[Tue Oct 27 22:49:58 2020] TypeError: Argument 4 passed to OC\Comments\Manager::__construct() must implement interface OCP\AppFramework\Utility\ITimeFactory, instance of OC\InitialStateService given, called in /drone/src/apps/spreed/lib/Chat/CommentsManager.php on line 48 at /drone/src/lib/private/Comments/Manager.php#77
[Tue Oct 27 22:49:58 2020] 127.0.0.1:56380 [200]: /ocs/v2.php/cloud/users/user0
[Tue Oct 27 22:49:58 2020] TypeError: Argument 4 passed to OC\Comments\Manager::__construct() must implement interface OCP\AppFramework\Utility\ITimeFactory, instance of OC\InitialStateService given, called in /drone/src/apps/spreed/lib/Chat/CommentsManager.php on line 48 at /drone/src/lib/private/Comments/Manager.php#77
[Tue Oct 27 22:49:58 2020] 127.0.0.1:56386 [200]: /ocs/v2.php/cloud/users/user0
    Given user "user0" exists                                # SharingContext::assureUserExists()
    And As an "user0"                                        # SharingContext::asAn()
[Tue Oct 27 22:49:58 2020] Login failed: 'user0' (Remote IP: '127.0.0.1')
[Tue Oct 27 22:49:58 2020] 127.0.0.1:56392 [401]: /ocs/v1.php/apps/files_sharing/api/v1/shares
    When creating a share with                               # SharingContext::creatingShare()
      | path               | welcome.txt |
      | shareType          | 3           |
      | password           | secret      |
      | sendPasswordByTalk | true        |
    Then the OCS status code should be "100"                 # SharingContext::theOCSStatusCodeShouldBe()
      Failed asserting that SimpleXMLElement Object &0000000000bc2a79000000003bb07c09 (
          0 => '997'
      ) matches expected '100'.
    And the HTTP status code should be "200"                 # SharingContext::theHTTPStatusCodeShouldBe()
    And last share with password "secret" can be downloaded  # SharingContext::lastShareWithPasswordCanBeDownloaded()

This was referenced Dec 14, 2020
@rullzer rullzer modified the milestones: Nextcloud 21, Nextcloud 22 Dec 21, 2020
@rullzer rullzer force-pushed the enh/querybuilder/execute_query_update branch 3 times, most recently from 660326b to 76a6328 Compare March 4, 2021 13:03
Names shamelessly copied from Doctrine itself.
Internally it is still using the same flow. But I added some checks
around it.

This should make static analysis a bit more happy. Which in turn makes
me more happy.

Signed-off-by: Roeland Jago Douma <[email protected]>
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didnt test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants