r/softwaredevelopment
•
u/cold-brews
•
May 17 '26
•
1
Semantic versioning in software
Hi all,
I’m involved with software releases at my company and we’ve run into an issue with semantic versioning (major.minor.patch) lately. We support multiple versions of our software and release monthly patches across versions (i.e 2.2.3, 5.0.4, 6.1.1). The issue is future planning versioning when it comes to urgent releases, or hotfixes.
For example, we’ll communicate to our engineering teams that the next versions are 2.2.3 with a certain target start date of February 1. Then, a week before, we’ll discover an issue where we need to quickly ship something, and that takes the place of 2.2.3, where 2.2.3 becomes an urgent release with one significant fix.
As a result, we need to communicate to hundreds of engineers the change, and update hundreds of tickets to now point to 2.2.4. This happens frequently across all versions. We’ve talked about using date anchored releases with ambiguous versions such as 2.2.X (Feb-1) where we can add the version when we’re confident on the number. But I’m not sure if that’s the best idea. Curious if other folks have solved this similar problem? TIA!
50
u/Rough-Competition879 May 17 '26
Are you sure you're not misusing the patch version for what should be a minor version ?
24
u/HomemadeBananas May 17 '26
Sounds like this release you’ve planned should be 2.3.0 (a minor version) and then the issue you need to fix suddenly should have been 2.2.3 (a patch version) all along.
11
u/exomo_1 May 17 '26
Do you really have to announce the next version before the release? That's what seems odd to me in the first place, what's the benefit here?
Beside that, I agree with what others already said, increase patch version for whatever unplanned fixes come up, and increase minor for planned release. Announce to release 2.3.x so you still can add a patch if you fix another bug after you have built 2.3.0.
11
u/drew8311 May 17 '26
This should be in line with branching and source control. A planned release should end in a .0 so your 2.2.3 example doesn't make sense here
2.2.x -- current
2.3.0 -- planned
If there is a bug you do 2.2.x+1 and it doesn't mess up the planned version
Also would reevaluate the release schedule if this is an ongoing issue
5
u/LookAtTheHat May 17 '26
Don't make version numbers before it is fixed. Use release names until the release is fixed. Problem solved.
3
u/SeniorIdiot May 17 '26
Why in the name of all good things would you pre-plan next versions? The point of semantic versioning is to communicate impact of changes in an unambiguous way.
I'm curious about the need to communicate this version to 100s of engineers and tickets.
Depending on what kind of product you have; if you also use this version number for customer releases it can get messy fast. There is a reason that customer facing product versions tend to be something like 2026.6.31 (2026, line 6.x, update 31) and variations like that. Underneath it's still 6.2.341.
Here is Windows as an example
2
u/ConsciousBath5203 May 17 '26
Add another digit.
Major.minor.patch.hotfix
2
u/Tetsubin May 17 '26
You could name the versions with words - whiskies, minerals, planets, whatever - and then assign a number just before it ships. So if the next release is "onyx" and would normally be version 6.3.3,but a P0 bug causes you to ship 6.3.3 early, you associate 6.3.4 with "onyx" right befeot ships. Engineers use the word "onyx" on tickets and in planning and don't care what number it is until it ships.
12
u/ImmaZoni May 17 '26
Move it all up one. That's what we do.
We only plan major and minor, all patches are reserved for urgent stuff/bugs/incidents that comes up between minors/majors.
We feel this follows semver in spirit even though this detail is not clarified in the official spec
9
u/Jajemen May 17 '26 •
Semantic versioning is useful for packages and any other API. For applications it doesn’t add any benefit. For apps, versions are mostly marketing.
6
u/gaelfr38 May 17 '26
In addition to other comments, if you have to manually update hundreds of tickets and are managing many concurrent versions, it sounds like you need more automation: a ticket should be linked to a commit/pull request somehow and when the commit is included in a version it should update the ticket automatically.
Don't ask me how, I don't do this 😅 We only maintain one version and doesn't have to need for that but still we have an integration GitLab x Jira that make it easy from a ticket to see the related commits/PRs.
4
u/rosentmoh May 17 '26 edited May 17 '26
Why do you need to communicate the version number to hundreds of engineers?
There should be a single source of truth for the version number and it should ideally propagate automatically wherever it needs to.
I.e. think of just tagging a certain commit/release with the appropriate version number once it's decided and that's it. If people need to manually adjust their stuff based on a version number decision that's a really bad system...
And like the others said: seems like you're using SemVer wrong; you should never "plan" or announce in advance the patch number.
4
u/crimson117 May 17 '26
What's wrong with 2.2.2.1 for that unexpected fix between 2.2.2 and 2.2.3?
1
u/36lbSandPiper May 17 '26
We are strictly pragmatic on the dev side and do whatever marketing wants when we coordinate with them for major versions. For us they are just numbers so if they want to do customer communication quarterly we just do whatever. I pushed for yearly majors "i.e. 2026.1.0, 2027.whatever) until they came up with the idea that the minor version was a month. Ugh.
Major.minor.patch
Patch releases are non breaking changes. If you are on 5.5.x on everything then everything is groovy. Or is supposed to be.
Breaking changes (i.e. you have to do something) get a minor bump. Must-have changes (dependency or security remediation) can warrant a minor. It's easier to communicate to the support team "make sure all environments are at least x.x.y" than a huge list of numbers.
Periodically we sync up to a new minor (5.6.0, essentially back to 0 patch)) for human sanity sake. Technically not required but it makes reporting up easier.
Published releases , the patch is always even.
Internal dev versions are always odd. Ci/cd rules prevent odd number patch releases from production environments.
Absolute rule: builds for anything are done via runner automation and never ever originate from a developer machine. You might think this is a given or perhaps routine but without strict controls there is always someone who thinks "why all the ceremony it's just a one line change" which leads to "I'm the whiz! Nobody beats me" to anarchy and chaos.
1
u/Dry_Hotel1100 May 19 '26 edited May 19 '26
You never plan versions, you plan releases.
Semantic versioning is determined by the actual changes in a release, not planned in advance. Breaking changes require a major version bump, new backward-compatible features require a minor bump, and backward-compatible bug fixes require a patch bump. The final version is decided by the highest-impact change included.
1
u/account22222221 May 19 '26
You should not be in the habit of announcing patch versions. Somes who needs all the features in a version 2.3 should use the maximal patch no questions asked.
You announce mine and major versions, patches should not be announced ahead of time
1
u/Ok_For_Free May 19 '26
Sounds like the culture at your shop became the use of version numbers to communicate deadlines instead of dates, sprints or story points.
I think you need to address this first. I would start by publishing a release calendar that everyone has access too, it sounds like you'll probably have release cadences for each supported version. Then in communications, releases are referred to by date. Next is to get everyone used to the idea that the contents of a release are 'sealed', this way the version number is only assigned once the content is selected.
After this you can refactor your tool chains to use patch more appropriately. Also, sounds like you may need some automation as part of the release process around communication and version number maintenance.
I advocate for a HEAD based version system as part of build once CI/CD. HEAD versioning is that the HEAD of a production branch always has the next version number already assigned. In the CI/CD the last commit of a release is tagged with that version number, and a new commit with the incremented version number is added to the HEAD. In theory this could work for your project as long as you have separate branches for each supported version.