[OpenAFS-devel] Finding things you haven't reviewed yet in gerrit

Andrew Deason adeason@sinenomine.net
Fri, 29 Mar 2013 10:13:25 -0500


This is a multi-part message in MIME format.

--Multipart=_Fri__29_Mar_2013_10_13_25_-0500_1E+WmecPIOrX7BYw
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

When reviewing the big list of 1.6 changes, it can be helpful to see
what you haven't actually reviewed yet. gerrit doesn't have a way to
list things you haven't given a CodeReview score to ("reviewer" finds
things you're just listed on, whether or not you gave a score), so I
don't think this is possible via the web interface. And our version of
gerrit doesn't havethe REST interface for querying submissions, it looks
like.

However, you can get this information via the 'gerrit query' ssh
command. I wrote a quick script to read the output of that, and give you
back a list of changes that have not been given a CodeReview score by
the specified email address. I thought it may be useful to others, so it
is attached. Run it like:

$ ssh -p 29418 gerrit.openafs.org gerrit query --current-patch-set \
	status:open branch:openafs-stable-1_6_x \
| gerrit-not-reviewed adeason@sinenomine.net
Enter passphrase for key[...]
http://gerrit.openafs.org/9639 Linux 3.9: hlist iterator change
http://gerrit.openafs.org/9692 afsio: Pass KRB5_LDFLAGS along with KRB5_LIBS
http://gerrit.openafs.org/9682 rxperf: print achieved transfer rate
[...]

The arguments to 'gerrit query' can be any gerrit search string, so you
may want that to be something like this instead:

status:open branch:openafs-stable-1_6_x -label:CodeReview=+2 -label:CodeReview=-2

to filter out changes that have been +2'd (already been approved) or
-2'd (already been decided that they won't be going in 1.6.3).

I also just thought this is useful to show how you can get gerrit
information in a machine-readable form (JSON or plain text), if you want
to run searches in general that are not supported by the search syntax.

-- 
Andrew Deason
adeason@sinenomine.net

--Multipart=_Fri__29_Mar_2013_10_13_25_-0500_1E+WmecPIOrX7BYw
Content-Type: application/octet-stream;
 name="gerrit-not-reviewed"
Content-Disposition: attachment;
 filename="gerrit-not-reviewed"
Content-Transfer-Encoding: base64

IyEvdXNyL2Jpbi9wZXJsCgp1c2Ugc3RyaWN0Owp1c2Ugd2FybmluZ3M7CgpteSAkZW1haWwg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