您如何对项目进行版本管理并管理版本?

时间:2022-03-27 14:19:03

Our situation is as follows, but I'm curious about this problem in any situation.

我们的情况如下,但我对任何情况下的这个问题都很好奇。

We have a framework consisting of 4 projects:

我们有一个由4个项目组成的框架:

  • beans
  • util
  • framework
  • web

We also have modules that need a version and depend on a version of beans and util.

我们还有需要版本的模块,并且依赖于bean和util的版本。

Finally we have a customer project that consists of a specific version of the core projects and one or more modules.

最后,我们有一个客户项目,其中包含特定版本的核心项目和一个或多个模块。

Is there a standard way to version these projects?

是否有标准方法来版本化这些项目?

What seems simple to me is becoming really complicated as we try to deliver releases to QA and then manage our ongoing development with the maintenance of the release (release = tag and possible branch).

对我来说似乎很简单的事情变得非常复杂,因为我们尝试向QA提供版本,然后通过维护版本(release = tag和可能的分支)来管理我们的持续开发。

I kind of prefer the following:

我更喜欢以下内容:

1.2.0 - major and minor versions + release.

1.2.0 - 主要版本和次要版本+发布。

1.2.1 - next release

1.2.1 - 下一个版本

1.2.0_01 - bug fix in 1.2.0 release (branch)

1.2.0_01 - 1.2.0版本中的错误修复(分支)

etc.

Any ideas?

9 个解决方案

#1


10  

We use major.minor.bugfix. A major release only happens for huge changes. A minor release is called for when there is an API change. All other releases are bugfix releases. There's definitely utility in having a build or revision number there too for troubleshooting, although if you've got really rigorous CM you might not need to include it.

我们使用major.minor.bugfix。主要版本只会发生巨大变化。当API发生变化时,会调用次要版本。所有其他版本都是bugfix版本。在那里也可以使用构建版本或修订版号进行故障排除,但是如果你有非常严格的CM,则可能不需要包含它。

Coordinating among the versions of all these projects can be done really well with help from tools like Apache Ivy or Maven. The build of one project, with its own version number, can involve the aggregation of specific versions of (the products of) other projects, and so your build files provide a strict mapping of versions from the bottom up. Save it all in [insert favorite version control tool here] and you have a nice history recorded.

在Apache Ivy或Maven等工具的帮助下,可以很好地协调所有这些项目的版本。一个项目的构建,具有自己的版本号,可能涉及其他项目(的产品)的特定版本的聚合,因此您的构建文件提供从下到上的严格的版本映射。将此全部保存在[在此处插入喜爱的版本控制工具],您可以记录好的历史记录。

#2


3  

I use {major}.{minor}.{buildday}.{sequential}. For Windows, we use the utilities stampver.exe and UpdateVersion.exe for .NET projects that handle that mostly automatically.

我使用{major}。{minor}。{buildday}。{sequential}。对于Windows,我们使用实用程序stampver.exe和UpdateVersion.exe来处理主要自动处理的.NET项目。

#3


2  

There are no standard version number systems. Common themes are to have a major, minor and build number, and occasionally a point number as well (1.2.2.1 for example, for version 1.2 point release 2 build 1). The meaning of the version numbers is highly flexible. A frequent choice is to have backwards compatibility between minor versions or point releases though.

没有标准版本号系统。常见主题是主要,次要和内部版本号,偶尔也有一个点数(例如1.2.2.1版本1.2版本版本2版本1)。版本号的含义非常灵活。经常选择的是在次要版本或点发布之间具有向后兼容性。

Releases are probably best done by labeling a set of source controlled files as long as your source control allows this. Recreating a release is then as simple as syncing to the label and building, which is very useful :)

只要源控件允许,就可以通过标记一组源控制文件来最好地完成发布。然后重新创建一个版本就像同步到标签和构建一样简单,这非常有用:)

#4


2  

