Hello. I am encountering a problem with my SonarCloud scanner. It seems to be picking up the wrong branch as a default one. In “Main Branch” I get a message saying ““DCSB-691-improvments-in-update-itemised-sale-functionality” branch has not been analyzed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.”
We are using BitBucket for our CI. The main branch in BitBucket is selected as develop. I can see “develop” branch in “Branches” in SonarCloud and I can see the pull requests, but I can’t see it as a default overview of the project.
How can I change it so that develop becomes the Main Branch? If I remove DCSB-691-improvments-in-update-itemised-sale-functionality branch from BitBucket, would it automatically switch to develop as being the main branch?
Thanks for your reply. I just checked there and the project is bound to BitBucket but the default branch is still showing up incoorrectly.
The main branch in BitBucket is set as “develop” as can be seen in the screenshot.
Just to understand – separate from whether or not the project was created with the correct main branch, were you able to delete the develop short-lived branch and delete the original main branch? Just want to make sure you’re not still blocked there.
When you are saying to delete the branches, do you mean to delete them in BitBucket or in Sonarcloud? If it’s in Sonarcloud, I have an option to delete the “develop” branch, but not the [DCSB-691-improvments-in-update-itemised-sale-functionality]MAIN BRANCH. The only option I have for the main branch is Rename?
You would need to delete the develop branch, and rename the main branch to develop.
Or, delete the project and recreate it. If the main branch name is still not correct by default, make sure develop is the first branch analyzed.
Here is a project I created after changing the main branch to develop where the branch is accurately reflected. Which is why I’m puzzled it’s not the case for you.