-
Notifications
You must be signed in to change notification settings - Fork 566
Description
tl;dr - You already partly do it, just with different semantics to what the rest of us follow. Following semver strictly would give value to the main developer audience.
There are many different ways that software releases can be versioned - by name, by release date, by sequential integer, by some complex string of numbers that include internal build number / time and so on.
Sometimes releases may appear to be numerical, but turn out to be strings, when numbers are skipped over for technical reasons i.e. Windows 9, and PHP 6.
These version identifiers are aimed at different groups of users, but broadly, the less complex ones (e.g. names, like High Sierra, and Windows 10) are aimed at Users. The others with numbers are more aimed at developers - either developers of that software or developers who consume / develop against that software.
CMB2 is typically aimed at a developer audience.
To ensure compatibility, developers have to understand what the version means - a date or name-based version misses out on an opportunity to let developers know if there was any significant change or whether it was simply one or more bug fixes. That means consumers have to read all of the change log to avoid any nasty surprises.
You know where this is heading, but Semantic Versioning (semver) is the de facto standard that for the majority of packages, at least in the PHP / WP space, can and do follow. Read the spec if you aren't familiar.
The question, is what versioning system CMB2 uses, and whether anything can be gleaned from it.
There are 38 releases for this repo, but 9 of them have a version number less than 2.0.0. That means there have been 29 releases to get from 2.0.0 to 2.2.6.1.
Let's look at the release versions from latest, going backwards. E indicates that an enhancement was added, and B indicates a bug was fixed (according to the release notes):
2.2.6.1EB2.2.6EB2.2.5.3EB2.2.5.2B2.2.5.1B2.2.5EB2.2.4EB2.2.3.1EB2.2.3EB2.2.2.1B2.2.2EB2.2.1B2.2.0EB2.1.2B2.1.1EB2.1.0B2.0.9EB2.0.8B2.0.7EB (including breaking change)2.0.6EB2.0.5B2.0.4B2.0.3EB2.0.2E2.0.1EB- Various
2.0.0.*as beta releases.
First off is to note that in the last few releases, there is an inconsistent format of the version string itself - sometimes it's a.b.c, and others it's a.b.c.d. The a.b.c format is implicitly equal to a.b.c.0.
There are two patterns which indicate at least an underlying effort to follow semver:
- The "hotfix releases" (with the non-zero
dpart) tend to be bug-fix releases, though a couple of enhancements have also sneaked in. This extra.1implies a connection to the implicit.0, even if it's down at thedlevel. - There was a jump between
2.1.2and2.2.0, so despite2.1.0coming after2.0.9(indicative of not following semver), something in that2.2.0release suggested it was worth skipping over the rest of the2.1.*versions (a good thing).
In all cases, a is typically 2, due to the project's history, and that does make the use of semver for this project less clear-cut than other packages.
One obvious point where semver has not been followed is the documented breaking change for 2.0.7.
As with any software, the aim is not to break backwards compatibility (BC). Or, more specifically, it should not break BC accidentally / without a clear indicator. Having it just buried within release notes / changelog is not sufficient.
Let's assume that at some point in the next year or two, WP bumps the minimum required version of PHP to 5.4.
Let's even allow an overly-generous five-year lag before namespaces are allowed to be used in CMB2. At whichever point in time that will be, the switch to namespaces is going to break BC, and at that point, theme and plugin developers will need to know that.
Releases that identify as having breaking changes are a necessary part of software development. They allow for changes in public API for better long-term usage, the removal of old deprecated code that adds to maintenance, and generally, is a chance to reduce technical debt - as an example think of the simplified code if PHP 7 was the minimum required version, and what scalar type declarations could do.
Let's take the above list of releases since the v2 betas to see what that would look like if semver had been followed. (For the purposes of this first example, I'm actively going to ignore the breaking change):
2.15.0EB2.14.0EB2.13.0EB2.12.2B2.12.1B2.12.0EB2.11.0EB2.10.0EB2.9.0EB2.8.1B2.8.0EB2.7.1B2.7.0EB2.6.1B2.6.0EB2.5.1B2.5.0EB2.4.1B2.4.0EB(including breaking change)2.3.0EB2.2.2B2.2.1B2.2.0EB2.1.0E2.0.0EB- Various
2.0.0-betaas beta releases.
And now, including the breaking change:
3.11.0EB3.10.0EB3.9.0EB3.8.2B3.8.1B3.8.0EB3.7.0EB3.6.0EB3.5.0EB3.4.1B3.4.0EB3.3.1B3.3.0EB3.2.1B3.2.0EB3.1.1B3.1.0EB3.0.1B3.0.0EB (including breaking change)2.3.0EB2.2.2B2.2.1B2.2.0EB2.1.0E2.0.0EB- Various
2.0.0-betaas beta releases.
I'm not sure what concerns there are about using semver, but one often touted is that version numbers will get massive. That doesn't seem to concern Chrome (currently v62) and Firefox (v57), but as can be seen, the whole not-quite-3-years of CMB2 would only have got up to 2.15.0 or 3.11.0. Would developers be less inclined to use it because of that? I doubt it - more likely, they would be more appreciative of the project, because it followed semver.
As mentioned in the tweet that elicited the invite to open this issue - an intention not to break BC doesn't mean you can't follow semver; it has other value for the target audience for BC-compatible enhancements and bug-fix releases.
Based on all of this, I would propose two things:
- Treat "CMB2" and its expanded form as the marketing name. Users don't really care for version numbers, so while "CMB2 v3.1.4" may seem a little odd at first, Users will be fine with it. However, Developers can get value from understanding what a
3.1.4release might have compared to the3.1.3,3.0.8and2.18.5releases. - Switch to use semver strictly. Put out bug-fix only releases as a bump to the patch level (
cin our example, orzin the semver document), and any addition of an enhancement automatically means the minor release (bin our example, oryin the semver document) is bumped.