Posts mit dem Label jenkins gerrit trigger werden angezeigt. Alle Posts anzeigen
Posts mit dem Label jenkins gerrit trigger werden angezeigt. Alle Posts anzeigen

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 https://jenkinsserver.my/jenkins/job/myJob/1088/ : 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:
RTFM




Sonntag, 22. September 2013

Jenkins Gerrit Trigger and Gerrit 2.7

Yesterday I just update my Gerrit server from version 2.6* to 2.7.
One of the risen why i update was a bug when i was trying to view commits of other users in the side by side diff. The bug is also known and you can watch it evolve  under the issue 1893 Multiple errors, when trying to review differences. In the new version 2.7 the issue is fixed, at list in my environment it was not reproducible. More about the  release notes you can find in the ReleaseNotes/ReleaseNotes-2.7.html.
Everything was good until i have pushed my first commit under the new version. Since on my Jenkis instance i use Gerrit Trigger plugin, i was expecting that gerrit will trigger  Jenkis to check the new patch that was just submitted. This is how it worked with the old version of Jenkins. About how you set up the  Gerrit Trigger plugin see the set up information on the plugin site.
On my configuration i have a jenkins_ci user registered on gerrit. jekins_ci is a member of the Non-Interactive Users group and was created using create-account.

When i sow that gerrit is not trigger jenkins anymore first thing was to make a short debug and inspect the log files. For my surprise i sow that bouth services, gerrit and jenkins, are polluting their log files with something like

[2013-09-20 13:57:16,146] WARN  org.apache.sshd.server.session.ServerSession : Exception caught
java.io.IOException: Connection reset by peer....



in the  geerrit error_log file and

22.09.2013 11:48:00 com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritHandler run
INFO: Ready to receive data from Gerrit
22.09.2013 11:48:01 com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritHandler run
INFO: Ready to receive data from Gerrit
22.09.2013 11:48:01 com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritHandler run
INFO: Ready to receive data from Gerrit
22.09.2013 11:48:01 com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritHandler run
INFO: Ready to receive data from Gerrit

in jenkins log file. Jenkis was also showing an err on the manage site:

After spending some time searching for the problem i found the solution somewhere on the project mailing list. Unfortunately  i forgot to bookmark the site and that motivate my to start my blog and share with you this solution. The answer is that the non-interactive users group should have access to Stream Events. You can do this  over
Projects -> List -> All Projects -> Access

Now you can edit the Global Capabilities  and add permission Stream Events:



That's all folks! :)