by mcdee · 7y ago · 0 comments
The whole point of semver is that it allows people to know if they can upgrade version without hitting incompatibilities. So yes, this would be a 2.2 and those on 2.1 would know that they could upgrade to it without worrying about fixing their own integrations.
The calender version 19.1 tells me nothing other than when it was released, which is of no interest whatsoever when evaluating what it does. Sounds like a triumph of marketing over useful information.
No. Semver states quite clearly that "Major version MUST be incremented if any backwards incompatible changes are introduced to the public API.".
It does NOT state that the Major verson MUST NOT be incremented if the api has no backwards incompatible changes.
You can increment the MAJOR component of the version number at your will. So this is quit clearly a 3.0.0 release. Or it could be a 40.0.0 release and it would still be valid semver.
It’s like if you have a fire alarm that goes off when there’s a fire but which also goes off randomly all of the time. People are going to stop listening to it, because even though it reliably rings when there’s a fire the fact that it rings is unlikely to mean there’s an actual fire.
In the same way, if you keep incrementing the major version without breaking changes then people can no longer rely on the version number to be alerted about breaking changes.
By all means, increment your major version number when you feel like it. Just don’t call it semver. Because even if you are technically allowed to, it goes against the spirit / point of semver IMO.
A perfect solution that strikes the balance between an engineer's unrelenting desire for correctness and the marketing departments seemingly irrational need for perceived progress.
But incrementing MAJOR on a yearly basis, if the major only changes by year, doing dep=X.* in your requirements.txt/package.json/Gemfile doesn't make much sense, if one of my dependencies has not significantly changed, why should I increase a version number in my dependency manager? It's just unnecessary work.
It can also raise interesting existential question if you have to release a version with a breaking change (let say, a security fix that necessitate a change in the API). What do you do then? If you don't increase MAJOR, you don't follow semver, if you increase it, you break your versioning pattern, and release 20.0 in 2019.
Semver get 80% of the job done. The 20% will still suck but Pareto and I agree that it's a pretty good deal given the effort.
An 80% solution in this problem space is correctly interpreted as "there's a 20% chance an upgrade will break my business." From a risk-management perspective, at least calendared versioning implies that you'll have to do your own homework on which upgrades are incompatible, which is at least more honest than ineffective rigor.
The 100% solution you imply as a strawman here doesn't exist and some information is better than no information. And no one said Semver means you don't test, it just guides you on the expected behavior of the new release.
Maybe if you deploy directly to production before any testing is done.
I envision a much simplified alternative (or analogue) to the semver: there is a single decimal revision, and you should strive to be compatible back to the first revision. When you are willing to break the compatibility, you simply rename. This is similar to Go's practice but can be technically made compatible to the three-part semver (by encoding minor and patch versions to the decimal).
Breaking change is the only thing I want to know about so realistically I only need to worry about major version updates right?
So lib: 1.* Should be fine, right?
But it's not and when people quip well you should have pegged your versions it's like what? Maybe you shouldn't have broke backwards compat?
That sounds like an awful idea that will result in people adding version information to the name, not to mention destroying discoverability.
Ie “version 3.3.1 of Awesome Server supporting the 2.x api as well as 3.1.x”
Generally though, I think for end user software, a "breaking" change is one that requires the user to relearn something, i.e it breaks an existing mental model.
Yet a cost based optimiser may break your application, completely.
Calendar Versioning prompts to update and highlights that you should test the behaviour every time, which sounds about right.
Also even a patch release of a SemVer library is allowed to be runtime incompatible. Throwing an exception on incorrect usage is down to the patch definition. It fixes incorrect (undefined) behaviour. Going from a O(1) to. O(n²) implementation to fix behaviour is also within SemVer patch level.
SemVer does not guarantee that your code will continue to work as intended after an upgrade. It only guarantees you don't have to change your code between minor versions.
Really if you're not constantly updating dependencies as part of your pipelines, you're going to quickly get into dependency rot issues.
Do it this way and save yourself the pain of zillions of updates when you HAVE to bump a package for a CVE.
https://martinfowler.com/bliki/FrequencyReducesDifficulty.ht...
You can get whiplash from conforming to every change in the winds.
Too many developers think banging out code as fast as they can is "doing their job well".
Old is bad, new is good. What else is there to understand?