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. 
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.
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 )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.
- 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