Template for a good new topic, formatted with Markdown:
ALM used (Azure DevOps)
CI system used (Azure DevOps)
Scanner command used when applicable (private details masked)
Languages of the repository - DotNet
Hello,
We recently moved from SonarQube and SonarCloud and started seeing this issue with default branch.
We had our default branch set to 1.12.0 in Azure DevOps. But when we ran our first analysis from the Release_1.13.0 branch, SonarCloud decided to make a new Main branch called Release_1.12.0. Not exactly what we were expecting!
We tried to fix it by changing the default branch on Azure DevOps to 1.13.0, but SonarCloud kept pushing all the metrics to the Release_1.12.0 branch. We even created a new branch, Release_9.9.9, and made it the default, but no luck. SonarCloud still shows Release_1.12.0 as the default branch.
We found a suggestion to rename the Release_1.12.0 branch on SonarCloud to Release_1.13.0, but that means we’d have to do this every time we create a new branch in Azure DevOps. That’s not really a practical solution for us.
The linking between Azure DevOps and SonarCloud is not working as expected. SonarCloud is not able to recognize that the metrics that are coming from Azure DevOps are coming from Release_1
13.0 branch and not Release_1.12.0 branch.
You see, analysis should be picking up branch identity automatically from the environment. Since your actual analysis tasks look okay, the fact that it’s not signals that something is likely off in the environment.
Can you also share your analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.