Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

No Comments are created or detected even when Major/Blocker issues exist #90

Open
rudolphjacksonm opened this issue Jun 19, 2018 · 1 comment

Comments

@rudolphjacksonm
Copy link

rudolphjacksonm commented Jun 19, 2018

Expected Behavior

When running the sonar-bitbucket plugin as a shell step within a Jenkins job using the following settings:

mvn clean verify sonar:sonar -X -Dsonar.verbose=true --batch-mode --errors \
     -Dsonar.bitbucket.repoSlug=[sanitized] \
     -Dsonar.bitbucket.accountName=[sanitized] \
     -Dsonar.bitbucket.branchName=${sourceBranch} \
     -Dsonar.bitbucket.oauthClientKey=[sanitized] \
     -Dsonar.bitbucket.oauthClientSecret=[sanitized] \
     -Dsonar.bitbucket.approvalFeatureEnabled=true \
     -Dsonar.bitbucket.maxSeverityApprovalLevel=INFO \
     -Dsonar.host.url=[sanitized] \
     -Dsonar.analysis.mode=preview

Comments should appear on a pull request noting the Critical/Major/Blocker issues. At bare minimum, there should be a comment stating Found X issues and X of them are new

Actual Behavior

At this time I only receive a comment on the Pull Request stating SonarQube Analysis reported no issues. Take a chocolate :-).

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

SonarQube version: Version 6.7 (build 33306) running on CentOS 7
Bitbucket Version: Bitbucket Cloud
CI System: Jenkins
Plug-in version: 1.2.3

Here's a snippet of the debug logs:

[DEBUG] 15:53:35.878 [sonar4bitbucket] Found 46 issues and 46 of them are new:
[DEBUG] 15:53:35.881 [sonar4bitbucket]  - [sanitized] Either re-interrupt this method or rethrow the "InterruptedException".
[DEBUG] 15:53:35.881 [sonar4bitbucket]   - [sanitized] Either re-interrupt this method or rethrow the "InterruptedException".
[DEBUG] 15:53:35.882 [sonar4bitbucket]   - [sanitized] Either re-interrupt this method or rethrow the "InterruptedException".
[DEBUG] 15:53:35.882 [sonar4bitbucket]   - [sanitized] Either re-interrupt this method or rethrow the "InterruptedException".
[DEBUG] 15:53:35.882 [sonar4bitbucket]   - [sanitized] Either re-interrupt this method or rethrow the "InterruptedException".
[DEBUG] 15:53:35.883 [sonar4bitbucket] And 0 of these are on changed or new lines:
[DEBUG] 15:53:35.892 [sonar4bitbucket] Found 0 existing inline comments:
Jun 19, 2018 3:53:35 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 8 * Client out-bound request
8 > DELETE https://api.bitbucket.org[sanitized]
8 > Authorization: [sanitized]

Jun 19, 2018 3:53:36 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 8 * Client in-bound response
8 < 200
8 < X-Accepted-OAuth-Scopes: pullrequest
8 < X-Credential-Type: oauth2
8 < Server: nginx
8 < X-Content-Type-Options: nosniff
8 < Connection: Keep-Alive
8 < X-Static-Version: acb0ee83c5f1
8 < X-Version: acb0ee83c5f1
8 < Date: Tue, 19 Jun 2018 14:53:36 GMT
8 < X-Frame-Options: SAMEORIGIN
8 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
8 < X-Render-Time: 0.90554690361
8 < ETag: "96bf88752d4ae81cfd98935070e0ee5b"
8 < X-Served-By: app-142
8 < Vary: Authorization
8 < Content-Length: 354
8 < X-OAuth-Scopes: pullrequest:write, account
8 < X-Request-Count: 50
8 < Content-Type: application/json; charset=utf-8
8 < 
{"pull_request_id": XX, "comment_id": XX, "pr_repo": {"owner": "XX", "slug": "XX"}, "deleted": true, "filename_hash": null, "filename": null, "is_entity_author": false, "parent_id": null, "comparespec": "XX/XX:XXXXXX", "line_from": null, "line_to": null, "dest_rev": null, "anchor": null, "is_spam": false}

Jun 19, 2018 3:53:36 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 9 * Client out-bound request
9 > POST https://api.bitbucket.org/XX/comments
9 > Content-Type: application/json
9 > Accept: application/json
9 > Authorization: XX
{"content":"**SonarQube Analysis** reported no issues. Take a chocolate :-)\n\nNote that only issues with severity >= ![MAJOR](https://raw.githubusercontent.com/mibexsoftware/sonar-bitbucket-plugin/master/src/main/resources/images/severity/MAJOR.png) (major) are reported."}
@rudolphjacksonm rudolphjacksonm changed the title No issues are detected when Major/Blocker issues exist No Comments are created or detected even when Major/Blocker issues exist Jun 19, 2018
@rudolphjacksonm
Copy link
Author

I suppose even if the pull request comment feature only applies for code that has been highlighted in the diff view, shouldn't I still receive a comment stating that there were issues 46 issues found?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant