Skip to content

Conversation

@backportbot-nextcloud
Copy link

backport of #23401

@ChristophWurst
Copy link
Member

Psalm failed too hard. Let's try with an updated baseline …

@MorrisJobke
Copy link
Member

Psalm failed too hard. Let's try with an updated baseline …

There are still some :/

@ChristophWurst ChristophWurst force-pushed the backport/23401/stable20 branch from ecbc400 to e05b7e4 Compare October 16, 2020 06:53
Signed-off-by: Christoph Wurst <[email protected]>
@ChristophWurst ChristophWurst force-pushed the backport/23401/stable20 branch from e05b7e4 to 6536501 Compare October 16, 2020 07:16
@ChristophWurst
Copy link
Member

There are still some :/

One. And I'm not sure why the check is different locally and on CI …

@ChristophWurst
Copy link
Member

Ah so two more errors. But for some reasons the baseline update doesn't capture those …

Can you reproduce the failure locally?

@MorrisJobke
Copy link
Member

Can you reproduce the failure locally?

$ composer run psalm
> psalm
Scanning files...
Analyzing files...

                                                                                
ERROR: InvalidNullableReturnType - lib/private/Avatar/Avatar.php:145:13 - The declared return type 'bool|string' for OC\Avatar\Avatar::generateAvatarFromSvg is not nullable, but 'false|null|string' contains null (see https://psalm.dev/144)
	 * @return string|boolean


ERROR: ImplicitToStringCast - lib/private/Avatar/Avatar.php:159:25 - Argument 1 of OC_Image::loadFromData expects string, Imagick provided with a __toString method (see https://psalm.dev/060)
			$image->loadFromData($avatar);


ERROR: NullableReturnStatement - lib/private/Avatar/Avatar.php:160:11 - The declared return type 'bool|string' for OC\Avatar\Avatar::generateAvatarFromSvg is not nullable, but the function returns 'null|string' (see https://psalm.dev/139)
			return $image->data();


ERROR: UndefinedInterfaceMethod - lib/private/Files/Stream/Encryption.php:449:16 - Method OCP\Files\Cache\ICacheEntry::offsetGet does not exist (see https://psalm.dev/181)
				$version = $cacheEntry['encryptedVersion'] + 1;


ERROR: InvalidScalarArgument - lib/private/Files/Stream/Encryption.php:501:59 - Argument 2 of OCP\Encryption\IEncryptionModule::decrypt expects string, int|non-empty-lowercase-string provided (see https://psalm.dev/012)
			$this->cache = $this->encryptionModule->decrypt($data, $position);


------------------------------
5 errors found
------------------------------
15307 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 666 of these issues.
Run Psalm again with 
--alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockReturnType,MismatchingDocblockParamType,MissingParamType --dry-run
to see what it can fix.
------------------------------

Checks took 117.95 seconds and used 1,899.642MB of memory
Psalm was able to infer types for 91.1980% of the codebase
Script psalm handling the psalm event returned with error code 1

@faily-bot
Copy link

faily-bot bot commented Oct 16, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 34219: failure

mariadb10.4-php7.3

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\ObjectStore\ObjectStoreStorageTest::testCopyDirectory
Failed asserting that false matches expected 'qwerty'.

/drone/src/tests/lib/Files/Storage/Storage.php:556

@MorrisJobke MorrisJobke force-pushed the backport/23401/stable20 branch 4 times, most recently from 00ab678 to 994fa3a Compare October 16, 2020 08:52
@ChristophWurst
Copy link
Member

**Static code analysis / static-code-analysis (pull_request) ** Failing after 1m — static-code-analysis

How many engineers does it take to make Psalm pass?

@MorrisJobke MorrisJobke force-pushed the backport/23401/stable20 branch from 994fa3a to 8545d18 Compare October 16, 2020 09:00
@ChristophWurst
Copy link
Member

**Static code analysis / static-code-analysis (pull_request) ** Failing after 1m — static-code-analysis

Yo …

@MorrisJobke MorrisJobke force-pushed the backport/23401/stable20 branch from 8545d18 to 68cbfe1 Compare October 16, 2020 09:08
@MorrisJobke MorrisJobke force-pushed the backport/23401/stable20 branch from a05eb3d to 7054159 Compare October 16, 2020 11:17
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

CI is green 👍 🙌

@MorrisJobke
Copy link
Member

Administrative only -> merge

@MorrisJobke MorrisJobke merged commit 3c1a745 into stable20 Oct 16, 2020
@MorrisJobke MorrisJobke deleted the backport/23401/stable20 branch October 16, 2020 11:22
@MorrisJobke MorrisJobke mentioned this pull request Oct 16, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants