-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Allow higher versions of phpstan to be installed #30581
Allow higher versions of phpstan to be installed #30581
Conversation
Hi @hostep. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests (this probably doesn't make much sense, because phpstan is executed on changed source code files and none have been changed in this PR) |
Hi @ihor-sviziev, thank you for the review.
|
This was introduced in 700de11 BTW from https://getcomposer.org/doc/articles/versions.md#caret-version-range- - so such dependence should be fine:
|
I'm pretty sure failed tests not related to changes in this PR, but let's restart tests |
For QA - unfortunately all the time someone changes composer.json - we have a conflict in composer.lock in "hash". |
I had a case when PHPStan was failing with Magento core configuration with PHPStan version >=0.12.29 and definitely on 0.12.32. So please be careful with the update as it can break tests. I'm sure there was a reason why the higher band was introduced. |
@hws47a if you could give us steps to reproduce - it will be really helpful |
@fascinosum: do you happen to remember why the upper constraint for version 0.12.23 was added in 700de11? Thanks! |
3258dc4
to
57c136b
Compare
Rebased on top of 2.4-develop, solved conflicts, further updated @magento run all tests |
@magento run all tests |
@hostep php8-develop branches update is in progress now |
f303bad
to
075a1b2
Compare
Rebased on latest @magento run all tests |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE |
Added related ee pull request |
@magento run all tests |
@sivaschenko, could you also resolve the conflict by accepting any version of "hash" and executing |
@magento run all tests |
Hi @hostep, thank you for your contribution! |
hi @hostep , @ihor-sviziev
cc: @sivaschenko |
Thanks @fascinosum ! Can you tell us how we need to execute |
@hostep, just run it on your local |
Ok great! So something like this on the CLI I believe:
However, I'm still unable to trigger any kind of error:
Am I still doing something wrong @fascinosum? |
Ok, I'm able to trigger it, finally.
After that I can trigger the test, but my god, this is such an awful way to run static tests, I really hope something gets done to this in the future so we have a much more user-friendly way of triggering these, and then also finally document how you should do it. Anyway, the results are in: phpstan 0.12.23:
phpstan 0.12.24:
phpstan 0.12.69 (which was used and approved in this PR):
So indeed, something will need to be done inside Magento's code of how it calls phpstan to make it compatible again somehow. I'm not going to put time in this in the next few days I think and we should probably now also put #31972 on hold until a solution is found for this. |
The easiest way to trigger the newer phpstan version incompatibility is by simply executing:
That way you don't need to go through this phpunit mess. |
thank you @hostep, |
It would be good to create a new issue for fixing this new behavior after the phpstan update as it was recently merged to the php8 branch. |
I'm assuming a core Magento dev wil pick this up since internal ticket MC-40914 was created. It has something to do with that custom FilteredErrorFormatter class which is custom written for Magento |
@hostep @ihor-sviziev @fascinosum can you please take a look at this proposed fix: #32215 |
@sivaschenko, TBH, I didn't work enough with phpstan to check if your changes are good enough, but from the first look - looks good. |
Good job @sivaschenko |
Description (*)
See discussions in bitExpert/phpstan-magento#42 and bitExpert/phpstan-magento#43
Basically it boils down to:
bitexpert/phpstan-magento
needphpstan/phpstan
0.12.26 or higher^0.12.3
will prevent Magento to use this newer version.Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/462
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)