问题
we are trying to setup jenkins and gerrit for CI framework, gerrit can trigger Jenkins build, but can not update gerrit's verified label after build success, so i tried with manual command, still failed to update gerrit verified label field via following ssh command on jenkins server, but can update code-review label.
ssh -p 29418 gfkfcmo@cmgerrit1.com gerrit review -p HiCloud/myProject --label Verified=1 --code-review +1 27263,1
1.Setup:
gerrit:2.8.1 Jenkins: 2.60 gerrit trigger:2.27
- Gerrit change:
2.1 update myProject's project.config to enable verified label.
[label "Verified"]
function = MaxWithBlock
value = -1 Fails
value = 0 No score
value = +1 Verified
2.2 adding gfkfcmo as Jenkins non-interactive user, add permission in myProject access: Reference: refs/* Read: ALLOW for Non-Interactive Users
Reference: refs/heads/*
Label Code-Review: -1, +1 for Non-Interactive Users
Label Verified: -1, +1 for Non-Interactive Users
Jenkins change.
3.1 add gerrit server info, so "Trigger a Gerrit event manually" on jenkins works well.
3.2 Gerrit's comment add can also trigger Jenkins job build, so the conn works well.But build result was not posted back to gerrit, so using above SSH command on jenkins server, I can update "code-review" with user gfkfcmo, but did not take effect on "verified" label, see picture below.
I searched on this topic but did not get any hint or answers. Any hint will be highly appreciated.
updated screen
update screen with "tested" label
回答1:
I believe you need to set Verified flag with --verified +1, i.e.
ssh -p 29418 gfkfcmo@cmgerrit1.com gerrit review -p HiCloud/myProject --verified +1 --code-review +1 27263,1
回答2:
I think the "--verified +1" option is only available if the "Verified" label is defined in the "All-Projects" root project. In your case you need to use the "--label Label-Name=N" option:
ssh -p 29418 gfkfcmo@cmgerrit1.com gerrit review -p HiCloud/myProject --label Verified=+1 --code-review +1 27263,1
来源:https://stackoverflow.com/questions/50693324/manual-gerrit-review-cmd-did-not-update-verified-label-value