Learning Gerrit Code Review

Book description

Leverage the power of Gerrit code review to make software development more cooperative and social

  • Understand the concepts of collective code review using Gerrit through a set of simple examples
  • Integrate code review functionality into Continuous Integration with Jenkins
  • Experiment with the code review lifecycle in real-life scenarios

In Detail

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.

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.

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.

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.

Table of contents

  1. Learning Gerrit Code Review
    1. Table of Contents
    2. Learning Gerrit Code Review
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Errata
        2. Piracy
        3. Questions
    8. 1. Introducing Code Review
      1. Benefits of Code Review
        1. Build stability
        2. Knowledge sharing
        3. External early feedback
        4. Shared code style
        5. Team engagement
        6. Qualitative code selection
      2. Code Review roles
        1. Contributor
        2. Reviewer
        3. Committer
        4. Maintainer
        5. Review labels and roles customization
      3. Review terms and workflow
        1. Project
        2. Change
        3. Label Code Review
        4. Submit change
        5. Merge change
        6. Abandon change
      4. Summary
    9. 2. Setting Up and Quick-start
      1. Pre-requisites
      2. Gerrit download
      3. Running Gerrit initial setup
        1. Installation completed
      4. Log in and create user profile
      5. Generate HTTP password for Git
      6. Create and clone your first project
      7. Summary
    10. 3. User Authentication
      1. How Gerrit user authentication works
        1. Git versus Gerrit UI authentication
        2. Gerrit internal accounts
      2. Authenticating over the Internet through OpenID
      3. OpenID SSO
      4. Using in-house private Gerrit authentication (LDAP)
      5. LDAP configuration steps
          1. Read-only LDAP user profile
      6. Active Directory
      7. Third-party authentication options
        1. Example – Apache HTTP frontend
        2. Setting up Gerrit behind a reverse proxy
        3. Enabling Gerrit HTTP authentication
        4. User profile lookup
      8. Summary
    11. 4. SSH and HTTPS Access
      1. Enabling strong security on Gerrit
      2. Installing Bouncy Castle Security
      3. Using SSH with Gerrit
        1. Git/SSH Client keys
        2. Adding SSH keys to a Gerrit user profile
        3. Cloning a repo over Git/SSH
      4. Enabling HTTPS
        1. HTTP/S reverse-proxy to Gerrit
        2. HTTP/S Support in Gerrit
      5. Summary
    12. 5. Editing Your Project Permissions
      1. Understanding the Gerrit permission scheme
      2. Configuring project permissions
        1. All-Projects permissions
        2. Git and Gerrit references
        3. Git permissions
        4. Code Review permissions
      3. Managing groups
        1. Custom internal groups
        2. External groups (group backends)
      4. Using group hierarchy effectively
      5. Organizing project security templates
      6. Summary
    13. 6. Changes and Code Review Workflow
      1. Gerrit Code Review roles and workflow
        1. Review workflow step-by-step
          1. Roles overview
          2. Workflow in ten steps
      2. Gerrit branch namespace for code review
      3. Setting topics
      4. Adding reviewers
      5. Review labels
        1. Review
      6. Commenting and scoring changes
        1. Review etiquette
        2. Publish review and scoring
      7. Amending code under review
      8. Summary
    14. 7. Submit Types and Concurrency
      1. Submit types
        1. Fast forward only
        2. Rebase if necessary
        3. Merge if necessary / always merge
        4. Cherry pick
      2. Concurrent code reviews
        1. Changes dependency tracking
        2. Real-life change dependencies with Gerrit
        3. Navigating through the Gerrit change dependency graph
        4. Managing change graph updates
      3. Summary
    15. A. Using Gerrit with GitHub
      1. GitHub workflow
        1. GitHub controversy
      2. GitHub authentication
        1. Building the GitHub plugin
        2. Installing GitHub OAuth library
        3. Installing GitHub plugin
        4. Register Gerrit as a GitHub OAuth application
          1. Running Gerrit init to configure GitHub OAuth
        5. Using GitHub login for Gerrit
      3. Replication to GitHub
        1. Configure Gerrit replication plugin
        2. Authorizing Gerrit to push to GitHub
        3. Start working with Gerrit replication
        4. Reviewing and merging to GitHub branches
      4. Using Gerrit and GitHub on http://gerrithub.io
      5. Summary
    16. B. Automation with Jenkins
      1. Gerrit review workflow with Jenkins
      2. Setting up the Jenkins Gerrit plugin
        1. Installing Jenkins plugins
        2. Setting up the Gerrit trigger plugin
          1. Getting Gerrit ready for Jenkins
          2. Gerrit trigger plugin configuration
      3. Triggering a build from Gerrit
        1. Configuring the Gerrit trigger
        2. Configuring the Git plugin
      4. Automated code validation
      5. Summary
    17. C. Git Basics
      1. Peer-to-peer distributed version-control system
      2. Git installation
        1. Creating the first hello world repository
        2. Hello world file archived in Git
        3. Displaying repository history
        4. Editing and archiving a new file change
      3. Git basic concepts
      4. Working with Git branches
      5. Fast forward, merge, rebase, and cherry pick
      6. Working with remote Git repositories
        1. Pushing branches to the remote repository
        2. Fetching from remote repositories
      7. Summary
    18. Index

Product information

  • Title: Learning Gerrit Code Review
  • Author(s):
  • Release date: September 2013
  • Publisher(s): Packt Publishing
  • ISBN: 9781783289479