Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 18, 2023

the goal of this PR is to ease debugging why/which result cache metadata is different.

before this PR its pretty hard to e.g. in CI get an idea why the result cache metadata did not match and which of the key-indicators is the cause.

After this change the console output looks like:
note the new keys at the end of the error message

after changes in the composer.lock

➜  phpstan-src git:(1.10.x) ✗ php bin/phpstan -vvv
Note: Using configuration file /Users/staabm/workspace/phpstan-src/phpstan.neon.dist.
Result cache not used because the metadata do not match: projectConfig, composerLocks
 1561/1561 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 21 secs/21 secs

Result cache is saved.

or when no cache is present:

➜  phpstan-src git:(1.10.x) ✗ php bin/phpstan -vvv
Note: Using configuration file /Users/staabm/workspace/phpstan-src/phpstan.neon.dist.
Result cache not used because the metadata do not match: phpstanVersion, projectConfig, composerLocks, composerInstalled
 1561/1561 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 25 secs/25 secs

Result cache is saved.

or when the level changes

php bin/phpstan -vvv
Note: Using configuration file /Users/staabm/workspace/phpstan-src/phpstan.neon.dist.
Result cache not used because the metadata do not match: projectConfig, level
    0/1561 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0% < 1 sec/< 1 sec

etc.

@staabm staabm force-pushed the result-debugging branch 2 times, most recently from f9222aa to 11adf72 Compare September 18, 2023 19:16
@ondrejmirtes ondrejmirtes merged commit 2011cfe into phpstan:1.10.x Sep 29, 2023
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the result-debugging branch September 29, 2023 12:03
@janedbal
Copy link
Contributor

janedbal commented Oct 2, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants