[JIRA] (OVIRT-634) sending POST/PUT to gerrit to ... set a topic for example.

Martin Mucha (oVirt JIRA) jira at ovirt-jira.atlassian.net
Wed Jul 13 15:44:00 UTC 2016


    [ https://ovirt-jira.atlassian.net/browse/OVIRT-634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18503#comment-18503 ] 

Martin Mucha commented on OVIRT-634:
------------------------------------

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.

> sending POST/PUT to gerrit to ... set a topic for example.
> ----------------------------------------------------------
>
>                 Key: OVIRT-634
>                 URL: https://ovirt-jira.atlassian.net/browse/OVIRT-634
>             Project: oVirt - virtualization made easy
>          Issue Type: By-EMAIL
>            Reporter: Martin Mucha
>            Assignee: infra
>
> 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 "mmucha:pass" -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.



--
This message was sent by Atlassian JIRA
(v1000.148.2#100005)



More information about the Infra mailing list