Samstag, 29. März 2014

Jenkins Gerrit Trigger and Gerrit 2.8 /RTFM

Yesterday I upgrade my Gerrit from version 2.7 on 2.8. The reason for the upgrade was the improved possibility to search now also in the commit message.
For more details have a look at in the doc.
The update was ok and run without any problems.
The problem started first next day. After pushing changes to gerrit the the jenkins gerrit trigger was doing his job and a build was automatically started on jenkins. Till here everything was good.
First when I start to review some code I just notice that jenkins was not able to make any notification about the status of the change was it "approve" or not.
After a look at the logs I wasn't  smarter :(

  • the Gerrit+Trigger Plugin was doing his work and was sending a message: INFO: Notifying BuildCompleted to gerrit: gerrit approve 438,4 --message 'Build Unstable : UNSTABLE' --verified 0 --code-review -1
  • unfortunately in gerrit nothing was logged :(
After a little research I land where I was at the begin of my update: namely on the the manual and release notes of Gerrit 2.8 and what do you know in the Schema Change which I have read and also done are also some WARNING's some of which I have already read. Unfortunately only some and/or not all paid enough attention :(. The third WARNING  specify clearly that the deprecated approve alias was removed. Here a short cite from the 
WARNING: The deprecated approve alias for the review SSH command has been removed. This is important for all users of the Jenkins Gerrit Trigger Plugin since this plugin by default uses the approve command to vote and comment on changes in Gerrit. If you use the Gerrit Trigger Plugin, go to its global configuration in Jenkins and adapt the Gerrit commands to use the review command instead of the approve command.

So the solution is obvious easy: 
  • login in jenkins and change under
    • Manage Jenkins
      • Gerrit Trigger
        • Gerrit Servers
          • Gerrit Reporting Values
            • Advanced
  • change the Gerrit Verified Commands as specified in the manual: review instead of approve

after update:
once again Did you read the F... Manual?else: