Integration with Bitbucket Cloud

Hi,
I’m looking forward to having integration between SonarCloud and Bitbucket Cloud. I know that there’s MMF-1126 to deliver exactly what I’m after. What I’d like to ask is when I could expect to be able to use some of the developed features? All sub-issues in MMF-1126 have been done/closed, but MMF-1126 is still in progress. Does anyone know the timeline or what are the next steps for it?

Thanks

1 Like

Hello,
You can already use the developed features, the SonarCloud application for Bitbucket Cloud is available there: https://bitbucket.org/account/addon-directory?addon=sonarcloud
The MMF-1126 is still in progress because there is all the part about having better team onboarding that is not done yet.

1 Like

And on top of what Greg mentioned, I might want to read this “Integration > Bitbucket Cloud” documentation page to be guided on how to get started: https://sonarcloud.io/documentation/integrations/bitbucketcloud

1 Like

Awesome. Thank you guys. Turned out that I was looking for that addon in a wrong place (https://marketplace.atlassian.com/search?hosting=cloud&product=bitbucket&query=sonar).

1 Like

Yes, the addon is not yet in the Atlassian Marketplace - but will soon be! :wink:

Hi,

We are planning to integrate “bitbucket” with “sonarcloud” using bitbucket pipelines. Here are the things done for the integration, but looks like some config is missing and the integration is breaking.

  1. Create an account in sonarcloud.io, with bitbucket login.
  2. Go through the process of creation of new project in sonarcloud.io and obtain a token to be used.
  3. Configure the token in the bitbucket pipelines as env variable, SONAR_TOKEN.

Now this is how the build is run from bitbucket pipeline.

bash ./gradlew sonarqube -Dsonar.organization=cleartrip -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN

When the build runs its giving me the below error, not

====
Could not fetch Bitbucket branch info: Insufficient privileges
:sonarqube FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sonarqube'.
> You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
===

Is there any other authorization configuration required?

You are in the same case as:

Have you installed the SonarCloud application in your Bitbucket Cloud account? This is what will allow us to communicate with Bitbucket Cloud APIs.

Hi Julien,

Yes, the sonarcloud application was logged in with bitbucket account. That’s what was surprising me about the authentication issue.

As suggested by Fabrice, post adding the sonar_key to the gradle command, it started working fine.

Thanks guys.

Hi folks.

When trying to configure the SonarCloud plugin in BitBucket (from the repo > Settings > SonarCloud > Settings), I get the message, “Add-on SonarCloud is not responding”.

Looking at the browser’s network connections I see it getting a 400 trying to GET “https://sonarcloud.io/integration/bitbucketcloud/repo_config?.…”.

The error response body is, “Missing mandatory param ‘isPrivateRepo’”. Does the plugin need updating to include this parameter in the call?

Thanks.

Hey Peter,

I believe you’re looking at:

(not answered yet, but I’m confident investigations are in progress)

1 Like

Hi,

I am really interested in getting all the features mentioned in MMF-1126. Any ideas on when it would be available to use?