In the automated build system i'm currently using I version with Major.Minor.Build.X, where Build is every time we hit system test, and X is the last Subversion revision number from the repo the code is being built from. Seems to work quite nicely for Subversion as we can easily get back to the codebase of a particular build if the need arises.

在自动构建系统中,我目前正在使用带有Major.Minor.Build.X的I版本,每次我们进行系统测试时都是Build,而X是构建代码的repo中的最后一个Subversion修订版号。对于Subversion来说似乎工作得非常好,因为如果需要,我们可以很容易地回到特定构建的代码库。

#5


2  

I use a variation on the linux kernel version numbering system:

我在linux内核版本编号系统上使用了一个变体:

major.minor.bugfix

where even minor numbers indicate a somewhat stable release that may be distributed at least for testing, and odd minor numbers indicate an unstable/untested release that shouldn't be distributed beyond developers.

即使是次要数字也表示某种程度上稳定的版本,至少可以用于测试,奇数次要数字表示不应该在开发人员之外分发的不稳定/未经测试的版本。

#6


1  

Where possible, I prefer to have projects versioned with the same build numbering, unless they are shared. It allows for more consistency between moving parts and it's easier to identify which components constitute a product release.

在可能的情况下,我更喜欢使用相同的构建编号进行版本化的项目,除非它们是共享的。它允许移动部件之间更加一致,并且更容易识别哪些组件构成产品发布。

As workmad3 has stated, there's really no common rule for build numbers. My advice is to use something that makes sense for your team/company.

正如workmad3所说,构建数字确实没有通用规则。我的建议是使用对你的团队/公司有意义的东西。

Some places I've worked at have aligned build numbering with project milestones and iterations,
e.g: Major = Release or Milestone, Minor = Iteration, Build = Build number (from the project start or from the start of iteration), Revision = If the build has to be rebuilt (or branched).

我工作的一些地方已经将项目编号与项目里程碑和迭代对齐,例如:Major = Release或Milestone,Minor = Iteration,Build = Build number(从项目开始或从迭代开始),Revision = If构建必须重建(或分支)。

#7


1  

One of the most common conventions is major.minor.bugfix, with an additional suffix indicating a build number or pre-release designation (e.g. alpha, beta, etc.).

最常见的约定之一是major.minor.bugfix,附加后缀表示内部版本号或预发布指定(例如alpha,beta等)。

My team numbers builds according to project milestones - a build is handed over to our QA group at the end of a development iteration (every few weeks). Interim CI builds are not numbered; because we use Maven, those builds are numbered with a SNAPSHOT suffix.

我的团队编号根据项目里程碑进行构建 - 在开发迭代结束时(每隔几周),构建将交给我们的QA小组。临时CI构建没有编号;因为我们使用Maven,所以这些构建编号为SNAPSHOT后缀。

Whatever you decide, be sure to document it and make sure that everyone understands it. I also suggest you document and consistently apply the release branching policy or it can quickly get confusing for everyone. Although with only 4 projects it should be pretty easy to keep track of what's going on.

无论你决定什么,一定要记录下来并确保每个人都理解它。我还建议您记录并始终如一地应用发布分支策略,否则很快就会让每个人感到困惑。虽然只有4个项目,但应该很容易跟踪正在发生的事情。

#8


0  

You didn't mention if any of the projects access a database, but if any do, that might be another factor to consider. We use a major.minor.bugfix.buildnumber scheme similar to others described in answers to this question, with approximately the same logic, but with the added requirement that any database schema changes require at least a minor increment. This also provides a naming scheme for your database schemas. For example, versions 1.2.3 and 1.2.4 can both run against the "1.2" database schema, but version 1.3.0 requires the "1.3" database schema.

您没有提及任何项目是否访问数据库,但如果有的话,这可能是另一个需要考虑的因素。我们使用major.minor.bugfix.buildnumber方案,类似于在这个问题的答案中描述的其他方案,具有大致相同的逻辑,但增加了要求任何数据库模式更改至少需要一个小的增量。这还为您的数据库模式提供了命名方案。例如,版本1.2.3和1.2.4都可以针对“1.2”数据库架构运行,但版本1.3.0需要“1.3”数据库架构。

