TFS——级联分支的可持续性

发布于 2024-12-02 16:24:13 字数 553 浏览 0 评论 0原文

分支指南通常描述一个不朽的“主”分支,具有从主分支分支的功能,并合并回主分支,以及从主分支分支的版本,以及服务包、RTM 等所需的版本的进一步分支。关于主分支的指南是通常被简化为“主城区没有垃圾”。

我正在与一个定期(每月)连续发布的团队合作。对他们来说,似乎没有必要将工作返回到主分支。他们使用 TFS 2010 - 从图表上看,他们的分支结构如下所示:

在此处输入图像描述

在分支上进行每日构建;最终该分支投入生产。分支的任何修补程序都会直接应用于该分支,并且可以选择向前合并到任何未来运行中的分支。

该组织的分支策略被戏谑地描述为“级联分支反模式”。但考虑到这些分支发布到生产环境,然后(通常)有相当短的生存时间,真的是这样吗?

从长远来看,TFS 中级联分支的这种做法是否可持续。如果不是,限制是什么?何时(在多少个分支之后)可能达到限制?

是否有任何理由最终不“销毁”Main、R1、R2(等),或者是否存在阻止销毁和回收托管源代码存储库的 SQL Server 上的空间的“陷阱”?

Branching guidance usually describes an immortal "Main" branch, with features branched from Main, and merged back to Main, and Releases branched from Main, with further branches of a Release as necessary for Service Packs, RTMs, etc. The guidance regarding Main is often simplified to "no trash in Main."

I'm working with a group that releases regularly (as often as monthly) and serially. To them it seems unnecessary to ever return work to the Main branch. They use TFS 2010--diagramatically their branching structure looks like this:

enter image description here

Daily builds on a branch are made; eventually the branch goes to production. Any hotfixes to a branch are applied directly to that branch, and optionally merged forward to any future in-flight branches.

This group's branching strategy has been described perjoratively as the "Cascading Branches Antipattern." But is it really, given that these branches release to production, and then (usually) have a fairly short time to live?

Is this practice of cascading branches in TFS sustainable over the long term. If not, what are the limits, and when (after how many branches) might they be reached?

Is there any reason to NOT "destroy" Main, R1, R2 (etc.) eventually, or is there a "gotcha" that will prevent destroying and reclamation of space on the SQL server that is hosting the source code repository?

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

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

发布评论

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

评论(1

べ繥欢鉨o。 2024-12-09 16:24:13

级联分支可以工作。我也想不出任何技术原因为什么销毁非常旧的(最好是存档的)分支会影响较新的级联分支。以下是需要考虑的一些问题:

  1. 开发人员必须在每次发布后将新分支映射到他们的工作区。
  2. 如果开发人员无法在发布前签入任何工作(而不是在发布后签入相同的工作 Dev 或 Main 分支),则必须手动将任何工作移至新分支。
  3. 如果您有一名或多名开发人员在Rn 的子分支,并决定将其工作移至 Rn+1,则需要进行无基础合并以避免签入原始父 Rn 分支。
  4. 释放后请确保安全锁定每个分支。所有这些分支都会增加开发人员意外签入已发布分支更改的风险。
  5. 您需要在每次级联后调整构建定义和任何其他特定于路径的工件。如果所有开发都在 Dev(或 Main)之外进行,那么主工作区和相关的构建/项目工件将随着时间的推移保持不变。
  6. 当您不知道哪些功能将在 Rn 中发布时,如何单独处理并行功能? (如果您有一个主分支,则可以从主分支拥有多个子功能开发分支,然后仅当功能分支稳定并准备好合并以在下一个版本中发布时才合并功能分支。)

我相信 Jeff Levinson 做了一个演示,描述了分支演化从单个分支开始,然后是级联分支,然后是 Main+Release 和几个变体(同时描述每个分支的优缺点)。查看分支和合并实践 - Jeff Levinson(Teched 2010 视频)(或相关分支与合并 PPT)。

享受! -Zephan

Cascading branches can work. I also can't think of any technical reason why destroying very old (preferrably archived) branches would impact the newer cascaded branches. Here are some issues to consider:

  1. Developers have to map a new branch to their workspace after every release.
  2. Developers have to manually move any work to a new branch if they weren't able to check it in before release (vs. just checking in to the same working Dev or Main branch after release.)
  3. If you have one or more developers working in a child branch of Rn and a decision is made to move their work to Rn+1 then a baseless merge will be required to avoid checking into the original parent Rn branch.
  4. MAKE SURE YOU SECURELY LOCK EACH BRANCH after release. All those branches will increase risk of a developer accidentally checking in a change to a released branch.
  5. You need to adjust build definitions and any other path-specific artifacts after each cascade. If all development just works out of Dev (or Main) then the primary workspace and related build/project artifacts remain the same over time.
  6. How do you work on a parallel features in isolation when you don't know which feature(s) will ship in Rn? (If you have a main branch the you can have multiple child feature dev branches from Main, then merge a feature branch only when it is stable and ready to merged to ship in the next release.)

I believe Jeff Levinson did a presentation that described branching evolution starting with single branch, then cascading branch, then Main+Release and a couple variations (while describing pros and cons of each). Check out Branching and Merging Practices - Jeff Levinson (Teched 2010 Video) (or related Branching & Merging PPT).

Enjoy! -Zephan

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