Book Image

Learning Gerrit Code Review

By : Luca Milanesio
Book Image

Learning Gerrit Code Review

By: Luca Milanesio

Overview of this book

<p>Developing software is now more than ever before a globally distributed activity: agile methodologies that worked well enough with co-located teams now need to be empowered with additional tools such as Gerrit code review to allow the developers to share, discuss, and cooperate in a more social way, even with GitHub.</p> <p>Learning Gerrit Code Review is a practical guide that provides you with step-by-step instructions for the installation, configuration, and use of Gerrit code review. Using this book speeds up your adoption of Gerrit through the use of a unique, consolidated set of recipes ready to be used for LDAP authentication and to integrate Gerrit with Jenkins and GitHub.</p> <p>Learning Gerrit Code Review looks at the workflow benefits of code review in an agile development team, breaks it down into simple steps, and puts it into action without any hassle. It will guide you through the installation steps of Gerrit by showing you the most typical setup and configuration schemes used in private networks.</p> <p>You will also learn how to effectively use Gerrit with GitHub in order to provide the ability to add more consistent code review functionality to the social collaboration tools provided by the GitHub platform. Using the two tools together, you will be able to reuse your existing accounts and integrate your GitHub community into the development lifecycle while keeping in touch with external contributors.</p>
Table of Contents (17 chapters)
Learning Gerrit Code Review
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

GitHub workflow


GitHub has become the most popular website for open source projects, thanks to the migration of some major projects to Git (for example, Eclipse) and new projects adopting it, along with the introduction of the social aspect of software projects that piggybacks on the Facebook hype. The following diagram shows the GitHub collaboration model:

The key aspects of the GitHub workflow are as follows:

  • Each developer pushes to their own repository and pulls from others

  • Developers who want to make a change to another repository, create a fork on GitHub and work on their own clone

  • When forked repositories are ready to be merged, pull requests are sent to the original repository maintainer

  • The pull requests include all of the proposed changes and their associated discussion threads

  • Whenever a pull request is accepted, the change is merged by the maintainer and pushed to their repository on GitHub

GitHub controversy

The preceding workflow works very effectively for most open source projects; however, when the projects gets bigger and more complex, the tools provided by GitHub are too unstructured, and a more defined review process with proper tools, additional security, and governance is needed.

In May 2012 Linus Torvalds, the inventor of Git version control, openly criticized GitHub as a commit editing tool directly on the pull request discussion thread: "I consider GitHub useless for these kinds of things. It's fine for hosting, but the pull requests and the online commit editing, are just pure garbage" and additionally, "the way you can clone a (code repository), make changes on the web, and write total crap commit messages, without GitHub in any way making sure that the end result looks good." See https://github.com/torvalds/linux/pull/17#issuecomment-5654674.

Gerrit provides the additional value that Linus Torvalds claimed was missing in the GitHub workflow: Gerrit and GitHub together allows the open source development community to reuse the extended hosting reach and social integration of GitHub with the power of governance of the Gerrit review engine.