- ALM used (GitHub, Bitbucket Cloud, Azure DevOps): GitHub
- CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI): CircleCI
- Scanner command used when applicable (private details masked): sonarcloud/scan
- Languages of the repository: python
- 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
Hello,
I am seeking some clarification regarding branch analysis in SonarCloud. Currently, I have the “master” branch set as my main branch and a secondary branch, “preprod,” configured as another long-lived branch. I have set up a workflow in CircleCI to execute the sonarcloud/scan
command (provided by the sonarsource/sonarcloud orb), whenever changes are merged into the “preprod” branch.
This is how the circle ci workflow looks like:
preprod-quality-after-merge:
when:
equal: [preprod, << pipeline.git.branch >>]
jobs:
- tests-with-coverage:
context: private-secrets
- sonar-static-analysis-coverage:
context: SonarCloud
requires:
- tests-with-coverage
and the sonar-static-analysis-coverage job looking like this:
sonar-static-analysis-coverage:
executor: base
resource_class: medium
steps:
- attach_workspace:
at: /tmp
- checkout_repository
- sonarcloud/scan
Could you please guide me on how to configure the analysis results to use “preprod” as the reference branch instead of the “master” branch, still keeping master as the “MAIN” one in sonar cloud?
Thank you for your assistance.
LA
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!