Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i do sonar scan on the Gerrit patch?

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?

like image 392
Raghavendra Pathi Avatar asked Sep 02 '25 02:09

Raghavendra Pathi


1 Answers

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

enter image description here

like image 122
Marcelo Ávila de Oliveira Avatar answered Sep 06 '25 22:09

Marcelo Ávila de Oliveira