简体   繁体   English

使用 semver,预发布版本应该基于上一个版本号还是下一个版本号?

[英]Using semver, should pre-release versions be based off the previous version number, or the next version number?

Doing a pseudo-CD strategy for dev environments and we want to make sure all interim builds are tagged and versioned in a way that provides traceability but also conforms to semver so that helm etc doesn't yell at us and also I can sleep at night knowing I've bikeshedded correctly.为开发环境制定伪 CD 策略,我们希望确保所有临时构建都以提供可追溯性但又符合 semver 的方式进行标记和版本化,这样 helm 等就不会对我们大喊大叫,而且我可以在晚上睡觉知道我已经正确地骑自行车了。 I was thinking about the semantics of semver and how intra-release builds/versions might be tagged.我在考虑 semver 的语义以及如何标记内部版本构建/版本。

Assuming our process doesn't provide sufficient reliability for a "look-ahead" version (eg I don't know if our next release is going to be a major, minor, or patch increment), what would the best practice be for applying versions to builds between releases.假设我们的流程没有为“前瞻”版本提供足够的可靠性(例如,我不知道我们的下一个版本是主要的、次要的还是补丁增量),应用的最佳实践是什么版本之间的版本构建。

eg例如

Given last release of 1.2.3鉴于 1.2.3 的最新版本

Given a timestamp postfix for build metadata (eg a build might be called {version}-1668519441 )给定构建元数据的时间戳后缀(例如,构建可能称为 {version}-1668519441 )

Given that I don't know if the next official release is going to be 2.0.0, 1.3.0, or 1.2.4鉴于我不知道下一个正式版本是 2.0.0、1.3.0 还是 1.2.4

Do I:我:

  1. Apply the build number to the previous versionto generate the build version?将构建号应用到以前的版本来生成构建版本? 1.2.3-1668519441 1.2.3-1668519441
    • this feels kinda yucky because technically it's the build of the next alpha version, not a build of the previous release version这感觉有点恶心,因为从技术上讲,它是下一个 alpha 版本的构建,而不是以前发布版本的构建
  2. Apply the build number to my best guess next version to generate the build version?将内部版本号应用于我最好的猜测下一个版本以生成内部版本? 1.3.0-alpha-1668519441 1.3.0-alpha-1668519441
    • this feels better, but we get burned if we guess wrong这感觉好多了,但如果我们猜错了,我们会被烧死
  3. simply weep, because the answer is "there's no one right answer" and now I have to make my own decisions?只是哭泣,因为答案是“没有一个正确的答案”,现在我必须自己做决定?
    • ;-; ;-;

Reasonable smart will be "modified 1" (because "internal builds" are just builds, for which we have to have "some id", which must just allow internal identification of it and nothing more): Reasonable smart将是“modified 1”(因为“内部构建”只是构建,我们必须有“some id”,它必须只允许内部识别它,仅此而已):

with something like git describe HEAD you'll get 1.2.3--14-g2414721 , 1.2.3-21-g975b , 1.2.3-25-g2dc6 etc and any of these builds later according to (existing, I hope) Release Policy may become 1.2.4, 1.3.x or even 2.xx (see idea of conventional commits and versioning of releases based on it), "just because..."使用类似git describe HEAD的内容,您将获得1.2.3--14-g24147211.2.3-21-g975b1.2.3-25-g2dc6等以及稍后根据(我希望是现有版本)发布的任何这些版本政策可能会变成 1.2.4、1.3.x 甚至 2.xx(请参阅基于它的常规提交和版本控制的想法),“只是因为……”

Answer 3 is daring and unequivocal version, but it's bad, because it does not answer the question and does not give at least a mediocre solution to the problem, but it's bad, because it does not answer the question and does not give at least a mediocre solution to the problem答案 3 是大胆而明确的版本,但它很糟糕,因为它没有回答问题,也没有给出至少一个平庸的解决方案,但它很糟糕,因为它没有回答问题,也没有给出至少一个平庸的解决方案问题的平庸解决方案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当预发布版本是最新可用版本时,semver 中的插入符号 (^) 是否与预发布匹配? - Does caret (^) in semver matches pre-release when pre-release version is the latest available version? Nuget / SemVer - 在添加新依赖项但不更改公共API时,如何增加版本号? - Nuget/SemVer - How should I increment my version number when adding a new dependency but not changing the public API? 我如何将预发布版本提升到生产环境,并嵌入新版本,而无需重新构建? - How can i promote a pre-release build to production, and have the new version embedded, without a rebuild? 使用nuget更新预发布依赖项 - Updating Pre-release dependencies using nuget SemVer 冲突:如果有一些 alpha/beta/rc 版本并且工作正在进行中,如何在上一个稳定版本上发布错误修复? - SemVer collision: How to release bug fix over the last stable version if there are some alpha/beta/rc versions and the work is in progress? 未发布的项目应该收到哪个版本号? - What version number should an unreleased project receive? 在向包中添加示例时,我应该更新semver版本吗? - Should I update the semver version when adding examples to a package? 在nuget中可以进行预发行版本控制吗 - Is pre-release versioning possible in nuget 当使用semver(语义版本控制)时,如果更改Y,补丁版本Z(x.y.Z)应该返回0吗? - When using semver (Semantic Versioning) should the patch version Z (x.y.Z) be returned to 0 when Y is changed? 如何在不依赖 CI 内部版本号的情况下生成发布版本号? - How to generate release version numbers without relying on a CI build number?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM