-
Notifications
You must be signed in to change notification settings - Fork 152
Magento Coding Standard Versioning Strategy #136
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
|
||
### `{patch}` Release | ||
- Bug fix to existing rule that prevents false-positive findings. | ||
- Removing PHP CodeSniffer OOB rule from Magento Coding Standard `ruleset.xml` file. |
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.
Move to minor
.
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.
Moved.
### `{patch}` Release | ||
- Bug fix to existing rule that prevents false-positive findings. | ||
- Removing PHP CodeSniffer OOB rule from Magento Coding Standard `ruleset.xml` file. | ||
- Removing Magento rule from MagentoCoding Standard (sniff code + `ruleset.xml`). |
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.
Move to major
.
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.
Moved.
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.
Why would "remove rule" be backward incompatible for Magento sniffs, but not for OOB sniffs? Both means, there will be less findings, which is technically backwards compatible
- Removing Magento rule from MagentoCoding Standard (sniff code + `ruleset.xml`). | ||
- Adding unit tests to existing rules. | ||
|
||
### `{minor}` Release |
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.
All this move to major
.
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.
Moved.
- review fixes
- added info about release line
### `{patch}` Release | ||
- Bug fix to existing rule that prevents false-positive findings. | ||
- Implementing unit tests for existing rules. | ||
- Adding new `exclude-pattern` or `include-pattern` to the rule. |
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.
include-pattern
would be a breaking change, wouldn't it?
- Adding new OOB rule to Magento Coding Standard `ruleset.xml` file. | ||
- Implementing new Magento rule and adding it to `ruleset.xml` file. | ||
- Changing the behaviour of existing Magento rule (extending functionality). | ||
- Changing the `severity` and the `type` of the rule. |
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.
Consider to distinguish between more or less strict rules. Increasing severity or changing a sniff type from "warning" to "error" is definitely backwards incompatible. The other way around, not (similar to removing a rule)
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.
Thanks! That's a really good point.
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.
Increasing severity or changing a sniff type from "warning" to "error" is definitely backwards incompatible
Actually, not. Any rule addition or change which does not require a backward-incompatible code change to satisfy it is backward-compatible.
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 address outstanding comments and ask someone from DevDocs to do "language review"
- review fixes
@buskamuza @paliarush @melnikovi wow, don't you think that this "unification" of sniffs went way too far? While it is just a slightly modified version of MEQP in a separate repo (which was not needed and requires additional maintenance efforts), now the next suggestion is to have SEPARATE versioning policy and SEPARATE backward compatibility policy. Have you ever heard of https://en.wikipedia.org/wiki/Occam%27s_razor? As I said earlier in Slack, standard evolution process must be described PRIOR to any such release. All use cases, like adding a new rule, strict following of standard for all the code should have been considered prior to any core repo change. Not sure if I will be able to attend a meeting today, if this proposal gets merged in any form will have to prepare a proper one for one of the next meetings. Cc: @antonkril |
Hi @orlangur!
You don't have to wait until something is merged to start discussion or working on something. Please, do not hesitate to add your constructive comments and concerns here. FYI, the reason why unified coding standard was introduced is described here. |
@lenaorobei I know that, my constructive comments were ignored in #51. TL;DR: this PR must not be merged as we do need a separate versioning and BC policy for "unified" approach. See you in 5 minutes on meeting. |
Why do you think we need semantic versioning? Who would be the clients for the standard that require the backward compatibility promise? How would the removal of a sniff break someone? There are some questions that we need to answer like "Which version of magento is this standard applied for?". But I'm not sure I understand how semantic versioning of standards will help with that question. |
Anton, yep, exactly. We raised same questions during call yesterday and I believe found a kind of agreement that things could be much simpler with versioning approach I proposed. The next step is: me providing it in details covering all use cases, stakeholders checking if it's a viable alternative providing additional cases/questions. |
@antonkril I think we need semantic versioning because we have responsibility for extension developers on Marketplace. If we add new rule, they need to change their code in order to pass our checks.
Removal of a rule will not break anyone, that's why it is
From Marketplace prospective coding standard applies to Magento 2, because the same set of rules we use for 2.0.x, 2.1.x, 2.2.x and 2.3.x compatible extensions. |
We are not married to semver, but since it's an industry standard, we picked it to make coding standard updates self-explanatory. It's easy, generally understood, and based on specific declared rules. Other constructive suggestions are welcome, but there aren't any in this thread yet. @orlangur our end goal is to unify the assorted static checks that pursue the same goal of enforcing coding guidelines, under a single global project and a single global policy. So we should really think of it long-term as THE sniff policy not ANOTHER policy. P.S. "Which version of Magento is this version coding standard applicable for" is a fantastic question, something to document and communicate for sure. |
Yep, exactly as they are supposed to do with any Magento release - check if extension works and adjust as needed.
I believe you didn't attend a meeting, unfortunately there is no recording uploaded yet. We can reuse existing release/versioning policy for other Magento components.
The answer is pretty straightforward in my approach. There should be the only one, no need in multiple release lines for Coding Standard, gosh :)
It takes some time. |
- fixes after the discussion
Proposal was updated with requested from @antonkril changes. |
One aspect which I think the versioning strategy is not able to capture due to only running the latest version so far are differences in Magento branches. So for example let's say we have a rule don't implement A rule like the above would absolutely make sense for anything 2.3+ but to be able to move forward with just one latest version ie Also please tag versions as 3.0.0, 4.0.0, 5.0.0 etc so that packagist/composer can understand the release numbers. |
An example for how the above could work
|
For violations which are unavoidable it is much more logical to ignore certain rules in certain files than maintain few standard branches.
In general, they shouldn't. Just like we do not allow cleanup PRs for
We don't need standard releases out of sync with Magento releases actually. So it makes much more sense to have version numbers like Later, when |
@orlangur Your comments generally seem to be coming from the Magento Core development angle. From my understanding this combined coding standard is meant to be used for more than that, like extension development, custom development, in other words anyone writing Magento and related code. Arbitrarily keeping it in sync with the release cycle of |
The above proposal with a targeted ruleset extending from the current one would not be a separate branch - it would be part of the same release. |
Surely, I take into consideration all the use cases.
This is the only reasonable cycle. Just like extension or custom shop developer does some adoption for new Magento release, code can be checked with newest standard and adjusted as needed. If one wants to be an early standard adopter, dev version of standard can be used.
Each release line - |
- style fixes
- style fixes
@paliarush and why this is merged without discussion? :) |
@orlangur this discussion was taking more than several weeks and we needed to unblock possibility to release new versions of the plugin. We had agreement on the latest version of the proposal between Magento team members. Please feel free to propose changes to the current version via a new PR. |
@paliarush thanks for the quick response! I don't think merging proposal without raised issues addressing is a good idea. Releasing new standard versions without a proper strategy and earlier than 2.3.2 Magento release is even worser idea. I'll propose a revert and versioning which does not contain described flaws soon. |
Problem
The is no document that describes Magento Coding Standard versioning.
Solution
The proposal describes rules that need to be followed when making new Magento Coding Standard release.
Requested Reviewers
@buskamuza
@paliarush
@melnikovi