Introducing Gerrit - Code Review and Community ContributionsPosted by Marcus Hanwell in Software Process, Open Source. Viewed 8740 times.
Hopefully you are all convinced by now that Git is both more powerful, and more complicated, than CVS or Subversion. We published an article in the October issue of the Source on our branch based Git workflow. Many of our open source projects have migrated to Git, such as CMake, VTK, ParaView and ITK. I was excited by another possibility distributed version control offers us - tightly integrated code review. Gerrit is a tool developed by some of the folks at Google, principally Shawn Pearce (interview here), to facilitate code review for the Android operating system and associated projects.
I first encountered Gerrit when developing Avogadro, one of the projects I develop in my spare time. I liked it so much I talked about it internally at Kitware, and set up a test server. Since then we have set up a public Gerrit server, primarily for the ITK community but with a view to try it out with other projects. One of the distinct advantages of distributed version control is that you can push your commits to multiple places, or remotes. Gerrit acts as an additional remote, somewhere you can push proposed patches and have them show up in the web interface. It has very tight integration with Git, allowing developers to set up accounts, and then push topic branches to the Gerrit remote if they wish to have their changes reviewed.
It also has another big advantage for us as an open source project. Anyone can sign up for a Gerrit account, add the remote and upload their topic branches. This allows us to accept contributions from members of our community much more easily, and to provide feedback on any issues with a proposed patch right in the web interface. We also get copy and paste lines to fetch proposed patches, so that I can have a full checkout of a submitted topic branch within seconds. Once you have an account set up you can select a username, upload your public SSH key and select the projects you would like to monitor in your settings (link in the top right of the page after you have signed in).
We have added a convenience scripts to VTK, ParaView and ITK to set up the Gerrit remote, along with several useful aliases. Once you have a clone of the repository you can run the script and be up and running within minutes. For example, using the aliases you can see what will be pushed can be viewed with git preprush, and these changes can be pushed to Gerrit for review using git gerrit-push. I have been working closely with the ITK community on introducing Gerrit, and will also work with our other open source communities to introduce Gerrit both as a code review tool, and a convenient route to send and review community contributions. I am working with the Gerrit community to see how we might extend Gerrit's ability to deal with topic branches.
I would appreciate feedback from members of our open source communities as we work to make contributing to our projects easier.