News for hackers. Stuff that matters.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jph on Saturday June 11, 2022 @09:28AM (#31704285)
Strong disagree with this post. Semantic versioning means: 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.

The purpose is to enable APIs and build tools to work well, such as package manager project files that specify a version.

To answer the author's questions:

"When was the last time you could tell someone the difference between version 1.2.1 and 1.2.3 quickly?" I can tell it's a patch upgrade, so my team's projects can do this upgrade automatically, with tests of course. Also, I can look at the source git repo, or changelog, or equivalent.

"Can you tell me when version 1.2.1 was released?" Yes, by looking at the source git repo, or git tags, or changelog, or equivalent.

"What is your company/team's meaning behind a major, minor, and patch increment?" Semver specifies how to do this in the first paragraph of www.semver.org.

"Who decides when a new major version is released?" The person who is responsible for the API breaking change; depending on the team and goals, this person could be the developer, or project manager, or release manager, etc.

"What happens to the version where the manager or developer forgot to put together a change log?" We test for it in our git pre-commit hook and in our continuous integration. If your team isn't using those, or equivalents, then simply add a changelog and push a patch version.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by ricardobeat on Saturday June 11, 2022 @09:39AM (#31704336)
The author seems to be focusing on applications. If you’re releasing an app, service or anything else that doesn’t expose a public API, there is no point in having those compatibility semantics.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jph on Saturday June 11, 2022 @09:50AM (#31704400)
If you're releasing an app that our teams are using, then yes please use semver, because we manage apps via system package managers (e.g. macOS brew, Windows wpm, Ubuntu apt, etc.) and containers (e.g. Docker, Podman, etc.), and infrastructure as code (e.g. Ansible, Packer, etc.).

This enables our systems to automate our application updates. We do PATCH updates continuously (e.g each night), MINOR updates during system downtime (e.g. each weekend), and MAJOR updates with manual scheduling when we can look at the changelogs.

If you're not managing your systems' applications with package managers or containers or infrastructure as code, then IMHO these are well worth a look.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by chrisseaton on Saturday June 11, 2022 @10:00AM (#31704474)
What do backwards compatibility and breaking changes mean in the context of an application?
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by tremon on Saturday June 11, 2022 @10:09AM (#31704536)
Couple of quick examples off the top of my head:

- changes in configuration statements

- changes in configuration defaults

- removal of functionality

- file format changes

- major architectural overhaul (maybe the functionality is still the same, but you still want to verify that yourself before deploying)

User acceptance testing is not just for software manufacturing, it can be done wherever the users are, and some companies take this very seriously.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by wereHamster on Saturday June 11, 2022 @09:52AM (#31704419)
Is it a breaking change if a button is moved by a few pixels in a graphical application?
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by runaway on Saturday June 11, 2022 @10:13AM (#31704564)
The first two responses to you were a solid yes and a solid no. I think that just demonstrates how the concept does not apply to application versioning.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @02:15PM (#31706724)
It most certainly applies, the previous poster gave good examples of config files syntax and semantics, db compatibility, etc, etc.

On the UI front it really depends, you need to make decisions and let users know to avoid surprises.

At Sun the process was that every possible interface that something or someone can depend on is acknowledged to be an interface. Is GUI pixel positioning an interface? Well yes, clearly it is as someone could write tools that rely on that position.

But do you as the author want to give users an assurance that you won't break this except in major releases? Maybe not. So interfaces were classified on the axis of public/private and stable/unstable (it was a bit more complex but that's the gist). Most applications used to classify the GUI elements as an unstable interface. Then you document that so consumers of the application know they shouldn't rely on GUI elements not moving.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by runaway on Saturday June 11, 2022 @02:57PM (#31707136)
I was specifically trying to contrast programming interfaces against the large universe of applications that don’t expose any. You bring up an interesting point about external dependencies such as db, however I would say the vast majority of these applications I refer to don’t rely on users to set these up.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by lostcolony on Saturday June 11, 2022 @12:14PM (#31705601)
One of the "Yes" responses is clearly sarcastic; the other gives an "only if you promise an unchanging UI".
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by runaway on Saturday June 11, 2022 @02:49PM (#31707051)
The yes I saw at the time has been deleted or edited I believe
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jph on Saturday June 11, 2022 @10:10AM (#31704547)
If the application documentation promises a stable screenshot, but an update moves a button, then yes this is a breaking change.

This comes up in the real world sometimes such as with automatic testing scripts that use absolute cursor positioning, as well as in some kinds of compliance where any graphic change requires a compliance verification of the new UI.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by lostcolony on Saturday June 11, 2022 @10:01AM (#31704478)
No, because the functionality is the same. Just because a test may be so brittle that it breaks the test does not change the meaning (it just may mean you have to manually inspect the now failing test).

The point is that most patch upgrades can just be run through a test suite and accepted. That may still lead to breakages, something that seemed minor and non-breaking to the developer could instead be breaking for a given user, but the point of semver is to convey actionable meaning and intent, which it does.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by orphea on Saturday June 11, 2022 @10:06AM (#31704516)
Yes. Also several weeks of beta are required before releasing the change, and a few blog posts about how a talented team at $COMPANY deals with challenges of UI design.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by onei on Saturday June 11, 2022 @09:52AM (#31704418)
Even if you do have an API, sometimes you have versioning built into that API anyway, e.g. in openapi and gRPC (depending on how you structure your protobuf files). At that point, a date-based version starts looking more reasonable.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by tailspin2019 on Saturday June 11, 2022 @09:55AM (#31704441)
Agreed. And even more so if you're developing a SaaS product or otherwise hosted app which is continuously updated.

The closer you get to continuous delivery, the more date-based versioning can make a bit more sense as opposed to "traditional" semantic versioning (though it's still often a subjective decision).

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @02:06PM (#31706630)
Strongly agree with your strong disagreement. The blog author doesn't seem to have any experience releasing software that others need to actually rely on.

This dovetails nicely with the discussion yesterday on using dependencies (https://news.ycombinator.com/item?id=31692606).

I would not want to have to depend on any library this blog author releases. From that list of random meanigless dates, how would tools know which release is a compatible bugfix and which ones carries breaking changes?

The assumption there seems to be that release date is the one and only thing consumers of the release care about. But as a consumer of some library, I can tell that I mostly don't care at all about the release date. But I must know what the release contains in terms of change disruption, which is the purpose of versioning.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by hotpotamus on Saturday June 11, 2022 @09:47AM (#31704382)
It sounds like you want to move slow and not break things. How quaint.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by tremon on Saturday June 11, 2022 @10:16AM (#31704587)
No, they still want to move quick, and you can do that by relying on the change signaling of your vendor: if you know the vendor is trustworthy, you can deploy minor updates with only minimal testing. If the vendor is unreliable or doesn't signal their changes accurately, every "minor" update becomes a liability, and that's where it gets slow.

Companies that want to move quickly should not use unreliable vendors.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by engineerDave on Saturday June 11, 2022 @05:22PM (#31708554)
It is possible to move fast and NOT break things.

Breaking things is bad. Despite what Mark says. When you break things companies lose customers, they lose money, they lose market share, and people get fired or die.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by engineerDave on Saturday June 11, 2022 @05:17PM (#31708513)
TBH the OP post seems to be highlighting that "when we forget history, we're doomed to repeat it."

Not trying to be ageist but a younger dev wouldn't have context on a time when the industry had timestamps as versions and the core reason why SemVer became preferred, as you describe above.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by chrisseaton on Saturday June 11, 2022 @09:52AM (#31704412)
> backwards compatible bug fixes

What even is a 'backwards compatible bug fix'? Unless it's performance, isn't a bug-fix by definition not going to be backwards compatible?

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by lostcolony on Saturday June 11, 2022 @10:05AM (#31704503)
Which is why you provide patch notes, and why the more conservative consumers won't even auto-accept patch updates. The point is that a bug fix that doesn't change the API, and which only changes behavior to match intent and documentation, is something that requires minimal testing by the user.

I.e., "fixed possible race condition where..." is a patch.

It may be that a consumer relied on a particular bug when developing, yes, and that fixing it now 'breaks' their application, but that's a definite minority, and why you communicate out the fixes (and for auto-adopting patch releases, you ideally still have automatic tests to validate).

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @02:33PM (#31706901)
> What even is a 'backwards compatible bug fix'? Unless it's performance, isn't a bug-fix by definition not going to be backwards compatible?

It's a fix that makes the code work as documented, which it didn't do before, ergo had a bug.

To pick a random example, the man page for strlen on Linux reads:

"The strlen() function calculates the length of the string s, excluding the terminating null byte ('\0')."

If it behaves differently (let's say it counts the terminating null) then strlen has a bug. The fix to that can go into a patch release because it simply fixes the interface to work as documented.

You could go down a rathole of saying well maybe someone depends on the broken functionality. Sure, but that's not what the documented contract was. The documented functionality is the contract the API needs to meet.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by chrisseaton on Saturday June 11, 2022 @02:57PM (#31707130)
That's too-specific an example. Often the bug is a corner case which wasn't considered, so that the documentation didn't say what was happening, and people were implying on the old relying behaviour.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by Sharlin on Saturday June 11, 2022 @10:03AM (#31704490)
Any bugfix could be seen as backwards incompatible in the strict sense "somewhere, someone might actually depend on this buggy behavior", yes. That’s not a particularly good definition of backwards incompatibility when it comes to bugfixes, however. A more reasonable definition is "requires changes to downstream code" as in the bug cannot be fixed without changing public API as well. That said, sometimes there definitely exist bugs that a lot of users factually rely on, and changing such behaviors should not be done in patch releases.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by k__ on Saturday June 11, 2022 @09:58AM (#31704464)
"MINOR version when you add functionality in a backwards compatible manner"

Impossible to guarantee and thus impossible to do SemVer.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by enragedcacti on Saturday June 11, 2022 @10:06AM (#31704519)
Almost all code is aspirational in terms of matching a spec, being backwards compatible, not having bugs, etc. Its meaningless to talk about what is guaranteed with respect to practically every piece of software in existence. What is important to a developer is "what is the risk that upgrading this software will break my deployment, and what do I gain from upgrading it", which semver relays to the developer to the best of the library author's ability.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @02:36PM (#31706936)
Functionality can always be added in a backward compatible manner, that is indeed the purpose of a minor release.

If libfoo has two public interfaces, sing() and dance(), I can add a third interface walk() and publish a binary-compatible libfoo.so which your consuming code can link to without any concern, as your code isn't calling walk() before it existed.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by k__ on Saturday June 11, 2022 @03:09PM (#31707268)
The moment you allow bugs, you can't ensure backwards compatible changes.

That makes semver as good as any other scheme, including GitDate.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @03:18PM (#31707354)
> The moment you allow bugs, you can't ensure backwards compatible changes.

I'm not sure what this even means, unless you're talking of the joke of "someone depended on the bug"?

A bug, by its very definition, means code that doesn't behave as the documented interface description states. Fixing bugs means correcting mistakes in the code so that now it does behave as documented. That's what patch releases do.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by k__ on Saturday June 11, 2022 @04:36PM (#31708113)
No, but if you say you don't break API in minor, but you have a bug that breaks API, then minor broke API.
Re:Bye Bye Semantic Versioning, Say Hello to GitDate by jjav on Saturday June 11, 2022 @05:28PM (#31708598)
Are you referring to the possibility of a minor release introducing a bug?

Yes, of course that's possible, nobody is pretending humans are infallible. When it happens, just issue a patch release to that minor release to fix the bug. Versioning is about communicating intent, it's not a guarantee that nobody can ever make a mistake.

But if you're constantly introducing bugs in minor releases, that's a sign of sloppy test infrastructure and it will motivate me to migrate away from such a library. But the occasional bug is normal, fix it quick and move on.

Re:Bye Bye Semantic Versioning, Say Hello to GitDate by 8organicbits on Saturday June 11, 2022 @10:04AM (#31704497)
It's OK if systems are imperfect, they are still helpful even though exceptions may occur. Intent matters. You may even see backwards incompatible changes treated as bugs fixed in subsequent releases.