Can i do sonar scan on the Gerrit patch?

452 Views Asked by At

As part of my precheckin workflow in Gerrit I want to configure sonarqube to perform scan on the submitted patch, I am using sonar-gerrit plugin in my Jenkins and configured gerrit-trigger to run this analysis job. This job is configured with preview mode and runs analysis but the the analysis happens on the repository which doesn’t include the submitted patchset. How can i ensure to run the analysis on the patchset?

1

There are 1 best solutions below

2
Marcelo Ávila de Oliveira On BEST ANSWER

Use the "$GERRIT_REFSPEC" variable to configure your job like the following:

enter image description here