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

Gerrit branch namespace for code review


We can now experiment with a real-life review cycle by putting into practice the workflow already described. The only action we will not explore at this stage is the CI Build integration, which will be covered later in a dedicated Appendix.

The first action that triggers a Code Review is the initial commit pushed to Gerrit. Gerrit introduces a new Git reference namespace completely dedicated to the Code Review prefixed by refs/for before the branch path (for example, for pushing a change for review on the master branch we need to use refs/for/master).

We can then create our first change on the hello-project we cloned in our initial sandbox.

$ git clone \
  ssh://[email protected]:29418/hello-project
[…]
Receiving objects: 100% (2/2), done.

Note

Remember to set the Git author identity, aligned with the one present in Gerrit, otherwise, the push will be rejected:

$ cd hello-project
$ git config user.name "John Doe"
$ git config user.email "john.doe...