-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Correctly return int values where required. #26930
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
Conversation
Hi @paul-gene. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paul-gene,
Your changes looks good, however there are some test failures, looks like your changes broke something.
Could you fix found issues?
Pull Request state was updated. Re-review required.
@ihor-sviziev are the tests failing due to my actual code change? |
@paul-gene seems like yes, but let’s restart failing tests, maybe it was some issue with testing infra |
@ihor-sviziev If my code change is the cause for failing tests, then the problem is bigger than I thought, as it means tests were written to be broken from the start. fml. Can the tests be re-run without a commit to kick them into action? |
@paul-gene TBH it's not seems the change chat could break functionality, but it might in not obvious way. All functional and integration tests are running all the time for all PRs, and I didn't saw that these tests were failing somewhere else. |
@ihor-sviziev I can see a few PRs around the same time as mine that are failing the same tests. |
@ihor-sviziev there is definitely something fishy going on. No way my code change broke this test: "Redirection URL does not match expectations The "expected" result looks to be empty in the test results. I don't see how my change could have broken that? |
Hi @VladimirZaets, thank you for the review.
|
@paul-gene thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
@VladimirZaets what's the next step to get this merged? |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests @paul-gene this command available only for maintainers |
Thanks @ihor-sviziev Are you able to explain this though? -#26930 (comment) From what I can tell (allure is terrible to read), there is no possible way my code change could be breaking some of those tests. |
@magento give me test instance |
Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paul-gene Unfortunately we have an error in our performance sanity check. For some reason opening the customer edit page fails:
1587742244099,240,Edit Customer (Admin Customer Management),200,OK,One Thread Scenarios Pool 5-1,text,false,Response was null,112515,0,1,1,http://localhost/builds/backend/customer/index/edit/id/1/,236,0,0
Could you please check what is the reason of that. You need to run jMeter scenario against your code (sanity (3).zip).
More information you can find here https://github.com/magento/magento2ce/tree/2.4-develop/setup/performance-toolkit. There's a mistake in there, you need to take 3rd version
Pull Request state was updated. Re-review required.
Hi @paul-gene, |
@ihor-sviziev honestly, I don't understand any of @slavvka 's comment. Everything was approved and all tests passed, so how all of a sudden did something break? |
@paul-gene your changes looks good, but we during running performance tests we found performance degradation in one specific case (that @slavvka described above). You could reproduce it by running attached jMeter profile from and compare changes from your PR with 2.4-develop branch. This is one of the last steps before merging PR, that's why it happened. Unfortunately we should strong motivation for accepting PRs that introduce performance degradation, while this PR don't have such, so it seems like PR should be adjusted. Hope you got my point. If you have any questions BTW I found that in comment above we have incorrect link, here is correct one https://github.com/magento/magento2/tree/2.4-develop/setup/performance-toolkit |
@ihor-sviziev I'll be honest, a lot of work was done after my initial commits, and I've never heard of, or used, jMeter. I'm not sure I believe that casting variables to integers would degrade performance enough for it to make any conceivable difference, if at all :/ |
@engcom-Echo could you please help @paul-gene find out what's wrong with the PAT Sanity scenario? |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide test scenarios in which returning int is required (i.e. broken functionality).
int
type hint covers both integers and numeric strings in fact.
See #14057 (comment) for more details.
Hi @orlangur,
|
@ihor-sviziev this code is incorrect, we cannot rely on types derived from files without strict types declaration. @paul-gene as per discussion in maintainers chat I'm closing this PR. We must use strict types in all new code, however, we have too many numeric strings in legacy code and any such change may cause bugs. |
Hi @paul-gene, thank you for your contribution! |
Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/159
https://github.com/magento/partners-magento2b2b/pull/61
Description (*)
The methods
getCustomerId
andgetCustomerGroupId
incorrectly return strings due to the usage ofgetData
. This PR casts the values to ints, to match the return type hints.Contribution checklist (*)