|
||||||||
|
This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira |
||||||||
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

I've found the root cause and the workaround.
The issue is that the command-line syntax of the SSH command that gerrit-trigger uses to interact with the code reviews needs to be changed when interacting with newer versions of Gerrit. In older versions of Gerrit it was specified using --verified=1. Somewhere along the line (I'm using Gerrit 2.6.1) Gerrit generalized the idea of "labels" and "verified" is now a label. So the new command-line syntax to set the label is --label verified=1.
For example, suppose Jenkins and Gerrit are running on the same machine. Then with older versions of Gerrit this would be the correct syntax to mark a patch as verified:
ssh -p 29418 jenkins@localhost approve 15,1 --message 'Verified' --verified 1
However, in newer versions of Gerrit, this is the correct syntax:
ssh -p 29418 jenkins@localhost approve 15,1 --message 'Verified' --label verified=1
The correct fix would be for gerrit-trigger to somehow figure out which version of Gerrit is in use and adapt this command accordingly.
Thankfully, there is an easy workaround. In the JENKINS_HOME directory there is a file named "gerrit-trigger.xml". Open this file in a text editor and you will see 5 or so lines that look like this:
<gerritVerifiedCmdBuildSuccessful>gerrit approve <CHANGE>,<PATCHSET> --message 'Build Successful <BUILDS_STATS
>' --verified <VERIFIED> --code-review <CODE_REVIEW></gerritVerifiedCmdBuildSuccessful>
All you have to do is change each occurrence of
--verified <VERIFIED>
to
--label verified=<VERIFIED>
and restart Jenkins and the gerrit integration works again!