sending POST/PUT to gerrit to ... set a topic for example.

Description

Hi,

I'd like to ask, whether:

a) is even possible to pass requests to do some modifications on gerrit
b) if it is, then when I'd be glad if you can inform me, what I'm doing wrong in following command [1]
c) if it's not currently possible to pass such requests, I'd like to ask if they can be allowed.

Motivation: I have quite often longer topics, like 10 patches. Due to our work style they need to be rebased often and reverified. Or I need to specify same reviewers to all of them. etc. etc. This means I have to open all of them (takes ages to load) and do same actions over and over, which is time waste. Also, gerrit is (apparently) not designed to work under 'heavy' load, which means, that quite often page isn't loaded successfully. For example change is loaded, but allegedly I'm not logged in (which is not true), and because of that I have to hit refresh. This means, that I'm generating a lot of unnecessary load for gerrit server, while what I'd actually like to do is for example set topic to 10 patches, for which I do not need whole detail with all revisions to be loaded.

[1]
curl --digest -v -H Content-Type:application/json -u "mmuchaface with tongueass" -X PUT https://gerrit.ovirt.org/changes/58620/topic -d '{"topic":"test"}'

this return 403, and I'd like to know, if this is because of error in this command, or because this type of operations are generally not allowed.

Thanks,
M.

Activity

Show:

Eyal Edri June 3, 2018 at 1:06 PM

Didn't hear on the ticket for over a year, please contact infra if you still need assistance with Gerrit, though we'll need to evaluate what kind of REST access we allow for patches, and to what degree so we won't affect Gerrit server stability

Eyal Edri February 26, 2017 at 5:25 PM

please talk with , I heard he implemented a script that works well for him with the Gerrit API.

Former user July 13, 2016 at 3:43 PM

Thanks for reply.

I wasn't able to integrate gerrit cli into my workflow in past due to some errors with it, so I decided simply not to use it. But then I found REST api, which is documented and kinda works (as documented) for all GET requests.

about adding reviewers — according to REST API, I don't have to do that manually. I can very easily create script, which will simply fire N requests (where N is number of patches) to add reviewers. Which is (far) more load-friendly than doing it via gerrit api. But I don't want to do only that. I can (easily) imagine more tasks (more complicated) I can automate for myself. All I need is rest api, which works for POSTs and PUTs. So the question is: does gerrit rest api work for such requests(and I just issuing wrong curl request), or it's disabled so noone can do that? I'm currently not interested in any other ways how to accomplish anything, I'm currently only interested in issuing rest requests.

if such requests are allowed and you can see error in given curl command, I'd be grateful for help.

Barak Korren July 13, 2016 at 2:58 PM

I can look this up in the gerrit cli/api.
But I sometimes have a similar workflow and have successfully used
git-review for most of this.
With git-review you can put multipile patches in the same local brance and
sumbit/update them all in a single command. The topic gets set according to
the branch name (and you can do rebases locally with git).
You still have to add reviewers manually, but we can setup groups to
streamline that.
בתאריך 13 ביולי 2016 17:31,‏ "Martin Mucha (oVirt JIRA)" <

Won't Do

Details

Assignee

Reporter

Priority

Created July 13, 2016 at 2:30 PM
Updated June 4, 2018 at 6:29 AM
Resolved June 3, 2018 at 1:06 PM

Flag notifications