magento / magento-semver

Magento Semantic Versioning Checker. Join #svc in our Community Slack: https://opensource.magento.com/slack. Static tests that identify required module version changes based on code diff, and look for backward incompatible changes.
Other
32 stars 25 forks source link

Request: Add a ruleset reference #64

Open barbazul opened 3 years ago

barbazul commented 3 years ago

PHP Semver Checker has one https://github.com/tomzx/php-semver-checker/blob/master/docs/Ruleset.md and is pretty handy for quickly checking before making a change.

In most cases where there is already a version constraint set it is very inconvenient to have to make the change, then run the tool, then have to rollback parts of the work done to avoid breaking changes.

The ruleset could be a simple md file referencing the original ruleset, specifying the few overrides and explaining all the custom Magento 2 rules being added

m2-assistant[bot] commented 3 years ago

Hi @barbazul. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


barbazul commented 3 years ago

@magento I am working on this

barbazul commented 3 years ago

As I am currently working on documenting a Ruleset.md file I detected some issues .

I have found a discrepancy in code format. Some rules follow the format MXYZ like M123 and some others follow M0XYZ like M0123 which leads to some pseudo-collisions like

Code Level Rule
M0122 MAJOR Extends has been removed.
M122 PATCH [private] Method return typing changed.

Some other cases actually collide. So far the only example I have found is rule M108 which is duplicated both classes refer to the same situation (a DB foreign key being dropped/removed). I am documenting these as 2 rows like the following:

Code Level Rule
M108 MAJOR Foreign key removed from declaration but it may have had business logic in onDelete statement
M108 MAJOR Foreign key was removed
barbazul commented 3 years ago

Work in progress: https://github.com/barbazul/magento-semver/blob/documented-ruleset/docs/Ruleset.md