Skip to end of metadata
Go to start of metadata

Using Gerrit

Acumos uses Gerrit for code reviews - If you are unfamiliar with Gerrit or need a refresher, here are some great tutorials:

The above tutorials and more are from the Gerrit Code Review for Git documentation site.

Reviewing Code

One of the best ways to start contributing to a project is by doing code reviews. You learn the code base, and you begin to build trust with your fellow contributors. You don't need to be a good developer to review code, but you do need to be a good human being. This is a community that uses English for written and verbal communication. Contributor's English skills are at different levels, so patience and clear, concise feedback are very important for maintaining good community relationships!  If you show yourself as thoughtful, polite, and diligent through your code reviews, other reviewers will be more likely to prioritize your patches and collaborate on your ideas. To borrow a phrase from Mark McLoughlin, you need to know when to be empathetic, when to be pragmatic, and when to be dogmatic. A good code reviewer focuses both on the big picture and the little details.

Best Practices

  • Be polite and considerate
  • If you are asking for a lot of changes on a code review, make sure at least one comment is a positive one
  • Make sure your review comments are constructive not destructive
  • Do not turn a code review into a sparring match 
  • If you are a Committer or very experienced Contributor and you see a patch from a new Contributor that needs a lot of changes, consider reaching out to that new Contributor and offer to have a pair programming session

What do those numbers mean?  

  • "I would prefer this not be merged as is"
  • Hopefully you've left inline comments on a file in the patch or a general comment stating why you gave the patch a -1
  • "No score"
  • Use this to ask a question about something in the code you don't understand
  • "Looks good to me, but someone else must approve" (often seen as LGTM in a review comment)
  • add a comment that shows you actually looked at the code in the patch (see What's a "drive by" review below)

What's a "drive by" review?

A "drive by" review is a +1 with no comment from a new reviewer. Those people may be looking to increase their review statistics to please their bosses. It's better to leave a +1 with a comment that shows you actually read the code and thought about it. You can also +1 and ask a question about the code.

  • No labels