Want to access Gerrit review comments

450 views
Skip to first unread message

Bruce Beare

unread,
Apr 25, 2011, 3:53:03 PM4/25/11
to Repo and Gerrit Discussion
I've developed a number of phyton scripts that pull data from Gerrit
using the JSON interface. These scripts are very handy when doing code
reviews for a large group (I can filter for various criteria before
opening a browser tab for selected commits to review).

What I can't do is access Gerrit data that is shown in the browser
interface but is not available via the 'gerrit query' command.
Examples of this are:
o review comments
o previous review votes (those that have been replaced by an updated
vote by a signed in user)
o lists of reviewers that have not voted

Is there an interface (or hack!) that will allow me to pull in data of
this sort?
... if not... how is this data stored? SQL? Flat file?
Where is it stored?
I'm willing to build something (simple) to fetch the data via ssh

Thank you for any assist,
Bruce

Digioia, MichaelX

unread,
Apr 25, 2011, 4:40:07 PM4/25/11
to Beare, Bruce J, Repo and Gerrit Discussion
Any plans to publish (inside or out of Intel) these once your are done?

--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

Nasser Grainawi

unread,
Apr 25, 2011, 4:47:48 PM4/25/11
to Bruce Beare, Repo and Gerrit Discussion
On Apr 25, 2011, at 1:53 PM, Bruce Beare wrote:

> I've developed a number of phyton scripts that pull data from Gerrit
> using the JSON interface. These scripts are very handy when doing code
> reviews for a large group (I can filter for various criteria before
> opening a browser tab for selected commits to review).
>
> What I can't do is access Gerrit data that is shown in the browser
> interface but is not available via the 'gerrit query' command.
> Examples of this are:
> o review comments
> o previous review votes (those that have been replaced by an updated
> vote by a signed in user)

You can get previous patchset votes using the --all-approvals option to gerrit query. Previous votes on the same patchset aren't stored anywhere.

> o lists of reviewers that have not voted
>
> Is there an interface (or hack!) that will allow me to pull in data of
> this sort?
> ... if not... how is this data stored? SQL? Flat file?
> Where is it stored?
> I'm willing to build something (simple) to fetch the data via ssh

To get the review comments and lists of reviewers that haven't voted you'll need to access the SQL database (and you'll need to have access to it). Depending on your installation that database could be PostgreSQL, H2, or MySQL.

Adding further options to 'gerrit query' to return this information would be the preferred method of building something to fetch this data. Contributing those changes to the upstream Gerrit project on review.source.android.com would be further smiled upon. :-)

Nasser

>
> Thank you for any assist,
> Bruce
>

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

Beare, Bruce J

unread,
Apr 25, 2011, 4:51:43 PM4/25/11
to Digioia, MichaelX, Repo and Gerrit Discussion
I'm glad to share. :)
... I presented these at the Android Builders Summit a couple of weeks ago.

Beare, Bruce J

unread,
Apr 25, 2011, 4:54:13 PM4/25/11
to Nasser Grainawi, Repo and Gerrit Discussion
Agreed on extending 'gerrit query'.
I've not looked at the server side code at all... perhaps I should do so next.


-----Original Message-----
From: Nasser Grainawi [mailto:nas...@codeaurora.org]
Sent: Monday, April 25, 2011 1:48 PM
To: Beare, Bruce J

Quentin Neill

unread,
Nov 14, 2013, 3:24:37 PM11/14/13
to repo-d...@googlegroups.com, Nasser Grainawi
So did this ever make it into the code?

Sanjay Kumar

unread,
Feb 21, 2014, 5:49:08 AM2/21/14
to repo-d...@googlegroups.com
Hi Bruce,
Could you share the details how did you access gerrit review comments.

Thanks
Sanjay
Reply all
Reply to author
Forward
0 new messages