开发者

Preventing build breaks - using a pre-commit build

开发者 https://www.devze.com 2023-01-19 15:53 出处:网络
What methods are available for preventing sl开发者_StackOverflow中文版oppy developers from breaking builds.

What methods are available for preventing sl开发者_StackOverflow中文版oppy developers from breaking builds.

Are there any version control systems which have a system of preventing check-in of code which breaks the build.

Thanks


Microsoft TFS Build has something called "gated check-ins" which provides this, by performing a private check-in (called Shelving) which is promoted to a normal check-in if the build succeeds.

http://blogs.msdn.com/b/patcarna/archive/2009/06/29/an-introduction-to-gated-check-in.aspx

TeamCity has the concept of "delayed commit"

http://www.jetbrains.com/teamcity/features/delayed_commit.html

I can wholeheartedly recommend TeamCity!


  1. Get a LART and beat developers who break the build.
  2. Have the build status on a great big screen where everyone can see it with the a red/green background and the name of the last person to commit.
  3. Have the build server send an e-mail to the whole dev team fingering the developer who broke the build.

Honestly... why do people get so hung up on "making developers do X". Tell them it's the process, and fire them if they don't follow it.


EDIT: because the following was too long for a comment.

I work on a team with 12 or so developers. Some people consider that large, some consider it small

We have a large screen (32" flat screen TV on a 6 foot stand) that everyone can see that tells us all sorts of information - including (in the biggest box on the screen) the state of the "commit build".

Our process is to update from SVN and run the commit build locally (about 2-3 mins) before committing. If it passes, ship it. If not, fix it locally and repeat. Since we do TDD, this generally only happens if something you pulled out of SVN broke something you were working on.

If it fails in CI you either ignored the process or your commit collided with someone else's in a bad way. The screen goes red, someone shouts at you, you fix it and move on. This generally only happens to us about once a week or so; mostly it goes red because people try and cut corners ;-)

Nobody needs to "force developers" to do anything. We're creative, artistic individuals who are generally adult and professional enough to follow a process if that process makes sense. In this case, build locally and only commit if that passes.

Who cares if the build breaks in CI, as long as it's fixed quickly so it doesn't prevent the team from working?

0

精彩评论

暂无评论...
验证码 换一张
取 消