-
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
Put division calculations in less files in parentheses if they were not there alr… #38335
Put division calculations in less files in parentheses if they were not there alr… #38335
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. |
I spend a little bit more effort in checking security-package, inventory & magento2-page-builder code and only page-builder contained one mistake, here's the fix for that one: magento/magento2-page-builder#860 I've updated the description above so it's also clear there |
I just realised that I may have interpreted the |
79b2f37
to
91fe9b3
Compare
I've reverted my change to The only thing we actually needed to fix for less.js v4 is to put the division calculations in parentheses, not all calculation, that's only needed when I've force pushed my changes now. Still need to deal with static test failures. @magento run Static Tests |
@magento run Static 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. |
In the second commit of this PR, I've fixed some static test failures, only the ones I kind of agree that need fixing. All the other - in my opinion - are bugs in the coding-standards code and should be fixed there. I would very much appreciate it if somebody could double check these and if they don't make sense, just agree to ignore all failures and proceed with the PR as-is. @magento run all 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. |
sigh, I'm now seeing that compiling less files (both with less.js and less.php compiler) containing these static test fixes outputs all comments that are in the form of Adobe really should throw away all coding standards checks they do on less files, and start from scratch with another tool then phpcs, so that they actually make sense and don't annoy contributors so extremely. If I don't get an agreement, I'll just put a coding standard ignore statement at the top of every single less file that gives an issue so they don't get checked anymore all together. That would also solve the problem, it's not the right fix, but it's the fix that would allow this PR to move forward the quickest I guess... |
...design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/pages/_dashboard.less
Outdated
Show resolved
Hide resolved
app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-split.less
Outdated
Show resolved
Hide resolved
Regarding code styles - looks like it works incorrectly for less files. The comments should be |
9639ec2
to
0403454
Compare
@magento run Static 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. |
This will be very controversial, but the only reasonable way to fix static test failures for a coding-standard that's full of bugs with those less files, is just to ignore all those files. I spend an hour trying to figure out a better way, but there just isn't one. Anyways, if the static tests now no longer fail, I'm going to get this PR out of WIP. |
…t there already, this fixes generating correct css again after the upgrade to less.js v4 in AC-8098 & AC-9713.
0403454
to
21f53f3
Compare
@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. |
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.
looks good to me . Approved
@magento create issue |
Hello @hostep |
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.
Looks good for me
Approved
I found 3 files in theme |
Hello @hostep |
The necessary fixes for Magento EE repository have been provided to @engcom-Hotel in the patch |
@andrewbess: it's not needed to add extra parentheses in those lines you mentioned. Mathemetics in less follows the same principles as normal mathematics, in that divisions have a higher priority than additions. |
Ok. |
@magento run WebAPI Tests, Integration Tests, Functional Tests B2B |
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. |
31e972e
into
magento:2.4-develop
…eady, this fixes generating correct css again after the upgrade to less.js v4 in AC-8098 & AC-9713.
Description (*)
This PR comes from discussion in #38109 (comment), just some notes:
v4 of the less.js library is not backwards compatible with v3, all division calculations should be put in parentheses now.
I've only tested with Magento Open Source, it's likely that more changes will be needed for Magento Commerce and B2B (and whatever other products are out there)
I currently forgot to look into all the other modules that aren't included in this core Magento one, like pagebuilder, MSI, security-package, ... Those might need work as well...Update: only pagebuilder was affected, I created PR 860 on the magento2-page-builder repo to fix it thereUpdate 2: it turns out this wasn't need, so all is good here
I've tested this with the 3 themes included in Magento Opensource: Magento/blank, Magento/luma & Magento/backend, I know that Magento Commerce comes with a 4th theme as well and maybe there are more themes in the other products, I have no idea, so all should be tested
Update: I've also tested
bin/magento setup:static-content:deploy
(which uses a different less compiler) and compared the compiled css before these changes and after these changes and could see no differences, which is good 👍About the flagstrictMath
that was changed indev/tools/grunt/configs/less.js
, my idea was that this would highlight problematic code faster to custom theme developers, but from working on this PR, it only detects a very little amount of problems, so not sure if this is a good idea or notUpdate: this wasn't a good idea, this has been reverted now
The change inlib/web/css/source/lib/_utilities.less
to@{_property}: (@_value);
was a quick way to fix a bunch of different issues at the same time, not sure if that's the best way, also not sure if still needed, this was one of my first fixes, and I didn't want to re-test after all the hours I already spent on thisUpdate: I've removed this fix, and fixed the root causes instead
The majority of failing static tests are bugs in the coding standards (example 1, example 2, the other ones haven't been reported yet I think) and in my opinion we shouldn't fix those in this scope of this PR. And the PR should be approved even with those failing.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
package.json.sample
file, in the other copy, downgrade it back to version v3, like this:*.css
files inpub/static
from both copies. The output should be identical.bin/magento setup:static-content:deploy
and compare the compiled css before these changes and after these changes and see that there are no differencesContribution checklist (*)
Resolved issues: