AmadeusITGroup / sonar-stash

Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
MIT License
165 stars 82 forks source link

Can't get plugin to work #201

Closed adamzovits closed 5 years ago

adamzovits commented 5 years ago

Hi!

I'm currently administering two build systems, each consisting of a Sonar, a Jenkins and a Bitbucket instance. On of them works correctly as expected: Sonar checks all Pull Requests and approves the PR if no new issues were found or leaves comments pointing to the new issues otherwise. This system uses Sonar 5.6.7 Community, Bitbucket Server 4.13.0 and Sonar-Stash plugin 1.3.0-rc1.

The other system has generally newer components: Sonar 7.6 Community (the latest which should be compatible with this plugin), Bitbucket Server 4.13.0 (the same instance) and Sonar-Stash plugin 1.5.1, but on this system I can't seem to get the above mentioned functionality working. When the scan is initiated, the following output is given:

path\to\sonar-scanner -Dsonar.scm.provider=git -Dsonar.analysis.mode=preview -Dsonar.stash.comments.reset -Dsonar.stash.notification=true -Dsonar.stash.login=[SERVICE_USER] -Dsonar.stash.url=http://[OUR_BB] -Dsonar.stash.project=[PROJECTKEY] -Dsonar.stash.include.overview=true -Dsonar.stash.reviewer.approval=true -Dsonar.stash.repository=[PROJECT_REPO] -Dsonar.stash.pullrequest.id=1
15:02:22  INFO: Scanner configuration file: path\to\sonar-scanner\..\conf\sonar-scanner.properties
15:02:22  INFO: Project root configuration file: path\to\workspace\PR_1\sonar-project.properties
15:02:22  INFO: SonarQube Scanner 3.3.0.1492
15:02:22  INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
15:02:22  INFO: Windows Server 2012 R2 6.3 amd64
15:02:22  INFO: User cache: path\to\.sonar\cache
15:02:22  INFO: SonarQube server 7.6.0
15:02:22  INFO: Default locale: "de_DE", source code encoding: "windows-1252" (analysis is platform dependent)
15:02:22  INFO: Issues mode
15:02:22  WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
15:02:23  INFO: Load global settings
[...SNIP...]
15:02:51  INFO: ------------- Run sensors on project
15:02:51  INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
15:02:51  INFO: Load server issues
15:02:53  INFO: Load server issues (done) | time=1976ms
15:02:53  INFO: Performing issue tracking
15:02:55  INFO: 5678/5678 components tracked
15:02:55  INFO: Load server rules
15:02:55  INFO: Load server rules (done) | time=124ms
15:02:55  INFO: ANALYSIS SUCCESSFUL
15:02:55  INFO: Analysis total time: 32.018 s
15:02:55  INFO: ------------------------------------------------------------------------
15:02:55  INFO: EXECUTION SUCCESS
15:02:55  INFO: ------------------------------------------------------------------------
15:02:55  INFO: Total time: 33.869s
15:02:55  INFO: Final Memory: 21M/622M
15:02:55  INFO: ------------------------------------------------------------------------
[Pipeline] }
15:02:57  WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
[Pipeline] // withSonarQubeEnv

There is no mention of the Executing post-job org.sonar.plugins.stash.StashIssueReportingPostJob which is seen in the older, functioning system, even though the sonar.stash properties are the same (apart from the repository and the project identifiers), the [SERVICE_USER] has the same rights on the Sonar project and in the Bitbucket repository. The only major differences are the version numbers, and whereas the older, working project uses Maven, the newer one builds with Ant and calls sonar-scanner from the command line.

I'm pretty sure I'm missing something elementary, but I've been up against this problem for a few days now and can't see any meaningful difference, so I'd really appreciate a bit of help, please.

Thank you!

t-8ch commented 5 years ago

@adamzovits For SQ 7.6 you need version 1.6.0 of the plugin.

adamzovits commented 5 years ago

@t-8ch Thank you, upgrading the plugin did the trick!