Continous Integration with GIT [enhanced reality]

Continous Integration with GIT

Using a DRCS will have implications on the way you do Continuous Integration. Using an SCM with a client-server based repository model just requires to monitor commits, checkout a revision, build and test it1).

With a DRCS the workflow will be different. You can push a changeset to a repository that is watched by a CI tool, but in some (most??) cases you want your local commits to be tested as well.

For that you'd have CI tool running locally, so you'd have to distribute configuration changes for the CI tool, and you will probably have to solve performance issue, e.g. by excluding some tests to be run (like selenium tests). Also, you might want to push the results to the central CI tool.

In better CI with git the author outlines an approach with a central server where each developer maintains his own private repostitory. For CI they can push their changes to this repository and make sure it's not broken before pushing to the central repository.

It's definitely necessary to run at least part of the tests locally after each commit, David Gageot argues that serverless CI is an option for small teams.

Personally I do not see the advantages over monitoring all branches in the central repository (if you have such a thing at all) and each developer pushing to their own branches when they want CI to run.

Martin Fowler argues that a continuous build must not be confused with CI, so the classic idea to develop with long-lived feature branches is a different approach to CI. While CI is a means of communication about the code by integrating with the mainline every day, promiscuous integration is about directly merging between feature branches for cherry picking. A DVCS will make that process very easy, but Fowler still thinks that cherry-picking with the VCS is not a good idea ("feature branching is a poor man's modular architecture").

As for the question whether or not to have a central repository Linus Torvalds says with git you can have several central places, and that is a good thing.

With a somewhat narrower idea of CI Manuel Küblböck talks about distributed CI, he also did a nice graph to illustrate the idea.

Other Stuff

1) you can optimize greatly here e.g. with strategies which revisions to test first

dev/continuous_integration.txt · Last modified: 2011/08/28 00:01 (external edit)