mibexsoftware / sonar-bitbucket-plugin

SonarQube plug-in to create pull request comments for found issues in Bitbucket Cloud
Other
122 stars 72 forks source link

Pull requests are not getting commented correctly. #98

Open AdityaMisra opened 5 years ago

AdityaMisra commented 5 years ago

Setup

I clone the sonar-bitbucket-plugin repo and then I run

mvn clean verify sonar:sonar --batch-mode --errors 
-Dsonar.bitbucket.repoSlug=$repo_slug 
-Dsonar.bitbucket.accountName=$accountName 
-Dsonar.bitbucket.teamName=$teamName 
-Dsonar.bitbucket.oauthClientKey=$clientKey 
-Dsonar.bitbucket.oauthClientSecret=$clientSecret 
-Dsonar.bitbucket.branchName=$branch_name 
-Dsonar.bitbucket.pullRequestId=$pull_request_id 
-Dsonar.bitbucket.minSeverity=INFO 
-Dsonar.host.url=$sonarQubeServerUrl 
-Dsonar.analysis.mode=preview

in my jenkins. This job runs when someone creates a PR in bitbucket cloud.

What is happening

I am not getting comments on my PRs.

What I see is "SonarQube Analysis reported no issues. Take a chocolate :-)" even if I commit really bad code. I've configured by default QualityGate to SonarQube way.

Is it because of this - Sonarqube logs -

"GET /batch/project.protobuf?key=ch.mibex.bitbucket%3Asonar-bitbucket-plugin&issues_mode=true HTTP/1.0" 404 106 "-" "ScannerMaven/3.5.0.1254/3.0.5"

Jenkin logs -

[INFO] Project key: ch.mibex.bitbucket:sonar-bitbucket-plugin
[INFO] -------------  Scan Sonar Bitbucket Cloud Plugin

Plug-in version, SonarQube version, CI system, build type

SonarQube version - 6.5.0.27846

keshrisohit commented 5 years ago

i am also facing similar issue .

alexantonica commented 5 years ago

Still having this issue on Sonarqube Server 7.6 Sonar Bitbucket Plugin v 1.3.0

Any solution?

arulrajnet commented 5 years ago

From the readme it says we have use -Dsonar.analysis.mode=issues not preview.

PS: I am aware of #81

jtanios commented 5 years ago

I'm also having the same issue, and I'm using -Dsonar.analysis.mode=issues

mrueegg commented 5 years ago

Could you please retry with the current version on master and let me know if this fixed the problem?

jtanios commented 5 years ago

It works in SonarQube Developer Edition. We were trying out the plugin in the Community Edition. Maybe an improvement would be to clearly indicate that in the docs.