0

There is a Jenkins freestyle job that is triggered by some Gerrit events.In response to triggers, it downloads the changes and runs a Sonarqube Analysis. The Sonarqube comments detailing the results are to be posted on Gerrit after the analysis is complete.This is the expected behaviour.

As of now, In Jenkins, the Sonarqube execution is success. But the build is failed mentioning the error " *ERROR: Build step failed with exception java.lang.IllegalArgumentException: Gerrit change number is empty*

Could anyone please help on this?

Reference:https://plugins.jenkins.io/sonar-gerrit/ Followed the same steps as mentioned in the above document.

Jenkins console output

Expected: The Sonarqube should post the comments to the respective Gerrit change,whether the Sonar-verified is +1/-1.

  • Click in the build in the menu on the left, then choose "Environment Variables". See if the GERRIT_CHANGE_NUMBER variable was set. – Marcelo Ávila de Oliveira Dec 07 '22 at 15:28
  • @MarceloÁviladeOliveira Environment variables are already set in the build section of the jenkins job. GERRIT_CHANGE_NUMBER=1692 GERRIT_PATCHSET_NUMBER=1 GERRIT_BRANCH=master GERRIT_REFSPEC=refs/changes/92/1692/1 – Anjitha Dec 08 '22 at 03:29

0 Answers0