cancel
Showing results for 
Search instead for 
Did you mean: 

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

igor_gorin1
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!