Bitbucket pull request decoration help

  • ALM used: Bitbucket Cloud
  • CI system used: Jenkins
  • Scanner command used
    bat "${scannerHome}/bin/sonar-scanner$BRANCH_NAME"
  • file:
  • Languages of the repository: Python

I’m not seeing the full pull request decoration in bitbucket, and I’m wondering what I’m doing wrong.
I see the code quality printout, and it correctly shows a few code smells that I intentionally added:

However, if I go to that code in the PR, I don’t see any sonarcloud banners surrounding the offending code:

If I go to, I can see the code smells there. But they’re not showing up in bitbucket.

I would expect to see something like this in bitbucket:

Ok I got it to work!

I had to run the following: (Python code)

            pull_request_id = f"-Dsonar.pullrequest.key={}"
            source_branch = f"-Dsonar.pullrequest.branch={pull_request.source}"
            target_branch = f"-Dsonar.pullrequest.base={}"

            os.system(f"{self.scanner_home}/bin/sonar-scanner {pull_request_id} {source_branch} {target_branch}")

I used the bitbucket cloud API to get the pull request ID and target branch:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.