Skip to content

Extending SemVer for private nightly/continuous builds #46

Haacked opened this Issue Oct 26, 2011 · 3 comments

1 participant

Haacked commented Oct 26, 2011

In looking at SemVer, it seems to only be concerned with how you version public APIs, which is great. But one thing we're struggling with is how to best manage internal-only nightly/continuous builds.

We want to set up an internal package manager server (NuGet) to share libraries with other teams in our org who are not in our source repo. The problem becomes, when we're starting to work on 1.0.1beta, we need a way to version each build of it (multiple builds could happen in a day). We want to reserve 1.0.1beta for the actual public release of that beta.

If you're interested in the full details, I wrote it up in my blog.

One thought we had would be to have an optional extension to SemVer that made use of a fourth version part. This part would represent the build number for the release and is intended only for internal consumption. Sharing among teams. From a public API perspective, the build number should not be relied upon.

Internally, when sharing with other teams, we'll have the benefit of having all of our packages with the same public version, 1.0.1beta, but the build number can be used to determine last known good builds.

The sorting would be something like this (note, I'd probably use a number that represents the date in a real situation rather than 00X):

  • 1.0.1alpha
  • 1.0.1beta.001
  • 1.0.1beta.002
  • 1.0.1beta.003
  • 1.0.1beta

One reason we like this approach is that the public part of the version never changes for a release from build to build. So all of our tools and other collateral doesn't need to change once we stamp a build as final and simply remove the build number.

Would love to hear any thoughts on this proposal.

Haacked commented Oct 26, 2011

It looks like this issue was already addressed in this comment: #33 (comment)

Haacked commented Oct 26, 2011

Closing this issue as it's closely related to #33 (comment)

@Haacked Haacked closed this Oct 26, 2011
Haacked commented Oct 26, 2011

Just a follow-up.

For what it's worth, we're leaning towards what Debian does with it's versioning system:

First the initial part of each string consisting entirely of non-digit
characters is determined. These two parts (one of which may be empty)
are compared lexically. If a difference is found it is returned. The
lexical comparison is a comparison of ASCII values modified so that all
the letters sort earlier than all the non-letters and so that a tilde
sorts before anything, even the end of a part. For example, the fol-
lowing parts are in sorted order: '', 'a', '~', the empty part,

We'll call it the "Debian flavored SemVer". ;)

This allows us to have the following version precedence (from lowest to highest)

  • 1.0.0beta~001
  • 1.0.0beta~002
  • 1.0.0beta~003
  • 1.0.0beta
  • 1.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.