3

I use Gerrit-Sonar plugin in my Jenkins jobs.

When I run the job, I get an exact result in the logs, that "n issues were found" and the report was sent to Gerrit. However, when I watch the review in Gerrit, it says that "No issues were found" and review gets a +1 score.

What could be the cause of this behaviour?

user
  • 3,058
  • 23
  • 45
  • Did you look the full Jenkins logs to find any warning or error message ? – Flows Sep 18 '16 at 12:56
  • facing the same issue . Were you able to resolve it ? – gsagrawal Sep 30 '16 at 10:41
  • @gsagrawal, I made some notes at work and I could extract them. Do you still need help? – user Oct 11 '16 at 19:59
  • yes i was able to resolve this. Thanks – gsagrawal Oct 17 '16 at 10:00
  • @gsagrawal I am facing the same issue. I am stuck. Could you please write a detailed answer ? – Teja Nov 24 '16 at 06:42
  • @Teja I reinstalled everything. Literally. – user Nov 24 '16 at 20:58
  • @teja , this was not a issue as such. Gerrit post issues when there are issues in the patch (not the complete application ) . So try creating a big patch (with issues) and run the plugin – gsagrawal Dec 05 '16 at 07:50
  • I had the same problem, but in my case my issue was on the "unchanged" code. So I have unchecked "Add comments to changed lines only" and I also unchecked "Report new issues only?". – Sa'ad Mar 09 '17 at 12:26

1 Answers1

0

I assume this issue is related to your filter settings.

So, what are the possible reasons of so many issues being ignored?

First, sonar report contains all issues of the project.

If you have your flag "Report new issues only", then all the issues that are already exist in sonar database will be omitted.

Next, flag "Add comments to changed lines only" allows plugin to ignore all issues that belongs to lines of code not changed in current commit. (For example, if sonar database refreshes once a day, all issues created in all commits during that day will be new, but only author of each of them supposed to care - so they are only visible to the author.

Finally, by default only issues with Major (and higher) severity will mark build as failed.

You may change filter settings. See project Wiki for details on how to do that.


This behaviour could also be related to the issue JENKINS-43047 with nested modules. If your project has several nested levels, the path of module component in the exported sonar-report.json is not the full path but the path component of the module. The plugin hasn't process it correctly before the version 1.0.8.

Another issue is JENKINS-43730, if you have 0 project configurations added. Add default configuration so your sonar report could be found by plugin

Tatiana Goretskaya
  • 536
  • 10
  • 25