cancel
Showing results for 
Search instead for 
Did you mean: 

Semantic Versioning Checker: versioning modules and fast-tracking Marketplace submissions

Adobe Team

We hope you are staying safe! This time, we are rolling out a new Marketplace process and unveiling a new tool for your convenience. 
 

First of all, let us officially introduce the Semantic Versioning Checker (SVC) tool, which is now public, open source, and available for unlimited use, feedback, and collaboration. It is available on GitHub at https://github.com/magento/magento-semver, along with documentation. The tool solves two problems  for developers who build and maintain Magento modules: 

 

  1. Determining how to version an updated Magento module based on severity of changes. Well-kept Magento modules follow semantic versioning. Now you can know how much of a version bump you need for your new module, by running the SVC tool against the code diff between your new module version and the previous one. This approach applies to our versioning of Magento Core, Marketplace extensions, and custom modules as well.
  2. Collect the list of backward-incompatible changes in a code diff and output them to a target file. This function works against a diff between local git branches and can be applied to any module or set of modules. It can be extremely useful when comparing Magento projects, whether you are preparing for an upgrade and want to inventory all changes in a new version of Magento, or overhauled a shared module and want to check your changes for backward compatibility. 

The SVC tool automatically versions our modules, and we highly recommend all extension and custom module developers to use it as the preferred versioning solution every time you re-package a module and assign a version to it. As always, we would love to hear feedback and suggestions for improvement, as well as collaborate with you on implementing them. 
 

Second of all, starting today, if your Magento Marketplace submission contains only "patch" level changes per SVC, it will be fast-tracked through manual technical review. For minor and major module version changes, the submission will go through manual testing, as usual. You will see a new check in your submission reports, called “svc”. It will fail if the submission is declared to be a “patch” but the code diff between the new version and the previous one contains minor or major changes. 

We hope for this change to add a degree of transparency and predictability when submitting fixes, content changes, and compatibility updates that don't contain significant changes. 
 

Here is how you can determine if your submission is a "patch" level submission - let's use magento/inventory module as an example: 

 

# To start, let's fetch and install the SVC tool: 

$ git clone git@github.com:magento/magento-semver.git 
$ composer install -d magento-semver 

 

Note: You can also install the magento/magento-semver package from the Magento Composer repository available at the https://repo.magento.com/  

 

Now let's grab the latest Magento Inventory release branch and the current development branch, and create local git branches for them: 

 

$ git clone --branch=1.2.0 --depth=1 git@github.com:magento/inventory.git inventory-1.2.0 
$ git clone --branch=1.2-develop --depth=1 git@github.com:magento/inventory.git inventory-1.2-develop 

 

 

Good to go! Now to run the SVC tool: 

 

$ ./magento-semver/bin/svc compare ./inventory-1.2.0 inventory-1.2-develop 
< Major change is detected. Please look into svc.log for details. 
$ echo $? 
< 0 

 

As you can see in the output, SVC detected major changes between the branches and finished successfully. To dig into the changes that were found, look inside the svc.log file. At the moment of writing this article, the major changes were in DB declaration - with only patch level changes in the PHP classes. 

 

If you would like to incorporate SVC into your CI/CD infrastructure (like we do), you may want to specify allowed level of changes: 1 for patch changes, 2 for minor, 3 for major. Here how it works in our example (note added 3rd argument to the command and non-zero command status code): 

 

$ ./magento-semver/bin/svc compare ./inventory-1.2.0 inventory-1.2-develop 1 
< Major change is detected. Please look into svc.log for details. 
< It exceeds the allowed change level, which is 1 (MAJOR). 
$ echo $? 
< 255 

Please follow the SVC project in GitHub and don't hesitate to connect with us in our public Slack workspace! 

 

Thank you for being a part of the Magento Community! 

 

3 Comments
Contributor

much obliged you posted about it...it was of great help

Contributor

Programming utilizing Semantic Versioning MUST proclaim an open API. This API could be proclaimed in the code itself or exist carefully in documentation. Anyway it is done, it SHOULD be exact and thorough.
An ordinary variant number MUST take the structure X.Y.Z where X, Y, and Z are non-negative numbers, and MUST NOT contain driving zeroes. X is the significant adaptation, Y is the minor rendition, and Z is the fix form. Every component MUST increment mathematically. For example: 1.9.0 - > 1.10.0 - > 1.11.0.
When a formed bundle has been delivered, the substance of that rendition MUST NOT be changed. Any adjustments MUST be delivered as another rendition.
Significant adaptation zero (0.y.z) is for starting turn of events. Anything MAY change whenever. The open API SHOULD NOT be viewed as steady.

Contributor

It is fantastic to hear about