持续集成颠覆

发布于 2025-01-03 05:17:08 字数 614 浏览 1 评论 0原文

抱歉,如果这个问题的答案已经存在,我还没有找到。

我是网络开发团队的成员,我们维护一个网络门户。发布管理与 Subversion 配合使用。这就是我在向门户添加新功能时的工作方式:

  • 通过复制主干来创建新分支
  • 在该分支中进行开发
  • 定期将来自主干的更新合并到该分支中(我想知道框架更改是否会破坏我的代码,然后再进行更改)到 UAT / 集成,例如)
  • 将分支重新集成到主干中以便让它上线

现在我们在持续集成方面遇到了问题:

  • 每 X 周定期上线
  • 存在几个计划在不同的分支上上线的分支日期
  • 每 X每天几个小时,集成服务器执行主干结帐并将所有分支(应明确地转到集成系统)合并到其中
  • 已合并到每个分支(见上文)的主干更新现在生成树冲突

最佳实践是什么?重新集成不适用于合并多个分支,因为一旦一个分支被集成,工作副本就不再干净了。然而,持续集成必须以某种方式成为可能……

如果将 Trank 更改合并到每个分支中,则会创建不同的修订版本。但文件应该具有相同的内容并且相等。是否有一个合并选项说“如果两个新的/更改的文件相同,则忽略冲突”?

感谢您的任何帮助。

Sorry if answers to this question already exist, I did not find them yet.

I'm member of a web development team, we maintain a web portal. Release Management works with Subversion. This is how I work when adding new features to the portal:

  • Create a new Branch by copying the Trunk
  • Develop in that Branch
  • Periodically merge updates from the Trunk into that Branch (I want to know if Framework-Changes break my code, before it goes to UAT / Integration, e.g.)
  • Re-Integrate the Branch into the Trunk in order to let it go live

Now we have a problem with Continuous Integration:

  • Periodical Go-Live every X weeks
  • Several Branches exist which are planned to go-live on different dates
  • Every X hours a day, Integration Server does a Trunk checkout and merges all Branches (which should explicitly go to Integration System) into it
  • The Trunk updates which have been merged into each Branch (see above) now generate Tree Conflicts

What is the Best Practice for that? Re-Integrating doesn't work for merging multiple Branches, because as soon as one Branch is integrates, the working copy isn't clean anymore. However, Continuous Integration must be possible somehow...

If Trank changes are merged into each Branch, different revisions are created. But the files should have the same content and be equal. Isn't there a merge-option saying "ignore a conflict if the two new/changed files are identical"?

Thanks for any help.

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

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

发布评论

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

评论(1

不喜欢何必死缠烂打 2025-01-10 05:17:08

由于以下要求,您所描述的不是持续集成

每天每隔 X 小时,Integration Server 会进行一次中继结帐并
合并所有分支(应明确转到集成系统)
进入其中

包括以下步骤:

  • 一个特定分支(例如主干)更新源代码。
  • 构建源代码生成可以执行或部署的构建工件。有时,此阶段还包括运行单元测试和检查。
  • 显示构建状态,无论是否成功:绿色或红色。

如果你有多个分支,就意味着你需要为多个分支配置多个构建计划,以便分别对每个分支进行持续集成。

因此,您所描述的内容可能没有最佳实践,因为合并应始终手动执行。这是由于合并冲突造成的。它们经常发生,只能手动解决。持续集成没有帮助。

如果您只是对术语感到困惑并且无论如何都想执行您所描述的内容,那么我会说您的开发过程有点缺陷。也许,您不需要同时从多个分支执行合并。您最常交付的所有开发都应集中在一个分支中。大多数情况下,这样的“一个”分支就是主干。

就您而言,有价值的开发似乎分散在几个分支之间。那是不对的。一旦您决定应将某些功能包含到即将发布的版本中,就应将其集成到一个(可能是父级)分支中,并作为代码库的一部分保留在那里。尝试减少您拥有的分支机构数量。

总而言之,

  1. 从流程中排除合并所有分支步骤(这不会自动完成)。
  2. 请改为手动合并。
  3. 如果您确定始终需要有分支,请分别为每个分支配置持续集成。
  4. 否则(您不需要一直保留分支,一旦开发完成,它们可以轻松地重新集成到父分支中)将分支数量减少到最少

祝你好运!

What you described is not continuous integration because of the following requirement:

Every X hours a day, Integration Server does a Trunk checkout and
merges all Branches (which should explicitly go to Integration System)
into it

Real Continuous integration includes following steps:

  • Updating source code from one specific branch (trunk, for example).
  • Building source code producing build artifact which could be either executed or deployed. Sometimes this phase includes also running unit-tests and inspections.
  • Shows build status, whether it was successful or not: green or red.

If you have several branches, it means that you need to configure several build plans for several branches in order to perform continuous integration for each branch separately.

Therefore, there could be no best practice for what you described because merges should always be performed manually. This is due to the merging conflicts. They happen quite often and can be resolved only manually. Continuous integration won't help.

If you just confused with terms and want to perform what you described anyway, I would say that your development process is little bit flawed. Probably, you do not need to perform merging from several branches simultaneously. All development you deliver most often should be concentrated in one branch. Most often such 'one' branch would be trunk.

In your case it seems that valuable development is dispersed between several branches. That's not right. Once you decide that some functionality should be included into upcoming release, it should be integrated into one (probably parent) branch and stay there as a part of the codebase. Try to reduce number of branches you have.

To sum up,

  1. Exclude merge all branches step from your process (this is not to be done automatically).
  2. Do merging manually instead.
  3. In case you sure you need to have branches all the time, configure continuous integration for such each branch separately.
  4. Otherwise (you do not need to keep branches all the time, and they can be easily reintegrated into parent branch once the development is finished) reduce number of branches to a minimum.

Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文