Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanDirectories config seems to influence ResultCache #10027

Closed
staabm opened this issue Oct 18, 2023 · 3 comments
Closed

scanDirectories config seems to influence ResultCache #10027

staabm opened this issue Oct 18, 2023 · 3 comments

Comments

@staabm
Copy link
Contributor

staabm commented Oct 18, 2023

Bug report

in our CI pipeline the result cache usually works.

I can see that result cache is not used in a particular project with a pretty simple config

includes:
    - phpstan-baseline.neon

parameters:
    resultCachePath: %tmpDir%/resultCache-motion-scripts.php
    level: 7
    paths:
        - .
    bootstrapFiles:
        - phpstan-bootstrap.php
        - phpstan-dba-bootstrap.php
    scanDirectories:
        - ../lib/
    excludePaths:
        analyseAndScan:
            # ignore files which executed code when beeing included, instead of only defining logic
            - */config/*

    ignoreErrors:
         - '#Class shop referenced with incorrect case.*#'
         - '#Call to an undefined method shop.*#'

the only thing which stands out is the use of scanDirectories... on the CI console I can see

Result cache not used because the metadata do not match: projectConfig, scannedFiles

I will leave this issue here for bugtracking and to get a issue number :-).
I will update the issue as soon as I know more - stay tuned.

Code snippet that reproduces the problem

No response

Expected output

result cache should be used and not work differently when scanDirectories is used

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member

You can figure out what's different by diffing resultCache-motion-scripts.php before the run and after the run.

@staabm
Copy link
Contributor Author

staabm commented Oct 19, 2023

thanks, thats a great advice which helped to narrow the problem.

in our case the problem is/was, that because of a bug in the github actions workflow, a very old result-cache was restored in some cases, which in turn made PHPStan reporting, that the scannedFiles are no longer up 2 date.

@staabm staabm closed this as completed Oct 19, 2023
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants