Setting up SonarCloud in our workflow

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

We are trying to enable SonarCloud in our workflow, trying to find out the options we have to make it part of the workflow

We see 2 options to set it up,

  1. Use the sonar cloud pipe in Bitbucket pipelines to set up the scans
    • When trying this the scans are taking forever and finally failing with this error Container ‘docker’ exceeded memory limit.
  2. Link our Bitbucket cloud and SonarCloud so that automatic scans are set up when they are new PRs and new pushes to the branches
    • We have set up the repos in Sonarcloud by linking our Bitbucket project and added the branches (master and perf/qa) but looks like they are not getting triggered in new PRs/pushes

Can you guys please let us know what is the ideal way to add the Sonar scan steps in our workflow?

Additionally, we are also looking for options to integrate SonarCloud with our Jira Cloud so that the new issues are created when new bugs are found in the code. Please let us know the options we have for that integration.


Welcome to the community!

You haven’t provided any of the specifics requested in the topic template. For instance, knowing

  • Languages of the repository

would have been particularly helpful on the question of automatic analysis.

Regarding the Bitbucket error, this post may help.