Compiled on: 2024-05-07 — printable version
Versioning: the process of assigning a unique identifier to a unique state of some software
Versioning can happen at different levels, for instance:
W.r.t. the administrative boundaries (e.g. the organization, the department, the team) versioning can be:
Often for open source projects, internal and external versioning coincide
The version is represented by a (usually pronounceable) word, short phrase or acronym
Examples: macOS Sierra, Windows Vista, Ubuntu Bionic Beaver
18.04
Bionic Beaver or MacOS X 10.13.5
SierraThe version is represented by a string representing the release date
Example: Ubuntu 18.04
, Windows 2000
, Office 2007
, Visual Studio 2022
Dates don’t always match development rate
Useful for projects that are fast-paced (multiple releases per week)
Useful as a companion for other versioning schemes
Useful at the commercial level for clearly indicating the novelty (and the age) of a project
The version is represented by a string whose length grows at each version
Example: $\TeX$ 3.1
, 3.14
, 3.141
, …, $\pi$
Only useful for project that reached maturity
Extremely unlikely in today’s software world
May lead to version length explosion
The version is represented one or more numbers, separately incremented, that
reflect incrementally widespread changes in the product
Example: 1.0.1
, 1.1.0
, 2.0.0
Combination of all the techniques:
Dates (Windows 9x, 2001)
Codenames (NT, Vista, XP, Millenium Edition)
Pre-release code-names (Longhorn)
Dates for internal builds
Incremental versions on multiple levels
Separation between “commercial” versions and “actual” “versions”
Proliferation of methodologies and inconsistencies leads to issues
Different versioning styles over time
Version 1
to 9
: commercial names were linear
Version X
(10
in Roman numerals) become part the commercial name
Mac OS X was a series of products, distinguished by a number of big cats names and sub-numbers
10.0
(code name Cheetah) … Mac OS X 10.8
(code name Mountain Lion)Product name become simply macOS since version 10.12
(Sierra)
Version 11
(Big Sur) is the first version of macOS to be numbered 11
Current version is 14
(Sonoma)
The Darwin (i.e. macOS’s Kernel) versioning schema is completely different from the commercial version number
23.4.0
Association of a date in format YY.MM
and a two word code-name in form of Adjective AnimalName
. Both the words of the code-name begin with the
same letter.
Version number does not track changes
“LTS” can be optionally appended to identify “Long Term Support” versions
Two versions of Ubuntu can be compared by date but also by the first letter of their codename
What happens to a software product after a new version is released?
Let’s say product X
is released under code name Abstract Alfred
with version 1.0.0
Developers keep working on the product, and release a new version 1.1.0
under code name Boring Beatrix
Some severe security issue is found in version 1.1.0
and a patch 1.1.1
is released
1.1.1
is now released under Boring Beatrix v2
code nameThe bug is still affecting Abstract Alfred
, which still has a lot of active users
1.0.1
is released for Abstract Alfred
, containing the same fix of 1.1.1
, but not all the features of 1.1.0
Abstract Alfred v2
Takeaways:
- one version does not stop to exist when the next one is released
- bug fixes are often back-ported to older versions
Big software companies often provide support for their products, for a given amount of time
When releasing a new version of a product, the company shall keep spending money to maintain the old one
The end of support is the date after which the company will not provide any more support for the product
Most commonly, the end of support is announced well in advance
On the user side, it is important to know when the end of support is to plan the migration to newer versions
Most commonly when release is periodic the default support time window is relatively short
Examples:
Once every few years, a version is released with Long-Term Support (LTS)
Formerly a pure date, in ISO format without hyphens, e.g. 20040505
.
The project switched to a classic versioning in form of major.minor
20040505
is bigger than 3.9
and other subsequent versions.0.Date
format for initial development releases would have been advisable with hindsightPurely unary numbering converging to $\pi{}$
3.141592653
At the time of my death, it is my intention that the then-current versions of $\TeX$ […] be forever left unchanged, except that the final version numbers to be reported in the “banner” lines of the programs should become: TeX, Version $\pi $ […]. From that moment on, all “bugs” will be permanent “features”.
Donald E. Knuth
It is the way Python software should be versioned
Format: [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
N
followed by exclamation mark (e.g. 1!
)N1
, N2
, …, separated by .
(e.g. 1.2.3.4.5
)a
, b
, rc
followed by an integer number N
(e.g. a1
, b2
, rc3
).
followed by post
and an integer number N
(e.g. .post1
).
followed by dev
and an integer number N
(e.g. .dev1
)Encodes version numbers and their change to convey meaning about the underlying code and what has been modified from one version to the next.
X.Y.Z[-P][+B]
X
$\Rightarrow$ mandatory Major (integer number)Y
$\Rightarrow$ mandatory Minor (integer number)Z
$\Rightarrow$ mandatory Patch (integer number)P
$\Rightarrow$ optional Pre-release (alphanumeric string, prepended by -
)B
$\Rightarrow$ optional Build metadata (alphanumeric string, prepended by +
)X.Y.Z
where X
, Y
, and Z
are non-negative integers, and MUST NOT contain leading zeroes.X
is the major version, Y
is the minor version, and Z
is the patch version.
Each element MUST increase numerically.Z
MUST be incremented if only backwards compatible bug fixes are introduced.
A bug fix is defined as an internal change that fixes incorrect behavior.Y
MUST be incremented if new, backwards compatible functionality is introduced to the public API.
X
MUST be incremented if any backwards incompatible changes are introduced to the public API.
MAY
include minor and patch level changes.Version number 0.1.0
is the minimum (i.e. first) one
Major version zero (0.y.z
) is for initial development: anything may change at any time
Version 1.0.0
defines the public API (or at least its first version)
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version
[0-9A-Za-z-]
.Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version
[0-9A-Za-z-]
.E.g. NumPy
E.g. Kivy
Think before choosing a versioning schema, and then be consistent
Semantic versioning is warmly recommended
Codenames can be used informally
Dates may make sense for projects with fast and steady development
The underlying state of the DVCS can be used to assign version numbers to the software
The practice can change, but consider for instance a case in which:
X.Y.Z
formatT
T=0.1.0
T
H
the current hash, it is T-C+H
What do we need commit messages for?
Identify what is different between changes
But isn’t this essentially what DVCS is about?
find a way to write conventional commit messages such that some automatic tool can understand whether a new version should be released
Put humans and sentiments out of the loop
One of the possible ways to write standardized commits – https://www.conventionalcommits.org/
Heavily inspired by the Angular convention: https://bit.ly/3VnAp4T
Format (optional parts in [
square brackets]
):
type[(scope)][!]: description
[body]
[BREAKING CHANGE: <breaking change description>]
type
: what the commit introduces
fix
(bug fix, no API change) and feat
(new feature) always presentbuild
, chore
, ci
, docs
, style
, refactor
, perf
, test
scope
identifies the module of the software that was changed!
before the :
and/or by a description in the footer of the commit after BREAKING CHANGE:
Assuming a conventional way to commit, use the information to understand when and how to release
fix
and docs
are PATCH
, feat
are MINOR
, Breaking changes are MAJOR
semantic-release
An implementation of Semantic release: https://github.com/semantic-release/semantic-release
semantic-release