Need better rules for sorting ascii build id part #38

Closed
opened 2026-02-17 11:04:15 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @wolandscat on GitHub (Oct 3, 2012).

The semver.org spec is excellent, and have specified it for use in software-like artefacts in openEHR.org. The only problem is this part of rule 12:

Pre-release and build version precedence MUST be determined by comparing each dot separated identifier as follows: identifiers consisting of only digits are compared numerically and identifiers with letters or dashes are compared lexically in ASCII sort order. Numeric identifiers always have lower precedence than non-numeric identifiers. Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0-rc.1+build.1 < 1.0.0 < 1.0.0+0.3.7 < 1.3.7+build < 1.3.7+build.2.b8f12d7 < 1.3.7+build.11.e0f985a.

This is ok for the set of strings 'alpha', 'beta', 'rc-xxx', because they happen to sort in the same order as the lifecycle, but a more general case should be documented in our view, which says that for any given lifecycle consisting of a certain set of states, the order is specified by that lifecycle. So another lifecycle could be made of states like 'pre-draft', 'draft', 'review', 'published', 'obsolete', and the state machine would specify valid transitions.

Given that this part will always be lifecycle specific, I think it would be worth documenting the alpha/beta/rc lifecycle for what it is, and possibly even some other example lifecycles.

Hope this is useful.

  • thomas
Originally created by @wolandscat on GitHub (Oct 3, 2012). The semver.org spec is excellent, and have specified it for use in software-like artefacts in openEHR.org. The only problem is this part of rule 12: Pre-release and build version precedence MUST be determined by comparing each dot separated identifier as follows: identifiers consisting of only digits are compared numerically and identifiers with letters or dashes are compared lexically in ASCII sort order. Numeric identifiers always have lower precedence than non-numeric identifiers. Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0-rc.1+build.1 < 1.0.0 < 1.0.0+0.3.7 < 1.3.7+build < 1.3.7+build.2.b8f12d7 < 1.3.7+build.11.e0f985a. This is ok for the set of strings 'alpha', 'beta', 'rc-xxx', because they happen to sort in the same order as the lifecycle, but a more general case should be documented in our view, which says that for any given lifecycle consisting of a certain set of states, the order is specified by that lifecycle. So another lifecycle could be made of states like 'pre-draft', 'draft', 'review', 'published', 'obsolete', and the state machine would specify valid transitions. Given that this part will always be lifecycle specific, I think it would be worth documenting the alpha/beta/rc lifecycle for what it is, and possibly even some other example lifecycles. Hope this is useful. - thomas
Author
Owner

@Tieske commented on GitHub (Oct 3, 2012):

Though I see the point, on a meta view this is sort of bending the standard to a specific implementation. Where the purpose of a standard is bending implementations towards the standard.

So I disagree with this. It would make semver structurally weaker.

@Tieske commented on GitHub (Oct 3, 2012): Though I see the point, on a meta view this is sort of bending the standard to a specific implementation. Where the purpose of a standard is bending implementations towards the standard. So I disagree with this. It would make semver structurally weaker.
Author
Owner

@haacked commented on GitHub (Oct 3, 2012):

I agree with @Tieske here. That would severely limit the ability to reason about a version when any given version might have different semantics based on their lifecycles.

One way to map your lifecycle within the bounds of SemVer is to map them to a prerelease number by convention. For example:

  • 1.0.0-0.pre-draft
  • 1.0.0-1.draft
  • 1.0.0-2.review
  • 1.0.0-3.published
@haacked commented on GitHub (Oct 3, 2012): I agree with @Tieske here. That would severely limit the ability to reason about a version when any given version might have different semantics based on their lifecycles. One way to map your lifecycle within the bounds of SemVer is to map them to a prerelease number by convention. For example: - `1.0.0-0.pre-draft` - `1.0.0-1.draft` - `1.0.0-2.review` - `1.0.0-3.published`
Author
Owner

@wolandscat commented on GitHub (Oct 3, 2012):

On 03/10/2012 21:49, Thijs Schreijer wrote:

Though I see the point, on a meta view this is sort of bending the
standard to a specific implementation. Where the purpose of a standard
is bending implementations towards the standard.

So I disagree with this. It would make semver structurally weaker.


Reply to this email directly or view it on GitHub
https://github.com/mojombo/semver/issues/48#issuecomment-9121651.

Maybe you see semver as a kind of rigid rule set for all software
production. I have no problem with that, we need it. But the model can
be applied more widely, and there are many many kinds of formal
artefacts that need the same rigour of version identification, but
simply don't have the same alpha/beta/rc lifecycle as the classic
standard - including software-like artefacts, technical model artefacts,
and documents. In fact, a lot of institutional software lifecycles don't
exactly follow that set of states. Institutions already don't adopt
standards when the standards don't fit their needs, they break them. I
know this because I have worked on standardisation in e-health for the
last 18 years, and before that on software lifecycle and document
management in typical corporations that come up with their own standards.

For things with more complex, and well understood lifecycles, variants
of semver will be needed, but there is no question of using 'alpha',
'beta' etc.

