Jump to: navigation, search

Difference between revisions of "ReviewWorkflowTips"

(Tools)
m (Other Tips)
 
(5 intermediate revisions by 3 users not shown)
Line 9: Line 9:
 
* [https://github.com/chmouel/gerrit-download.el/ Emacs Gerrit Download] - An Emacs mode to download and show reviews.
 
* [https://github.com/chmouel/gerrit-download.el/ Emacs Gerrit Download] - An Emacs mode to download and show reviews.
 
* [https://github.com/harlowja/gerrit_view Gerrit View] - Command line tools for querying and watching gerrit
 
* [https://github.com/harlowja/gerrit_view Gerrit View] - Command line tools for querying and watching gerrit
 +
* [https://github.com/russellb/reviewtodo reviewtodo] - A review to-do list generator to help you figure out which reviews you need to follow up on.
 +
* [https://github.com/berrange/gerrymander GerryMander] - A gerrit client API and command line tool for producing & displaying arbitrary reports. [[GerrymanderConfig|Use this config file with OpenStack]]
 +
* [https://pypi.python.org/pypi/gertty Gertty] - A console-based interface to the Gerrit Code Review system.
  
 
== Gerrit Queries ==
 
== Gerrit Queries ==
Line 17: Line 20:
  
 
More useful queries: http://lists.openstack.org/pipermail/openstack-dev/2013-September/015705.html
 
More useful queries: http://lists.openstack.org/pipermail/openstack-dev/2013-September/015705.html
 +
 +
== Querying with qgerrit ==
 +
 +
The qgerrit tool is a command line utility distributed with the "Gerrit View" package that facilitates the querying of gerrit to determine candidates for review.
 +
 +
=== Tailoring the list of reviews to projects and files ===
 +
 +
When invoked with no arguments it will report all pending reviews across all projects. A first step in reducing the amount displayed is to filter based on the project
 +
 +
$ qgerrit --project openstack/nova
 +
 +
For a project like Nova, this will still produce a very long list. It can thus be helpful to look at specific areas of the code tree. The qgerrit tool accepts a list of positional arguments, which are used to match against filenames in the reviews. So to filter the list of reviews to only those which touch a file with "libvirt" in the name
 +
 +
$ qgerrit --project openstack/nova libvirt
 +
 +
The arguments are actually regular expressions, not merely substrings, so it is possible to get inventive to look just as libvirt test files
 +
 +
$ qgerrit --project openstack/nova tests/.*libvirt
 +
 +
=== Identifying changes needing review ===
 +
 +
To identify changes that haven't had any negative review feedback, qgerrit can be told to only show changes with a code review score of 0 or better
 +
 +
$ qgerrit --project openstack/nova -a c0
 +
 +
=== Identifying changes for approval ===
 +
 +
To further identify changes that are ready to be approved, qgerrit can be told to filter based on the code review score where there is no negative karma and at least one +2
 +
 +
$ qgerrit --project openstack/nova -a c2
 +
 +
=== Identifying changes you have not reviewed ===
 +
 +
To identify changes where you have not personally commented on the latest patch series
 +
 +
$ qgerrit --project openstack/nova -w ^berrange
 +
 +
=== Customizing the data display ===
 +
 +
The list of columns displayed by the qgerrit tool can be customized using the '-f' argument. For example to display the URL, branch, owner, truncated subject line, update/creation dates and approval score only, sorting by creation date
 +
 +
$ qgerrit \
 +
  -f url -f branch -f owner -f subject:80
 +
  -f lastUpdated -f createdOn \
 +
  -f approvals --sort createdOn
  
 
== Other Tips ==
 
== Other Tips ==
Line 23: Line 71:
 
* Take a look at review stats [http://www.russellbryant.net/openstack-stats/ here].
 
* Take a look at review stats [http://www.russellbryant.net/openstack-stats/ here].
 
* http://dague.net/2013/09/27/gerrit-queries-to-avoid-openstack-review-overload/
 
* http://dague.net/2013/09/27/gerrit-queries-to-avoid-openstack-review-overload/
 +
 +
[[Category:contribute]]

Latest revision as of 00:43, 7 January 2015

Review Workflow Tips

Tools

  • git review - The same tool we use for submitting patches for review has some options that assist with the review process. See the git-review man page for more details.
  • ReviewDay - A dashboard that prioritizes reviews based on blueprint/bug priority and automated test results
  • next-review - A command line to help you choose the next review to do, primarily based on its age while automatically skipping what you have already reviewed. The tool can also dump a list sorted by its logic, which is helpful if you want to choose from a sorted list.
  • Important Changes - A prioritized list of reviews built in to gerrit.
  • Emacs Gerrit Download - An Emacs mode to download and show reviews.
  • Gerrit View - Command line tools for querying and watching gerrit
  • reviewtodo - A review to-do list generator to help you figure out which reviews you need to follow up on.
  • GerryMander - A gerrit client API and command line tool for producing & displaying arbitrary reports. Use this config file with OpenStack
  • Gertty - A console-based interface to the Gerrit Code Review system.

Gerrit Queries

You can create a query that shows you the reviews across multiple projects and branches at the same time. For example:

https://review.openstack.org/#/q/status:open+(project:openstack/nova+OR+project:openstack/python-novaclient+OR+project:openstack/oslo-incubator+OR+project:openstack/oslo.config)+(branch:master+OR+branch:stable/grizzly),n,z

More useful queries: http://lists.openstack.org/pipermail/openstack-dev/2013-September/015705.html

Querying with qgerrit

The qgerrit tool is a command line utility distributed with the "Gerrit View" package that facilitates the querying of gerrit to determine candidates for review.

Tailoring the list of reviews to projects and files

When invoked with no arguments it will report all pending reviews across all projects. A first step in reducing the amount displayed is to filter based on the project

$ qgerrit --project openstack/nova

For a project like Nova, this will still produce a very long list. It can thus be helpful to look at specific areas of the code tree. The qgerrit tool accepts a list of positional arguments, which are used to match against filenames in the reviews. So to filter the list of reviews to only those which touch a file with "libvirt" in the name

$ qgerrit --project openstack/nova libvirt

The arguments are actually regular expressions, not merely substrings, so it is possible to get inventive to look just as libvirt test files

$ qgerrit --project openstack/nova tests/.*libvirt

Identifying changes needing review

To identify changes that haven't had any negative review feedback, qgerrit can be told to only show changes with a code review score of 0 or better

$ qgerrit --project openstack/nova -a c0

Identifying changes for approval

To further identify changes that are ready to be approved, qgerrit can be told to filter based on the code review score where there is no negative karma and at least one +2

$ qgerrit --project openstack/nova -a c2

Identifying changes you have not reviewed

To identify changes where you have not personally commented on the latest patch series

$ qgerrit --project openstack/nova -w ^berrange

Customizing the data display

The list of columns displayed by the qgerrit tool can be customized using the '-f' argument. For example to display the URL, branch, owner, truncated subject line, update/creation dates and approval score only, sorting by creation date

$ qgerrit \
  -f url -f branch -f owner -f subject:80 
  -f lastUpdated -f createdOn \
  -f approvals --sort createdOn 

Other Tips