Issue 729: Return approvals from gerrit query command
Status:  Released
Owner:
Closed:  Oct 2010
Reported by dav...@codeaurora.org, Sep 14, 2010
The 'gerrit query' command does not provide any visibility into the approvals.  For our internal dashboard, we need to see all of the approvals, and it might be easiest to just add an option, such as --approvals, that includes all of the approvals in the JSON output.  It may also be useful to include the summary approval information (what is shown on the Gerrit dashboard) with all results.
Sep 15, 2010
#1 sop@google.com
Do you need all of the approvals?

Or just the approvals for the current patch set?

If its just the current patch set (aka, what is
shown in the web UI) you can get that with the
--current-patch-set option.
Status: AwaitingInformation
Sep 15, 2010
#2 dav...@codeaurora.org
I'm still trying to figure out just how much we need.  When I started the dashboard, the summary information wasn't sufficient, and I had to query the entire patch_set_approvals table for a given change.  The current data might be useful.

I'm going to have someone look into this to see if it is sufficient information.

I do have some concern about each query requiring a new ssh connection, though, especially since the limit seems to be capped at 500 records.
Sep 15, 2010
#3 sop@google.com
Use SSH ControlMaster to tunnel the commands.

That is, have the program that is about to do
one or more query calls startup a background
ssh process with ControlMaster enabled using a
temporary socket file, then run each query over
that socket rather than directly.  That will let
them reuse the same SSH session.  repo sync does
this when the URLs are SSH URLs.

Anyway, mfick appears to be working on this right
now given remarks he's making on IRC.  Moving it
to his queue.
Status: Started
Owner: mf...@codeaurora.org
Oct 17, 2010
#4 maze@google.com
I would like to add my vote for gerrit guery --approvals --comments or something along those lines.

[side note: I'd like to be able to (via the command line) extract _all_ available information about a Change or set of Changes, including when patchsets/comments/approvals/state transitions were made.

Preferably including some sort of timestamps:
 - last modified time of Change, updated anytime anything wrt to a change or one of its patchets changes
 - last modified time of each patch set, updated anytime any comments/approvals are added]

Use case:

I'd like to see approval state on all patch sets of a given change, since in certain cases I would like to auto-propagate them from patch set N-1 (or earlier) to patch set N.

Think auto approver for:
  - trivial rebases
  - commit comment only changes
  - white space only changes
  - a change to only a certain unimportant set of metadata files
  - etc.

I'd also like to see all comments (preferably including comments within the files, but that's not strictly needed) made on all patch sets (or at least on the last one) of a given change.  This would make it easier for an external automated system (for example: code linter) to know whether it had already commented on a change/patchset or not.
Oct 17, 2010
#5 sop@google.com
I'm leaning more and more towards moving all of the review
data into Git itself.  I might actually do it during the month of
December and see if we can't make a holiday release... with it
enabled.  If all of the review data is in Git, its easy enough for
a program to just pull the relevant branch and parse through
the data itself.
Oct 17, 2010
#6 maze@google.com
That would be awesome!

Especially since that would presumably also make gerrit stream-events able to take a git hash of the last state to resume from (and never drop events)...

I was thinking that (moving to git for the data store) would eventually happen, but thought it might be a bit of a major undertaking...
Oct 18, 2010
#7 patn...@gmail.com
Moving all the review data into Git sounds like a really great feature!
Oct 29, 2010
#8 sop@google.com
Commit db3be259339a4dcbf39bb2b8e0395d0501e78557 adds
an --all-approvals flag to gerrit query to show more
detail about a change.
Status: Submitted
Labels: FixedIn-2.1.6
Dec 15, 2010
#9 sop@google.com
(No comment was entered for this change.)
Status: Released