mirror of
https://github.com/semver/semver.git
synced 2026-07-10 19:50:47 -05:00
[GH-ISSUE #696] [Question] What is the logic behind appending <x.y.z> part to prerelease versions #2204
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RomanDavlyatshin on GitHub (May 4, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/696
The example:
1.0.0;feature/a,feature/b,feature/c.x.y.z-feature-a.0,x.y.z-feature-a.1, ...) each one representing a certain patch/fix introduced during back-and-forth work on a feature.1.1.0, which will includex.y.z-feature-a.999,x.y.z-feature-b.100andx.y.z-feature-c.42.feature/cgets postponed to a later release, but now itsx.y.zpart is incorrect because it's pointed to a release we expected to merge it into.Question 1: Why a prerelease
<major.minor.patch>part is pointing towards a future version, rather than the one prerelease is based on?It seems to me that making
x.y.zpart of a prerelease version point to a "previous" version it's based on makes more sense, than pointing it to some arbitrary release, that might change versions at any time.The example:
When creating a prerelease semver infers version from the current one, and the following example (using Semver's npm package)
yields
as you can see, besides adding a "prerelease" part, Semver incremented a PATCH version.
Questions 2: What is the reasoning behind incrementing a PATCH version by default?
Questions 3: Can one force Semver to bump a MINOR version, in a case when changes introduced in
prereleasewill add a new feature? Or force a MAJOR version bump, when changes will introduce a breaking change?@jjlharrison commented on GitHub (May 4, 2021):
I think this issue relates to https://github.com/npm/node-semver, not this repository.
@ljharb commented on GitHub (May 4, 2021):
A prerelease is “pre” a release - before it. Linguistically speaking nothing else would make sense for that name.
@RomanDavlyatshin commented on GitHub (May 4, 2021):
@jjlharrison I've encountered the same behavior with
npm version, so I assumed it's a trait of a specification, not implementation. If I am wrong, I would gladly close that issue and re-open it to another rep.@RomanDavlyatshin commented on GitHub (May 4, 2021):
@ljharb I agree, that statement makes sense. In that case, "prerelease" might be a bad way to put it.
I guess I'm asking for a suggestion of naming versions that contain "WIP features".
AFAICT Semver does not suggest any straightforward approach for that, besides putting feature name in the "prerelease" part, but the aforementioned issues arise.
@ljharb commented on GitHub (May 4, 2021):
@RomanDavlyatshin there isn’t anything in semver for that besides a prerelease - the version it’s based on is irrelevant, only the version it’s targeted to be released as is useful.
@RomanDavlyatshin commented on GitHub (May 4, 2021):
@ljharb yes, and that is what causing the issue, in a scenario when the feature gets postponed to another release. (And that confuses me 🤔 )
I guess I'll wait for a day or two for comments on the issue, in case anybody else got something to say on that one and then will close it.
Disclaimer: I am not suggesting that there is anything wrong with Semver, I'm just looking for a way to resolve the issue described above. So any comments/ideas are greatly appreciated.
@jjlharrison commented on GitHub (May 4, 2021):
npm versionuses node-semver too.@ljharb commented on GitHub (May 4, 2021):
@RomanDavlyatshin then it'd just go in a different prerelease. There's never a guarantee that a version will contain everything that a prerelease of it contains.
@RomanDavlyatshin commented on GitHub (May 5, 2021):
@ljharb That is exactly what I am pointing to 😃
I simply dislike the fact, that the version name (
x.y.z-feature.n) will have to be changed "midway", to something likex.W.z-feature-n.This is annoying because branches and artifacts (named after the version name) with new names will no longer consistently reflect the whole history of a feature.
One could drop a release name from the feature branch name altogether. But in a long project, that will lead to feature branches old and new piling up without context.