As with many OpenStack core reviewers, my review queue can be completely overwhelming, often 300 – 400 active reviews that I have +2 / -2 authority on. It’s really easy to get discouraged on a list that big. Fortunately there are ways to trim that down.
Gerrit provides a simple query language to select which reviews you see, using the query bar in the top right of the page:
The way this works is by adding criteria into the search box, which by default is ANDed together to get the final results. In the process these queries change the URL for Gerrit, so you can bookmark the resultant queries for easy access later.
Restricting to Single Project (and pulling your own stuff)
This query is basically what you get when you click on a project link:
Nothing special, but you can go one step further by removing yourself from the list of reviews:
status:open project:openstack/tempest -owner:email@example.com
This also demonstrates that we can have both positive criteria and negative criteria.
Little Lost Projects (don’t loose the little ones)
In addition to having +2 on nova, devstack, tempest, I’ve got it on a bunch of smaller projects, which I often forget I need to go review. You can build a single query that has all your little lost projects in a single list:
status:open (project:openstack-dev/hacking OR project:openstack-dev/grenade)
You can also filter based on votes in the various columns. It’s not nearly as detailed as I’d like, but it is still useful. I have a basic query for No Objections on most projects that I review which looks something like this:
status:open project:openstack/tempest -Verified-1 -CodeReview-1 -CodeReview-2
This removes all reviews that have a current -1 in Verified column, and a -1 or -2 in the CodeReview column. So patches with negative feedback are dropped from view. The top of your review list may contain patches that haven’t cleared CI yet, but that’s easy to see. There might also be Jenkins -2 reviews in this list, but gate failed merges can usually use extra eyes.
I consider this a base list of patches that there is no reason I shouldn’t be reviewing them.
I’m typically up and at my computer at 7am EST, which is often a very slow time for zuul. So one of the things I look for is code that only requires one more +2 to go to merge on projects like Nova. Many of these are easy to review fixes, and clear the decks before the queue gets busy in the afternoon.
status:open -Verified-1 CodeReview+2 -CodeReview-1 -CodeReview-2 (project:openstack/nova OR project:openstack/python-novaclient)
Like the last one, we are filtering out all patches with negative feedback, but also requiring that there is an active +2 on the patch. I also make sure to do this for both nova and python-novaclient, which often gets lost in the noise.
Especially in Nova it’s easy for a patch to get lost, as there are so many of them. I define lost as a patch that’s passed CI, but has no feedback in code review.
status:open -Verified-1 Verified+1 -CodeReview+2 -CodeReview+1 -CodeReview-1 -CodeReview-2 (project:openstack/nova OR project:openstack/python-novaclient) branch:master
These patches are often from newer folks on the project, and as such often need more time, so I typically only go after lost patches if I know I can set aside a solid hour on them. However I try hard to get to this query at least once a week, to make sure things don’t get fully lost, as a -1 will give the patch originator feedback to work on, and a +2 will make it far more likely to get the attention of other core reviewers when they are looking for mergable code.
Experimenting with your own
The gerrit query language is somewhat limited (full docs are online), so it can’t do everything I’d like, but even just these few slices make it easier to be able to get into a certain mindset for reviewing different slices of code. I have a toolbar folder full of bookmarks for these slices on different projects to do just that.
If you have other gerrit queries you regularly use, please leave a comment. Would love to see the ways other folks optimize gerrit for their workload.