#9


-1  

Currently we have no real versioning. We use the svn build number and the release date. (tag name is like release_081010_microsoft e.g.)

目前我们没有真正的版本。我们使用svn内部版本号和发布日期。 (标签名称类似于release_081010_microsoft,例如)

Older Products use major.minor.sub version numbering

旧产品使用major.minor.sub版本编号

Major never changed Minor changes on every release/featurerelease every 6 months. Sub is everything which doesn't affect the feature set - mostly bugfixes.

主要从未改变每6个月每次发布/特征发布的微小变化。 Sub是不影响功能集的所有内容 - 主要是错误修正。

#1


10  

We use major.minor.bugfix. A major release only happens for huge changes. A minor release is called for when there is an API change. All other releases are bugfix releases. There's definitely utility in having a build or revision number there too for troubleshooting, although if you've got really rigorous CM you might not need to include it.

我们使用major.minor.bugfix。主要版本只会发生巨大变化。当API发生变化时,会调用次要版本。所有其他版本都是bugfix版本。在那里也可以使用构建版本或修订版号进行故障排除,但是如果你有非常严格的CM,则可能不需要包含它。

Coordinating among the versions of all these projects can be done really well with help from tools like Apache Ivy or Maven. The build of one project, with its own version number, can involve the aggregation of specific versions of (the products of) other projects, and so your build files provide a strict mapping of versions from the bottom up. Save it all in [insert favorite version control tool here] and you have a nice history recorded.

在Apache Ivy或Maven等工具的帮助下,可以很好地协调所有这些项目的版本。一个项目的构建,具有自己的版本号,可能涉及其他项目(的产品)的特定版本的聚合,因此您的构建文件提供从下到上的严格的版本映射。将此全部保存在[在此处插入喜爱的版本控制工具],您可以记录好的历史记录。

#2


3  

I use {major}.{minor}.{buildday}.{sequential}. For Windows, we use the utilities stampver.exe and UpdateVersion.exe for .NET projects that handle that mostly automatically.

我使用{major}。{minor}。{buildday}。{sequential}。对于Windows,我们使用实用程序stampver.exe和UpdateVersion.exe来处理主要自动处理的.NET项目。

#3


2  

There are no standard version number systems. Common themes are to have a major, minor and build number, and occasionally a point number as well (1.2.2.1 for example, for version 1.2 point release 2 build 1). The meaning of the version numbers is highly flexible. A frequent choice is to have backwards compatibility between minor versions or point releases though.

没有标准版本号系统。常见主题是主要,次要和内部版本号,偶尔也有一个点数(例如1.2.2.1版本1.2版本版本2版本1)。版本号的含义非常灵活。经常选择的是在次要版本或点发布之间具有向后兼容性。

Releases are probably best done by labeling a set of source controlled files as long as your source control allows this. Recreating a release is then as simple as syncing to the label and building, which is very useful :)

只要源控件允许,就可以通过标记一组源控制文件来最好地完成发布。然后重新创建一个版本就像同步到标签和构建一样简单,这非常有用:)

#4


2  

In the automated build system i'm currently using I version with Major.Minor.Build.X, where Build is every time we hit system test, and X is the last Subversion revision number from the repo the code is being built from. Seems to work quite nicely for Subversion as we can easily get back to the codebase of a particular build if the need arises.

在自动构建系统中,我目前正在使用带有Major.Minor.Build.X的I版本,每次我们进行系统测试时都是Build,而X是构建代码的repo中的最后一个Subversion修订版号。对于Subversion来说似乎工作得非常好,因为如果需要,我们可以很容易地回到特定构建的代码库。

#5


2  

I use a variation on the linux kernel version numbering system:

我在linux内核版本编号系统上使用了一个变体:

major.minor.bugfix

where even minor numbers indicate a somewhat stable release that may be distributed at least for testing, and odd minor numbers indicate an unstable/untested release that shouldn't be distributed beyond developers.

