-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fixes incorrectly cased namespace usages. #37574
base: 2.4-develop
Are you sure you want to change the base?
Fixes incorrectly cased namespace usages. #37574
Conversation
Hi @hostep. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
The failure of the semantic version check is in my opinion something to ignore, in practice it shouldn't cause an issue. Pushed new commit to fix static tests. @magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Failures in functional tests don't look related at first sight (flaky tests probably) Only the failure in the semantic version checker is related to this PR, that one will need approval I guess? (is more of a false positive) |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Hi @hostep, Thank you for your contribution! ✔️ QA PassedIn order to proceed further on this PR, I have followed the mentioned steps As the build is failing, currently moving it further in Extended Testing. Thank you! |
@magento run all tests |
Raised internal approval JIRA for the SVC failure. Moving this PR to Pending Approval now. We will proceed ahead on this once will get all the required approvals. ![]() |
@magento create issue |
@engcom-Charlie: any news? |
I know, but that was 8 months ago, can't you send a reminder in your approval ticket, maybe somebody forgot to check it? |
Note to self, found another violation in latest codebase in the
Also note to self, make following adjustments, so running phpstan against the entire codebase runs quicker and without errors: diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon
index c6cf0a2a9c1..d356723e4c7 100644
--- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon
+++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon
@@ -4,11 +4,12 @@ parameters:
reportUnmatchedIgnoredErrors: false
excludePaths:
- %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/*
+ - %rootDir%/../../../lib/internal/Magento/Framework/TestFramework/Unit/Listener/*
- %rootDir%/../../../*/_files/*
- - %rootDir%/../../../dev/tests/*/Fixtures/*
- - %rootDir%/../../../dev/tests/*/tmp/*
- - %rootDir%/../../../dev/tests/*/_generated/*
+ - %rootDir%/../../../dev/tests/*
+ - %rootDir%/../../../generated/*
- %rootDir%/../../../pub/*
+ - %rootDir%/../../../vendor/*
scanDirectories:
- %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento
- %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento Will try to fix that one in |
7336733
to
763b519
Compare
Fixed more similar problems, have no more time to fix static tests, will follow up in a few days. No need to run tests, I'm aware that failures will happen. Happy NY! :) |
53498c0
to
68744ab
Compare
Found some more issues and fixed more static test failures. Then rebased interactively and squashed/splitted some commits together/out, so they are easier to understand. First commit solves all incorrect case-sensitive usages I was able to find, and the second commit deals with fixing of static test failures. @magento run all tests |
@magento run all tests |
@magento run Static Tests, Integration Tests |
68744ab
to
ab8b57e
Compare
@magento run all tests |
The additional changes done to @magento run Database Compare |
Description (*)
While playing around with phpstan on level 0 on the Magento codebase, these problems showed up (among many others, but those are for another day)
Update 2025-01-02: More cases were found then the ones listed above. This time not only by using phpstan, but by searching for those I already fixed which revealed more than phpstan was able to find (in comments for example).
This PR fixes these.
I don't think these caused real issues, I think composer's autoloader is gracefully enough to load those incorrectly cased namespaces, but let's make them correct anyways.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
vendor/bin/phpstan analyse --level=0 {some-path} | grep 'referenced with incorrect case'
on all Magento code, it should not output anything (don't run this on the root the M2 codebase, otherwise it will take hours and might crash your computer if you don't have at least 32 GB of memory)Questions or comments
I might fix (static) test failures if they don't turn out to be too complex to handle, but won't write new automated tests, because I think that's not relevant in scope of this PR.
Contribution checklist (*)
Resolved issues: