Radek
2 min readMar 23, 2021

--

Meaningful versioning

Versioning is difficult. You might develop API, library, tool, micro-service, installable application to OS, application to smartphone… And all those might have difficult versioning based on purpose and release cycle. Should be ie. the release cycle considered in the version?

You probably heard about semantic versioning 2.0.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,

MINOR version when you add functionality in a backwards compatible manner, and

PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Probably the easiest one. Fixes increase patch. New functionality, API, … increase minor. Incompatible change increase major. But it’s fits nicely only for libs and APIs.

But what if you have a product. What is the compatible change? Is it a new feature? So everytime when you release a new build you increase minor? Is it compatible with deployment, integration test, apis, front end…? This goes into dimensions where semantic versioning doesn’t work.

I like Ubuntu versioning. Simply, you know what to expect as a developer and also an user. Every half a year you get a new product release – 20.04, 20.10, 21.04,… You know exactly how old the product is and when the next release is going to happen.

{YY}.{MM}.{DD}

What happen if you need to be compatible with some platform. Let say you develop Android application and your minimal supported version of API is 22? Combine Ubuntu one with minimal supported version of your code — put the minimal supported API into the version – 22.21.04, 22.21.10, …

{minimal supported version}.{YY}.{MM}.{DD}

Are you building fast and have multiple releases per day. Use date and build number – 20.03.14.43, 20.03.14.56, … when you take a look at production you know how old the component is comparing with the one you want to release. I personally don’t like commit hash because on most CI build number is enough and it links you to commit and I prefer incremental relasing.

{minimal supported version}.{YY}.{MM}.{DD}.{build number}

Developing application for Windows and Linux in Python or Java? I set minimal JRE or Python interpreter into version with OS – 26.21.04.win (python 2.6+ on windows), 30.21.04.lin (python 3+on lin).

{minimal supported version}.{YY}.{MM}.{DD}.{build number}.{wheel}

If I version this post 7.8.1? What does it say? When I use 21.03.23.65.en.medium. I published it on 23rd March 2021 with 65 patches it’s in English published on Medium.

--

--