Post Sonarqube report in gerrit

602 Views Asked by At

after performing Sonarqube analysis I get sonar-report.json. To post this in gerrit comment I use Sonar Gerrit Plugin. In jenkins logs there is an information: -Report has loaded and contains 15 issues -Issues to be commented: 0

My question is why no issues are commented to gerrit? Plugin configuration is default so severity level is lowest. I think all issues should be mentioned in gerit comment.

2

There are 2 best solutions below

0
On

Check the following Sonar-Gerrit plugin options at Post-build Actions > SonarQube Settings > Gerrit Settings... > Review Settings

  • Report new issues only?

    Only new SonarQube issues to be commented in Gerrit when checked. Modified files to be commented with all corresponding issues when unchecked.

  • Affect changed lines only

    Only changed in current commit lines to be commented by Gerrit when checked. Modified files to be commented with all issues if this control unchecked.

0
On

If your project has flat structure (no submodules), ensure "Project base directory" setting is empty. On the contrary, if your project contains submodules, try out "Allow auto match" or configure "Project base directory" for each of the submodules.