即使是次要数字也表示某种程度上稳定的版本,至少可以用于测试,奇数次要数字表示不应该在开发人员之外分发的不稳定/未经测试的版本。

#6


1  

Where possible, I prefer to have projects versioned with the same build numbering, unless they are shared. It allows for more consistency between moving parts and it's easier to identify which components constitute a product release.

在可能的情况下,我更喜欢使用相同的构建编号进行版本化的项目,除非它们是共享的。它允许移动部件之间更加一致,并且更容易识别哪些组件构成产品发布。

As workmad3 has stated, there's really no common rule for build numbers. My advice is to use something that makes sense for your team/company.

正如workmad3所说,构建数字确实没有通用规则。我的建议是使用对你的团队/公司有意义的东西。

Some places I've worked at have aligned build numbering with project milestones and iterations,
e.g: Major = Release or Milestone, Minor = Iteration, Build = Build number (from the project start or from the start of iteration), Revision = If the build has to be rebuilt (or branched).

我工作的一些地方已经将项目编号与项目里程碑和迭代对齐,例如:Major = Release或Milestone,Minor = Iteration,Build = Build number(从项目开始或从迭代开始),Revision = If构建必须重建(或分支)。

#7


1  

One of the most common conventions is major.minor.bugfix, with an additional suffix indicating a build number or pre-release designation (e.g. alpha, beta, etc.).

最常见的约定之一是major.minor.bugfix,附加后缀表示内部版本号或预发布指定(例如alpha,beta等)。

My team numbers builds according to project milestones - a build is handed over to our QA group at the end of a development iteration (every few weeks). Interim CI builds are not numbered; because we use Maven, those builds are numbered with a SNAPSHOT suffix.

我的团队编号根据项目里程碑进行构建 - 在开发迭代结束时(每隔几周),构建将交给我们的QA小组。临时CI构建没有编号;因为我们使用Maven,所以这些构建编号为SNAPSHOT后缀。

Whatever you decide, be sure to document it and make sure that everyone understands it. I also suggest you document and consistently apply the release branching policy or it can quickly get confusing for everyone. Although with only 4 projects it should be pretty easy to keep track of what's going on.

无论你决定什么,一定要记录下来并确保每个人都理解它。我还建议您记录并始终如一地应用发布分支策略,否则很快就会让每个人感到困惑。虽然只有4个项目,但应该很容易跟踪正在发生的事情。

#8


0  

You didn't mention if any of the projects access a database, but if any do, that might be another factor to consider. We use a major.minor.bugfix.buildnumber scheme similar to others described in answers to this question, with approximately the same logic, but with the added requirement that any database schema changes require at least a minor increment. This also provides a naming scheme for your database schemas. For example, versions 1.2.3 and 1.2.4 can both run against the "1.2" database schema, but version 1.3.0 requires the "1.3" database schema.

您没有提及任何项目是否访问数据库,但如果有的话,这可能是另一个需要考虑的因素。我们使用major.minor.bugfix.buildnumber方案,类似于在这个问题的答案中描述的其他方案,具有大致相同的逻辑,但增加了要求任何数据库模式更改至少需要一个小的增量。这还为您的数据库模式提供了命名方案。例如,版本1.2.3和1.2.4都可以针对“1.2”数据库架构运行,但版本1.3.0需要“1.3”数据库架构。

#9


-1  

Currently we have no real versioning. We use the svn build number and the release date. (tag name is like release_081010_microsoft e.g.)

目前我们没有真正的版本。我们使用svn内部版本号和发布日期。 (标签名称类似于release_081010_microsoft,例如)

Older Products use major.minor.sub version numbering

旧产品使用major.minor.sub版本编号

Major never changed Minor changes on every release/featurerelease every 6 months. Sub is everything which doesn't affect the feature set - mostly bugfixes.

主要从未改变每6个月每次发布/特征发布的微小变化。 Sub是不影响功能集的所有内容 - 主要是错误修正。