So it seems to me there are the following options:

  • stick with the narrow view of the standard for software and state
    that as its scope.
    o this is already very useful, and if the aim is only to make
    software releasing sane and ignore other artefact types and
    production, it should help a lot.
  • define a 'software' semver that works as above, but also a way to
    create other variants with a plug-in rule 12, and a template for the
    generalised form
  • define semver as a meta standard with one set of rules, but where
    rule 12 is a plug-in rule, and define the software variant using the
    current rule 12.

For our own purposes it's easy enough - we can specify a copy of the
current specification, with a replaced rule 12. I just think it would be
useful to indicate how the same approach would apply to all technical
artefact release management, not just software. Then semver would apply
to huge numbers of other artefacts.

  • thomas

**

@wolandscat commented on GitHub (Oct 3, 2012): On 03/10/2012 21:49, Thijs Schreijer wrote: > Though I see the point, on a meta view this is sort of bending the > standard to a specific implementation. Where the purpose of a standard > is bending implementations towards the standard. > > So I disagree with this. It would make semver structurally weaker. > > — > Reply to this email directly or view it on GitHub > https://github.com/mojombo/semver/issues/48#issuecomment-9121651. Maybe you see semver as a kind of rigid rule set for all software production. I have no problem with that, we need it. But the model can be applied more widely, and there are many many kinds of formal artefacts that need the same rigour of version identification, but simply don't have the same alpha/beta/rc lifecycle as the classic standard - including software-like artefacts, technical model artefacts, and documents. In fact, a lot of institutional software lifecycles don't exactly follow that set of states. Institutions already don't adopt standards when the standards don't fit their needs, they break them. I know this because I have worked on standardisation in e-health for the last 18 years, and before that on software lifecycle and document management in typical corporations that come up with their own standards. For things with more complex, and well understood lifecycles, variants of semver will be needed, but there is no question of using 'alpha', 'beta' etc. So it seems to me there are the following options: - stick with the narrow view of the standard for software and state that as its scope. o this is already very useful, and if the aim is only to make software releasing sane and ignore other artefact types and production, it should help a lot. - define a 'software' semver that works as above, but also a way to create other variants with a plug-in rule 12, and a template for the generalised form - define semver as a meta standard with one set of rules, but where rule 12 is a plug-in rule, and define the software variant using the current rule 12. For our own purposes it's easy enough - we can specify a copy of the current specification, with a replaced rule 12. I just think it would be useful to indicate how the same approach would apply to all technical artefact release management, not just software. Then semver would apply to huge numbers of other artefacts. - thomas **
Author
Owner

@haacked commented on GitHub (Oct 4, 2012):

At the moment, I think it makes sense to keep SemVer narrowly scoped. Its semantics are already embedded in existing package managers and other software.

Note that even for software, the pre-release rule doesn't necessarily handle all cases. For example, Microsoft often calls software releases "Previews". So you'd have 1.0.0-preview-1, 1.0.0-preview-2, 1.0.0-beta, 1.0.0. Such an ordering doesn't fit the SemVer semantics.

But even that's easy enough to fix. They simply draw a distinction between a "product" version (the version they market) and the actual library version.

@haacked commented on GitHub (Oct 4, 2012): At the moment, I think it makes sense to keep SemVer narrowly scoped. Its semantics are already embedded in existing package managers and other software. Note that even for software, the pre-release rule doesn't necessarily handle all cases. For example, Microsoft often calls software releases "Previews". So you'd have `1.0.0-preview-1`, `1.0.0-preview-2`, `1.0.0-beta, 1.0.0`. Such an ordering doesn't fit the SemVer semantics. But even that's easy enough to fix. They simply draw a distinction between a "product" version (the version they market) and the actual library version.
Author
Owner

@Tieske commented on GitHub (Oct 23, 2012):

In fact, a lot of institutional software lifecycles don't
exactly follow that set of states. Institutions already don't adopt
standards when the standards don't fit their needs, they break them. I
know this because I have worked on standardisation in e-health for the
last 18 years, and before that on software lifecycle and document
management in typical corporations that come up with their own standards.

My guess would be that they do not follow the standard, or created their own, becasue there is no standard. And thats exactly what SemVer is trying to establish. And if anyone creates a deviating standard, thats fine, just don't call it SemVer, but give it a proprietary name as well as a proprietary order.

@Tieske commented on GitHub (Oct 23, 2012): > In fact, a lot of institutional software lifecycles don't > exactly follow that set of states. Institutions already don't adopt > standards when the standards don't fit their needs, they break them. I > know this because I have worked on standardisation in e-health for the > last 18 years, and before that on software lifecycle and document > management in typical corporations that come up with their own standards. My guess would be that they do not follow the standard, or created their own, becasue there is no standard. And thats exactly what SemVer is trying to establish. And if anyone creates a deviating standard, thats fine, just don't call it SemVer, but give it a proprietary name as well as a proprietary order.
Author
Owner

@haacked commented on GitHub (Dec 20, 2012):

For our own purposes it's easy enough - we can specify a copy of the current specification, with a replaced rule 12.

Yep! It's pretty easy to have a more restrictive stricter spec for your needs that's also SemVer compliant.

@haacked commented on GitHub (Dec 20, 2012): > For our own purposes it's easy enough - we can specify a copy of the current specification, with a replaced rule 12. Yep! It's pretty easy to have a more restrictive stricter spec for your needs that's also SemVer compliant.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#38