使用SEMVER时,小型破裂的变化是否足以进行主要版本升级?

发布于 2025-01-20 14:30:10 字数 328 浏览 3 评论 0原文

我对 SemVer 的概念很陌生。在我当前的项目中实施这似乎是一个非常有前途的想法。

根据 SemVer 的概念,如果一个项目名为 project-abc ,那么 a 是主要更新(重大更改),b 是次要更新(较新的实现),c 是补丁更新(错误修复)。

我的问题是,假设我有一个非常小的重大更改,我需要构建和更新我的存储库。那我该怎么办?

这是重大更新还是补丁更新?

另外,SemVer 是否只适用于某些软件技术而不适用于所有技术?例如,一些节点开发人员告诉我他们很少使用这个。但是,我不确定有多少人在练习。

I am new to the concept of SemVer. It's seems like very promising idea to implement in my current project.

According to the SemVer concept, if a project is name project-a.b.c then, a is Major update(breaking changes), b is Minor update(newer implementations), c is patch update(bug fixes).

My question is, say if I had a Very Small breaking change for which I need to build and update my repo. What should I do then?

Is it a Major update or a Patch update?

Also, is SemVer only suitable for certain software technologies and not for every thing? For example, some Node Devs told me they rarely use this. But, I am not sure what percentage of people are practising it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扛刀软妹 2025-01-27 14:30:10

重大变更就是重大变更,没有如果但是。您应该进行重大更新。

SemVer 的目的是传达底层代码的含义以及从一个版本到下一个版本的修改内容。该方案适用于需要解决任何类型的兼容性问题的所有情况,并且 SemVer 约定符合目的。

https://semver.org/

提出一些问题很有用,可以帮助您确定影响而不是影响偏离 SemVer 约定:

  1. 我的交付成果有变化吗?
  2. 此更改会破坏任何人的代码吗?
    是的=>重大改变;没有=>继续讨论 MINOR 与 PATCH 的下一个问题。

至于开发人员是否使用 SemVer 约定,您会惊讶地发现大量项目使用它,因为它的实用性和简单性,因此我鼓励您在有意义的地方使用它,例如分布式可交付成果。

Breaking change is a breaking change, no ifs or buts. You should do a MAJOR update.

SemVer purpose is to convey meaning about the underlying code and what has been modified from one version to the next. This scheme is suitable for everything where there is a need to solve compatibility issues of any kind and SemVer convention fits the purpose.

https://semver.org/

It is useful to ask a number of questions to help you determine the impact and not to deviate from the SemVer convention:

  1. Have there been a change to my deliverable?
  2. Can this change break anyone's code out there?
    Yes => breaking change; No => move on to next question of MINOR vs PATCH.

As to whether developers using or not using SemVer convention you would be surprised to find huge number of projects using it because of its usefulness and simplicity, so I would encourage you to use it where it makes sense, e.g. distributed deliverable.

凶凌 2025-01-27 14:30:10

不得不增加主要版本可能会对小型打破变化感到笨拙(我不确定这是理性的问题)。

使用 reforcation reprecation 给定“足够”通知,要求并释放次要增量的破坏变化。但这将违反语义版本>语义版本2.0.0规范

主要版本x(xyz | x> 0)如果将任何向后不兼容的更改引入公共API,则必须增加。它还可能包括次要和补丁级别的更改。当主要版本增加时,补丁和次要版本必须重置为0。

如果遵循“ ”,那么主要版本的升级不必繁重,以便用户可以平稳过渡到新的API ”。

我应该如何处理折旧功能?

贬低现有功能是软件开发的正常组成部分,通常需要进行前进。当您将部分公共API的部分贬值时,您应该做两件事:(1)更新文档以使用户知道更改,(2)发布了对折旧的新次要版本。在您完全删除新的主要版本中的功能之前,应该至少有一个次要版本包含弃用,以便用户可以平稳过渡到新的API。


为了最大程度地减少歧义,规格依赖于a

  1. 必须这个词,或“必需”或“应”的术语意味着
    定义是规范的绝对要求。

Having to increment the major version may feel heavy-handed for small breaking changes (I'm unsure if this is a rational concern).

There may be a strong temptation to use deprecation releases to subvert the requirement and release a breaking change on a minor increment, given 'sufficient' notice. But that would violate the Semantic Versioning 2.0.0 specification:

Major version X (X.y.z | X > 0) MUST be incremented if any backward incompatible changes are introduced to the public API. It MAY also include minor and patch level changes. Patch and minor versions MUST be reset to 0 when major version is incremented.

Major version upgrades don't have to be onerous if the deprecation steps are followed "so that users can smoothly transition to the new API".

How should I handle deprecating functionality?

Deprecating existing functionality is a normal part of software development and is often required to make forward progress. When you deprecate part of your public API, you should do two things: (1) update your documentation to let users know about the change, (2) issue a new minor release with the deprecation in place. Before you completely remove the functionality in a new major release there should be at least one minor release that contains the deprecation so that users can smoothly transition to the new API.


To minimize ambiguity, the spec relies on a formal definition of the word 'MUST':

  1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
    definition is an absolute requirement of the specification.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文