Git, Jenkins, Gerrit, Code Review and pre-tested commits¶
| git | tool | jenkins |
This post is a note to myself. There are bunch of tools on the market which can be successfully used in yours development process. But, I’m interested in git, Jenkins only. Also, git/jenkins supports tons on different workflows, but here I’d like to talk about pre-tested commits.
So, what does it mean “pre-tested commit”? Initially this type of commits was introduced in TeamCity CI Server:
Typically, your team submits code to Version Control BEFORE verifying that it works, and risks breaking the build every single time — causing more problems than necessary. [2]
But, it’s TeamCity and we need similar functionality in Jenkins.
There are several ways to get it:
- Implement Jenkins plugin which can work with integration branches and simulate pre-tested workflow
- Reuse existing tool like Gerrit.
But you say Gerrit is a code review tool. And you are right. Fortunately, Gerrit support pre-tested commit in his code review workflows (see source [3]):
Gerrit Code Review represents a step-forward in the way the team work on the code and share idea and the ownership of the design and coding decisions. (see [4])
Tools required to support this workflow:
To see all these in action I’ve added two videos which demonstrate this concept:
Also, it worth to review this slides. Here is nicely demonstrated why Gerrit is cool and why un-tested commit is bad.
References:
- Pretested commits – why does it matter to us?
- Pre-Tested Commit: No broken code in your version control. Ever.
- TeamForge Git /Gerrit Integration with Jenkins CI
- Jenkins CI and Gerrit Code Review dance together
- Jeknins - Designing pre-tested commit
- Open Stack - Gerrit Workflow
- Open Stack - Gerrit Jenkins Github