如何管理具有多个重叠更改和每日重建的源代码控制更改集?
我在一家使用 cvs 进行版本控制的公司工作。
我们开发和维护一个包含大约一百个可执行文件的在线系统 - 它们共享大量代码和大量支持文件。
我们有一个主枝,以及从主枝上取下的活枝。实时分支代表大约每三个月发布一次的主要版本。
此外,还有许多日常错误修复必须应用于实时分支 - 因此它们可以立即转移到实时环境,并合并回头分支,因此它们将出现在下一个主要版本中。
我们最明显的困难是日常修复。由于我们每天都有很多修改,测试环境总是会发生多次变化。通常,当为一项任务重新构建可执行文件时,对共享代码的未经测试的更改会包含在构建中并带到实时环境中。
在我看来,我们需要一些工具来更好地管理变更集。
我不是负责构建的人,所以我希望找到一个直接的流程来管理它,因为这将使我更容易让构建经理有兴趣采用它。
I am working at a company which uses cvs for version control.
We develop and maintain an online system involving around a hundred executables - which share large amounts of code, and a large number of supporting files.
We have a head branch, and live branches taken from the head branch. The live branches represent major releases which are released about every three months.
In addition there are a numerous daily bug fixes which must be applied to both the live branch - so they can be take to the live environment immeadiatley, and merged back to the head branch, so they will be in the next major release.
Our most obvious difficulty is with the daily fixes. As we have many daily modifications there are always multiple changes on the testing environment. Often when the executables are rebuilt for one task, untested changes to shared code get included in the build and taken to the live environment.
It seems to me we need some tools to better manage changesets.
I'm not the person who does the builds, so I am hoping to find a straight forward process for managing this, as it will make it easier for me get the build manager interested in adopting it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要的是存储库布局的更改。如果我理解正确,您的存储库如下所示:
因此每个分支都包含您的所有站点(数百个)以及共享代码的文件夹。
没有科学的方法可以准确地告诉发布后出现错误的可能性,但让我们看一下两个最重要的因素:
如果您的公司既不想花钱进行额外的测试,也不想降低发布频率(不一定是生产力!),那么您确实必须找到一种方法来发布更少的更改,从而有效地减少每个版本更改的代码行数。
基于这种洞察,让所有开发人员都提交到同一个分支并每天多次从那里上线听起来不是一个好主意,不是吗?
您想要增加隔离。
大多数版本控制系统中的隔离是通过
实现的。 分支 您可以尝试实现一个解决方案,将多个修订的更改打包到发布包中,有点像版本控制系统“perforce”所做的那样。但我不会这样做,因为分支总是更容易。牢记 KISS 原则。
那么分支有什么帮助呢?
您可以尝试将今天必须上线的变更与可能明天或下周上线的变更分开。
迭代分支
人们需要花更多的时间考虑将他们的更改“定位”到正确的版本,但这可能会导致不那么紧急的更改(特别是共享/库代码)在版本之外停留更长时间在上线分支内部,可以在上线之前通过偶然或系统测试发现它们(请参阅因素测试覆盖率)。
当然,需要进行额外的合并,有时会将实时分支中的更改挑选到每日分支中。
现在请不要太从字面上理解我的每日分支。在我的公司,我们有两周的迭代,每个迭代都有一个发布分支,并且已经有足够的开销来维护该分支。
您可以尝试按产品/站点进行隔离,而不是按白天进行隔离。
项目分支
在这种情况下,单个站点的代码以及所有需要的共享代码和库将驻留在这样的站点分支中。
如果必须更改共享代码才能在站点 A 中工作,您只需更改站点 A 中的共享代码。您还可以合并更改,以便任何人都可以赶上您的更改。追赶周期可能比发布周期长很多,因此代码有时间“成熟”。
当然,在部署/构建过程中,您必须确保站点 A 的共享代码不会覆盖站点 B 使用的共享代码。您正在有效地“分叉”具有所有含义的共享代码(不兼容性、集成团队变更的开销)。
偶尔应该强制合并到实时分支(您可能也想重命名它)以集成对共享代码所做的所有更改。我猜你的 3 个月迭代会迫使你这样做,但你可能会发现 3 个月对于无麻烦的集成来说太长了。
第三种方法是最极端的。
项目与迭代分支
如果您不注意的话,这肯定会带来大量的开销和潜在的麻烦。从好的方面来说,您可以非常准确地仅部署此项目/站点现在所需的更改。
我希望这一切能给你一些想法。
应用源代码控制主要涉及风险控制,以提高产品质量。
虽然您的公司想要提供何种质量水平的决定权可能不在您手中,但了解这一点将帮助您决定建议哪些更改。可能结果是您的客户对您的质量非常满意,并且进一步努力提高质量并不会摊销。
祝你好运。
克里斯托夫
I think what you need is a change in repository layout. If I understand correctly, your repository looks like this:
So each of the branches contains all your sites (hundreds) as well as folders for shared code.
There is no scientific way to exactly tell the chance of an error appearing after a release but lets have a look at the two most important factors:
If your company neither wants to spend money on extra testing nor decrease release frequency (not neccessarily productivity!) you will indeed have to find a way to release less changes, effecively decreasing the number of changed lines of code per release.
As a result of this insight, having all developers committing into the same branch and going live from there multiple times a day doesn't sound like a good idea, does it?
You want increased Isolation.
Isolation in most version controll systems is implemented by
You could try to implement a solution that packs changes from multiple revisions into release-packages a bit like the version controll system "perforce" does it. I wouldn't do that though as branching is allmost allways easier. Keep the KISS principle in mind.
So how could branching help?
You could try to Isolate change that have to go live today from changes that might have to go live tomorrow or next week.
Iteration Branches
People need to spend more thought about "targeting" their changes to the right release but it could lead to not-so-urgent changes (especialy on shared/library code) staying longer OUTSIDE of a release and inside the live branch where by chance or systematic testing they could be discovered before going live (see factor test coverage).
Additional merging down is required of course and sometimes cherrypicking of changes out of the live-branch into the daily-branch.
Now please dont take me too literaly with the daily branches. In my company we have 2-week iterations and for each iteration a release branch and it is enough overhead allready to maintain that branch.
Instead of isolating by day you could try to isolate by product/site.
Project Branches
In this scenario the code of the single site AND all needed shared code and libraries would reside in such a Site-branch.
If shared code has to be altered for something to work within site A you only change the shared code in site A. You also merge the change down so anyone can catch up on your changes. Catching up cycles may be a lot longer than releases so the code has time to "ripe".
In your deploy/build process you have to make sure that the shared code of site-A does NOT overwrite the shared code site-B uses of course. You are effectivly "forking" your shared code with all implication (incompatibility, overhead for integrating team-changes).
Once in a while there should be forced merges down to the live-branch (you might want to rename that then too) to integrate all changes that have been done on shared code. Your 3-month iteration will force you to that anyway I guess but you might find out that 3 months is too long for hassle-free integration.
The third approach is the most extrem.
Project & Iteration Branches
This certainly brings a huge ammount of overhead and potential headache if you are not paying attention. On the good side you can very accuratly deploy only the changes that are needed NOW for THIS Project/Site.
I hope this all gives you some ideas.
Applied source controll is alot about risk controll for increased product quality.
While the decision what level of quality your company wants to deliver might not be in your hands, knowing it will help you deciding what changes to suggest. Might turn out your customers are adequatly content with your quality and further efforts to increase it do not amortize.
Good luck.
Christoph