Hi, using SonarQube developer edition 8.9.2 (LTS) I have tried to enable PR decoration from our on-prem SonarQube server to bitbucket cloud. I have followed the following document:
https://docs.sonarqube.org/8.9/analysis/bitbucket-cloud-integration/
- I have created the Oauth consumer and granted read and write permissions to both repositories and pull requests
- I have added the ALM integration with bitbucket cloud. When I click on “check configuration” it tells me that it is valid
- I have configured the PR decoration in the project by setting the Repository SLUG URL and selecting the previously created ALM integration
- I have double checked that the WorkspaceID and the Project_slug are correct (https://bitbucket.org/{workspace_id}/{repo_name})
When I create a new PR, bitbucket pipelines runs sonar with the official image and uploads the result. I can see in the SonarQube UI the PR, the status and the PR number so I am assuming that the bitbucket pipelines - SonarQUbe integration works, but the PR is not decorated. In the logs I see this:
2021.10.27 09:28:41 INFO ce[AXzAppmHh0KNU6R4V06R][o.s.a.c.b.b.BitbucketCloudRestClient] Error returned by Bitbucket Cloud: 404 Resource not found
2021.10.27 09:28:41 WARN ce[AXzAppmHh0KNU6R4V06R][c.s.F.D.A.B.A] Pull request decoration did not happen. Failed to access Bitbucket Cloud, the repository or the pull request
I have enabled trace logs, but I cannot see much more. I can see that indeed, SonarQube is aware that it is a PR and that the PR number is 339 (which is correct)
2021.10.27 09:28:40 TRACE ce[AXzAppmHh0KNU6R4V06R][sql] time=1ms | sql=select pb.uuid as uuid, pb.project_uuid as projectUuid, pb.kee as kee, pb.branch_type as branchType, pb.merge_branch_uuid as mergeBranchUuid, pb.pull_request_binary as pullRequestBinary, pb.exclude_from_purge as excludeFromPurge, pb.need_issue_sync as needIssueSync from project_branches pb where pb.project_uuid = ? and pb.kee = ? and pb.branch_type = ? | params=XXXXXXXXXXXXX, 339, PULL_REQUEST
How can I find which URL endpoint/API is calling Sonarqube to try to debug what is happening? We are using https_proxy, but it seems to be working because in the trace logs I see that the connection succeeds.
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][jdk.event.security] ValidationChain: -1410680354, -598607089, 1810929538
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][jdk.event.security] TLSHandshake: bitbucket.org:80, TLSv1.3, TLS_AES_128_GCM_SHA256, 1810929538
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][o.i.http2.Http2] >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][o.i.http2.Http2] >> 0x00000000 6 SETTINGS
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][o.i.http2.Http2] >> 0x00000000 4 WINDOW_UPDATE
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][o.i.c.TaskRunner] Q10009 scheduled after 0 µs: OkHttp bitbucket.org
2021.10.27 09:28:40 DEBUG ce[AXzAppmHh0KNU6R4V06R][o.i.c.TaskRunner] Q10000 scheduled after 0 µs: OkHttp ConnectionPool
I have searched in the forums but beyond ensuring that the workspace id and the slug_name is correct, I cannot find any more information. There has been any API change from Atlassian that is preventing SonarQube to work?
Regards
Regards.