[GH-ISSUE #504] Are you allowed to publish an older minor version after a major version? #6363

Closed
opened 2026-06-17 05:06:57 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @rgwilton on GitHub (Mar 12, 2019).
Original GitHub issue: https://github.com/semver/semver/issues/504

Say the following versions have been chronologically released: 1.0.0 -> 1.1.0 -> 2.0.0.

Does the scheme allow software to subsequently release a version 1.2.0 after 2.0.0 has been released? 1.2.0 would obviously be based on 1.1.0 with backwards compatible changes.

My working assumption is that because the scheme does not disallow this, then this is in fact allowed.

Originally created by @rgwilton on GitHub (Mar 12, 2019). Original GitHub issue: https://github.com/semver/semver/issues/504 Say the following versions have been chronologically released: 1.0.0 -> 1.1.0 -> 2.0.0. Does the scheme allow software to subsequently release a version 1.2.0 after 2.0.0 has been released? 1.2.0 would obviously be based on 1.1.0 with backwards compatible changes. My working assumption is that because the scheme does not disallow this, then this is in fact allowed.
Author
Owner

@lirantal commented on GitHub (Mar 12, 2019):

Makes sense to allow it. One important requirement for this is back-porting of security fixes to previous versions.

<!-- gh-comment-id:471933519 --> @lirantal commented on GitHub (Mar 12, 2019): Makes sense to allow it. One important requirement for this is back-porting of security fixes to previous versions.
Author
Owner

@ljharb commented on GitHub (Mar 12, 2019):

It’s absolutely critical, yes. For backporting of anything, including features.

<!-- gh-comment-id:472059159 --> @ljharb commented on GitHub (Mar 12, 2019): It’s absolutely critical, yes. For backporting of anything, including features.
Author
Owner

@segiddins commented on GitHub (Mar 12, 2019):

SemVer doesn't say anything about when you publish which versions, only about how those versions relate to each other. You're free to publish a "lower" version at any time, so long as it's the appropriate version for the changes it contains relative to the newest version less than that version.

<!-- gh-comment-id:472086070 --> @segiddins commented on GitHub (Mar 12, 2019): SemVer doesn't say anything about _when_ you publish which versions, only about how those versions relate to each other. You're free to publish a "lower" version at any time, so long as it's the appropriate version for the changes it contains _relative to the newest version less than that version_.
Author
Owner

@haacked commented on GitHub (Mar 30, 2019):

I agree with @segiddins.

You're free to publish a "lower" version at any time, so long as it's the appropriate version for the changes it contains relative to the newest version less than that version.

The one thing to be careful about is to make sure the package registry doesn't mark this as the latest version. I assume most hosts will do the right thing and mark the highest version number as the latest, but I've written software before and I know how it can sometimes not do what it should. 😛

<!-- gh-comment-id:478288970 --> @haacked commented on GitHub (Mar 30, 2019): I agree with @segiddins. > You're free to publish a "lower" version at any time, so long as it's the appropriate version for the changes it contains relative to the newest version less than that version. The one thing to be careful about is to make sure the package registry doesn't mark this as the latest version. I assume most hosts will do the right thing and mark the highest version number as the latest, but I've written software before and I know how it can sometimes not do what it should. 😛
Author
Owner

@ljharb commented on GitHub (Mar 30, 2019):

To protect myself against that with npm, I made and use https://npmjs.com/safe-publish-latest :-)

<!-- gh-comment-id:478290290 --> @ljharb commented on GitHub (Mar 30, 2019): To protect myself against that with npm, I made and use https://npmjs.com/safe-publish-latest :-)
Author
Owner

@jwdonahue commented on GitHub (Mar 31, 2019):

See my reply to #484.

<!-- gh-comment-id:478304340 --> @jwdonahue commented on GitHub (Mar 31, 2019): See [my reply](https://github.com/semver/semver/issues/484#issuecomment-465000656) to #484.
Author
Owner

@isaacs commented on GitHub (Apr 30, 2019):

Yes, SemVer is 100% time agnostic.

In npm, you can publish an older version and avoid marking it as latest by using the --tag command line option. I usually do npm publish --tag=legacy for updates to previous versions, and npm publish --tag=next for release candidates that are not yet ready for being the default distribution.

<!-- gh-comment-id:488074775 --> @isaacs commented on GitHub (Apr 30, 2019): Yes, SemVer is 100% time agnostic. In npm, you can publish an older version and avoid marking it as `latest` by using the `--tag` command line option. I usually do `npm publish --tag=legacy` for updates to previous versions, and `npm publish --tag=next` for release candidates that are not yet ready for being the default distribution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#6363