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.