-
Notifications
You must be signed in to change notification settings - Fork 25
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
Occasional Errors In Pipeline #316
Comments
Thanks for reporting the issue @dmanners. The difference between local and CI runs is that locally, PHPStan and this extension will most likely use the Magento-generated classes (if they exist), while in CI, the PHPStan extension generates the missing classes by itself with its own logic. Still, that does not explain why CI occasionally breaks. |
Yeah it's odd some runs it's fine and some the errors appear but on a rerun everything is then green. I have also tested it locally without a generated folder and it's still green locally. I will also check that we dont override a magento file with a local patch that isnt applied in the pipeline as well. I have also tested out firstly clearing the phpstan cache folder before running the check. |
Ok after a bit more debugging I have found that disabling the parallel processing then the errors do not seem to appear.
Here I have run our pipeline 3 times and had no error cases. |
Uh, good catch! Fixing this issue might not be easy due to the way the autoloader & the code generation in this extension work. Will think about it. |
I will keep this updated after a week or so of pipeline runs to see if this setting helps us in the long run or just randomly today. |
Sounds like a plan. Don't close the issue if the current setting works for you. I'll take this as an opportunity to discuss with Ondrej how to better hook into PHPStan to generate the classes when they do not exist. The autoloader magic isn't ideal and seems to break a few things, e.g. the Rector integration (see #297). Looks like a larger refactoring is needed to improve things. If the setting does work for you, please consider adding a PR to the README that includes a hint on how to resolve the issue. |
Yeah this seems to have fixed the issue with us a week of pipeline runs and no false positive errors in the phpstan job. |
I've discussed this issue with Ondřej the other day. If you want to run the processes in parallel, it would be best to run Magento's setup:di:compile command before running PHPStan. This way, Magento will generate all "missing" files, and the autoloaders of our extension are not executed. I will have to check how to change the extension's architecture to allow the code generation to happen only once. Ideally, without invoking a separate CLI tool. |
While running phpstan in the context of our Magento project locally we get no errors, but occasionally with the same code base running in a ci/cd pipeline we will get errors that will either change or disappear on a re-run.
The errors that do appear seem to only occur with extension attributes.
In our pipeline and also lokally we are running
With the config
I have tried clearing the phpstan cache both locally and in the pipeline as well as locally clearing the generated folder as in the pipeline we have no generated folder.
The text was updated successfully, but these errors were encountered: