From 861a8fba919ef51a3c0e5bcf5f0e676a13afc3d0 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Mon, 1 Apr 2019 16:33:02 -0500 Subject: [PATCH 1/7] Magento Coding Standard Versioning Strategy --- .../static/coding-standard-versioning.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 design-documents/testing/static/coding-standard-versioning.md diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md new file mode 100644 index 000000000..52cbe4502 --- /dev/null +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -0,0 +1,39 @@ +# Magento Coding Standard Versioning + +The purpose of this document is the defining versioning strategy for [Magento Coding Standard](https://github.com/magento/magento-coding-standard). + +## Summary + +Version number should be increased with taking [Semantic Versioning](https://semver.org/) into account. +Given a version number `{major}`.`{minor}`.`{patch}`, following rules MUST be applied: + +- `{patch}` version MUST be incremented when backward compatible changes (bug fixes) were made. + +- `{minor}` version MUST be incremented when backward compatible changes (new features) were added. + +- `{major}` version MUST be incremented when backward incompatible changes were made. + +### Terminology + +**PHP CodeSniffer OOB rule** - rule that goes out-of-box with PHP CodeSniffer, the part of its package, the part of specific Coding Standard (PSR2, Squiz, etc). + +**Magento rule** - Magento specific rule, tah part of Magento Coding Standard, located under [Magento2/Sniffs/](https://github.com/magento/magento-coding-standard/tree/develop/Magento2/Sniffs) directory. + +### Versioning use cases + +Following use cases are representing code change examples relatively to the version part that needs to be changed. + +### `{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`). +- Adding unit tests to existing rules. + +### `{minor}` Release +- 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). + +### `{major}` Release +- Changing platform requirements. +- Namespace changes. From 969dbb59790882fc5a28388ffd3b1bca2d790adf Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Wed, 3 Apr 2019 13:01:34 -0500 Subject: [PATCH 2/7] Magento Coding Standard Versioning Strategy - review fixes --- .../testing/static/coding-standard-versioning.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index 52cbe4502..ae83e0514 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -17,7 +17,7 @@ Given a version number `{major}`.`{minor}`.`{patch}`, following rules MUST be ap **PHP CodeSniffer OOB rule** - rule that goes out-of-box with PHP CodeSniffer, the part of its package, the part of specific Coding Standard (PSR2, Squiz, etc). -**Magento rule** - Magento specific rule, tah part of Magento Coding Standard, located under [Magento2/Sniffs/](https://github.com/magento/magento-coding-standard/tree/develop/Magento2/Sniffs) directory. +**Magento rule** - Magento specific rule, the part of Magento Coding Standard, located under [Magento2/Sniffs/](https://github.com/magento/magento-coding-standard/tree/develop/Magento2/Sniffs) directory. ### Versioning use cases @@ -25,15 +25,17 @@ Following use cases are representing code change examples relatively to the vers ### `{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`). -- Adding unit tests to existing rules. +- Implementing unit tests for existing rules. +- Adding new `exclude-pattern` or `include-pattern` to the rule. ### `{minor}` Release +- Removing PHP CodeSniffer OOB rule from Magento Coding Standard `ruleset.xml` file. + +### `{major}` Release +- Removing Magento rule from Magento Coding Standard (sniff code + `ruleset.xml`). - 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). - -### `{major}` Release +- Changing the `severity` and the `type` of the rule. - Changing platform requirements. -- Namespace changes. +- Changing namespace. From 458aa55f944324d1ed1e184f0b0c6b55253059cd Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Wed, 3 Apr 2019 16:48:55 -0500 Subject: [PATCH 3/7] Magento Coding Standard Versioning Strategy - added info about release line --- .../static/coding-standard-versioning.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index ae83e0514..dc94f4863 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -39,3 +39,23 @@ Following use cases are representing code change examples relatively to the vers - Changing the `severity` and the `type` of the rule. - Changing platform requirements. - Changing namespace. + +## Release Line +Only one release line will be supported based on incremental approach depending on introduced changes. +General overview scheme: + +``` +1.0.0 + | +1.0.1 + | +1.0.2 + | + |__1.1.0 + | + |__2.0.0 + | + |__2.0.1 +``` + +No `{patch}` and `{minor}` releases will be made to the previous `{major}` (1.0.0) version if the new `{major}` (2.0.0) version already exists. From e556317dd896431715f4ff6bd969629248aef39b Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Mon, 15 Apr 2019 10:00:44 -0500 Subject: [PATCH 4/7] Magento Coding Standard Versioning Strategy - review fixes --- .../testing/static/coding-standard-versioning.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index dc94f4863..640b8b00d 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -26,17 +26,23 @@ Following use cases are representing code change examples relatively to the vers ### `{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. ### `{minor}` Release - Removing PHP CodeSniffer OOB rule from Magento Coding Standard `ruleset.xml` file. +- Removing Magento rule from Magento Coding Standard (sniff code + `ruleset.xml`). +- Adding new `exclude-pattern` to the rule. +- Decreasing the `severity`. +- Changing `type` from `error` to `warning`. + +In context of Coding Standard backward incompatible change occurs when rules became stricter and produce more findings. ### `{major}` Release -- Removing Magento rule from Magento Coding Standard (sniff code + `ruleset.xml`). - 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. +- Adding new `include-pattern` to the rule. +- Increasing the `severity`. +- Changing `type` from `warning` to `error`. - Changing platform requirements. - Changing namespace. From 8a16753af8bbfaf45e74168c74dee221826f0836 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Thu, 25 Apr 2019 13:19:29 -0500 Subject: [PATCH 5/7] Magento Coding Standard Versioning Strategy - fixes after the discussion --- .../static/coding-standard-versioning.md | 79 ++++++------------- 1 file changed, 24 insertions(+), 55 deletions(-) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index 640b8b00d..47b3781a0 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -1,67 +1,36 @@ # Magento Coding Standard Versioning - The purpose of this document is the defining versioning strategy for [Magento Coding Standard](https://github.com/magento/magento-coding-standard). -## Summary - -Version number should be increased with taking [Semantic Versioning](https://semver.org/) into account. -Given a version number `{major}`.`{minor}`.`{patch}`, following rules MUST be applied: - -- `{patch}` version MUST be incremented when backward compatible changes (bug fixes) were made. - -- `{minor}` version MUST be incremented when backward compatible changes (new features) were added. - -- `{major}` version MUST be incremented when backward incompatible changes were made. - -### Terminology - -**PHP CodeSniffer OOB rule** - rule that goes out-of-box with PHP CodeSniffer, the part of its package, the part of specific Coding Standard (PSR2, Squiz, etc). - -**Magento rule** - Magento specific rule, the part of Magento Coding Standard, located under [Magento2/Sniffs/](https://github.com/magento/magento-coding-standard/tree/develop/Magento2/Sniffs) directory. - -### Versioning use cases - -Following use cases are representing code change examples relatively to the version part that needs to be changed. +## Release Line +One release line will be supported based on incremental approach despite introduced changes (new rules, bug fixes, etc). +General overview scheme: -### `{patch}` Release -- Bug fix to existing rule that prevents false-positive findings. -- Implementing unit tests for existing rules. +``` +3 - 4 - 5 - ... - 42 - ... - N -### `{minor}` Release -- Removing PHP CodeSniffer OOB rule from Magento Coding Standard `ruleset.xml` file. -- Removing Magento rule from Magento Coding Standard (sniff code + `ruleset.xml`). -- Adding new `exclude-pattern` to the rule. -- Decreasing the `severity`. -- Changing `type` from `error` to `warning`. +``` -In context of Coding Standard backward incompatible change occurs when rules became stricter and produce more findings. +Single number sequence-based version identifier will be incremented every release. -### `{major}` Release -- 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). -- Adding new `include-pattern` to the rule. -- Increasing the `severity`. -- Changing `type` from `warning` to `error`. -- Changing platform requirements. -- Changing namespace. +Once new release happens it automatically means that all users core developers, community contributors, system integrators and extension developers need to follow the latest version. -## Release Line -Only one release line will be supported based on incremental approach depending on introduced changes. -General overview scheme: +**Only the latest version** will be supported. +## Dependency +Since we want all users core developers, community contributors, system integrators and extension developers to follow the latest version of Coding Standard, the dependency should be `"*"`. ``` -1.0.0 - | -1.0.1 - | -1.0.2 - | - |__1.1.0 - | - |__2.0.0 - | - |__2.0.1 + "require-dev": { + ... + "magento/magento-coding-standard": "*", + ... + } ``` -No `{patch}` and `{minor}` releases will be made to the previous `{major}` (1.0.0) version if the new `{major}` (2.0.0) version already exists. +## Side Effects +- No `patch` or `minor` dependency will be possible, so any change may lead to build (code check) failure. +- If released Magento package will contain `"*"` dependency any update may lead to build (code check) failure. + +## Marketplace Notifications +- Developers on Marketplace will be notified prior EQP will update the version for PHPCodeSniffer check. +- Developers on Marketplace will see in the report what version was used during the check. +- Extension will be rejected in case it does not follow the latest Coding Standard version. From 59710550966dec5ed01ae663ccee50ec4baa4b35 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Thu, 2 May 2019 16:17:34 -0500 Subject: [PATCH 6/7] Magento Coding Standard Versioning Strategy - style fixes --- design-documents/testing/static/coding-standard-versioning.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index 47b3781a0..cfbbe7ba0 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -12,12 +12,12 @@ General overview scheme: Single number sequence-based version identifier will be incremented every release. -Once new release happens it automatically means that all users core developers, community contributors, system integrators and extension developers need to follow the latest version. +Once new release happens it automatically means that all users core developers, community contributors, system integrators and extension developers need to follow the latest version. **Only the latest version** will be supported. ## Dependency -Since we want all users core developers, community contributors, system integrators and extension developers to follow the latest version of Coding Standard, the dependency should be `"*"`. +Since we want all users core developers, community contributors, system integrators and extension developers to follow the latest version of Coding Standard, the dependency should be `"*"`. ``` "require-dev": { ... From ede2e4cb831fdcbee3979be222dfddc1fd60297c Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Thu, 2 May 2019 16:17:34 -0500 Subject: [PATCH 7/7] Magento Coding Standard Versioning Strategy - style fixes --- design-documents/testing/static/coding-standard-versioning.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design-documents/testing/static/coding-standard-versioning.md b/design-documents/testing/static/coding-standard-versioning.md index cfbbe7ba0..3cdf242e6 100644 --- a/design-documents/testing/static/coding-standard-versioning.md +++ b/design-documents/testing/static/coding-standard-versioning.md @@ -12,12 +12,12 @@ General overview scheme: Single number sequence-based version identifier will be incremented every release. -Once new release happens it automatically means that all users core developers, community contributors, system integrators and extension developers need to follow the latest version. +Once new release happens it automatically means that all users (core developers, community contributors, system integrators and extension developers) need to follow the latest version. **Only the latest version** will be supported. ## Dependency -Since we want all users core developers, community contributors, system integrators and extension developers to follow the latest version of Coding Standard, the dependency should be `"*"`. +Since we want all users (core developers, community contributors, system integrators and extension developers) to follow the latest version of Coding Standard, the dependency should be `"*"`. ``` "require-dev": { ...