Reputation: 1088
I have been tasked to write a tool that queries open changes for a given git projects. Next it uses the tip of tree and the open changes to create a build and test. And if build and testing goes fine then set a developer-verified on the change.
By reading some available documentation I am able to query open changes form gerrit and pull those as required. But I need help regarding how I can set the developer verified bit.
Is it possible to use something like the gerrit query to set the developer verified? I did read about gerrit review but I am not able to understand how to use my change numbers that I retrieved using gerrit query.
Upvotes: 1
Views: 1311
Reputation: 22401
To set the "developer-verified" label using the "gerrit review" command you need to execute:
ssh gerrit gerrit review --label developer-verified=VALUE COMMIT|CHANGEID,PATCHSET
Examples:
ssh gerrit gerrit review --label developer-verified=+1 9a56f1ebe1edaef9a2c86b78da6ce4f66ff3eb53
ssh gerrit gerrit review --label developer-verified=-1 40666,2
To get the Commit or the ChangeId+Patchset of the change using the "gerrit query" command you need to use the "--current-patch-set" parameter:
ssh gerrit gerrit query --current-patch-set status:open project:PROJECT
change I5d196415aa48791adf60b7bc4b9b00280e992c9b
project: PROJECT
branch: master
id: I5d196415aa48791adf60b7bc4b9b00280e992c9b
number: 40666
...
currentPatchSet:
number: 2
revision: 9a56f1ebe1edaef9a2c86b78da6ce4f66ff3eb53
...
The Commit will be shown in the "revision" field and the ChangeId+Patchset at the "number" fields.
Upvotes: 1