Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git hosting setup that pulls from developers, rejecting broken commits?

Development teams are often plagued by builds in version control being transiently broken. The entire team's productivity can come to a halt while trying recover from a build broken by one person.

Is there software that would allow hosting Git in a way that prevents breaking builds in version control by not accepting commits that fail to pass tests in the first place? The usage scenario could for example look as follows:

  • The software runs on a server that continuously pulls revisions from Git repositories that developers have published.
  • For each pulled revision, the software builds the revision and tests if it passes the unit tests.
    • If it passes the tests, the revision is merged into the "stable" branch.
    • If it doesn't pass the tests, it is rejected and the revision is not merged into the "stable" branch. The developer is forced to correct the revision and resubmit it.
  • Developers by default pull from the "stable" branch that should never be broken—in the sense that tests do not fail—and are more productive as they spend less time being blocked by broken builds. And the usefulness of such a system grows with the team size.

A few notes:

  • Git's pre-commit hooks and similar are not satisfactory in this case. The solution should be automatic and enforced on the server side for each commit.
  • Looking for a solution that has been implemented and thought out as far as possible, instead of writing a system like this myself from scratch.
like image 565
Markus Miller Avatar asked Nov 04 '10 21:11

Markus Miller


1 Answers

I think this is more a build server feature that ties into a VCS such as Git. TeamCity does have support for this, but I've not tried it so I can't comment on how good it actually is.

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

The Hudson guys have been discussing it for a while, but I've yet to see it in a release.

http://wiki.hudson-ci.org/display/HUDSON/Designing+pre-tested+commit

like image 118
Jon Avatar answered Sep 25 '22 21:09

Jon