Warm tip: This article is reproduced from serverfault.com, please click

Sonar-Gerrit Jenkins plugin not reporting issues on Gerrit

发布于 2020-11-30 05:52:56

Jenkins and SonarQube Environment Information

Jenkins - 2.235.5
Gerrit Trigger - 2.31.0
Sonar Gerrit Plugin - 2.4.3
SonarQube Scanner for Jenkins - 2.12    
SonarQube Version -  6.7.7 (LTS).

Configuration: - Freestyle Job.

enter image description here

enter image description here

enter image description here

Jenkins Job Console log(Last few lines):-

INFO: Performing issue tracking
INFO: 3270/3270 components tracked
INFO: Export issues to /jenkins-node/workspace/Gerrit-Test/.scannerwork/sonar-report.json
INFO: ANALYSIS SUCCESSFUL
INFO: Executing post-job Final report
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Task total time: 2:21.625 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:22.428s
INFO: Final Memory: 71M/1470M
INFO: ------------------------------------------------------------------------
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
Getting Sonar Report from: /jenkins-node/workspace/Gerrit-Test/.scannerwork/sonar-report.json
Report has loaded and contains 13752 issues
Issues to be commented: 0
Issues to be involved in score calculation: 0
Review has been sent
Finished: SUCCESS

Though build/analysis is completed successfully, However nothing is commented on Gerrit. Is it something missing in my jenkins job setting?

Questioner
Kishore
Viewed
0
Marcelo Ávila de Oliveira 2020-12-01 00:58:11

Post comments issue:

SonarQube has found 13752 issues, but Is there some new issue in some changed line? I ask that because you have chosen to report (comment) only if new issues are found ("Report new issues only?" option) and only in changed lines ("affect changed lines only" option).

Post score issue:

You've chosen to use score "0" for "Score for no SonarQube violations found case" and for "Score for SonarQube violations found case". I think that with these options the plugin will never post the score.