SonarQube helps me create and analyze my project from my preferred ALM: Bitbucket Server, GitHub, GitLab and Azure DevOps.
Still, when I import my project on SonarQube, and even once my main branch is analyzed, the main branch is always called "master" in SonarQube.
Obviously the concept of main branch is not specific to SonarQube, but exists in the ALMs.
- The main branch depends on the SCM and on the workflow adopted by the company. For example, teams using Gitflow can choose to consider 'develop' as the main branch for their projects.
- "Master" terminology tends to be replaced by a more neutral word and, from October 1st, GitHub changed their default branch name to ‘main’ instead of ‘master’.
In both cases, this means that the default branch name in SonarQube could be different from the one on the ALM side.
- This is confusing for the user who doesn't know if "ALM main branch" & "SonarQube master branch" relate to the same concept.
- During upgrade from CE -> DE, user will lost branch history if he doesn't rename his main branch before doing a first analysis (https://docs.sonarqube.org/latest/analysis/branch-pr-analysis-overview/)
As a project administrator:
- After I imported a project from my ALM and I analyzed the main branch, I expect that both my SonarQube and ALM main branch share the same name.
- After I upgraded from CE to DE+, I don't expect to have anything special to do to preserve history of my main branch (as documented here).
We expect this branch name consistency to be available for every ALM for which we support onboarding:
- Bitbucket Server
- Github Enterprise Server
- Azure DevOps Server
- Azure DevOps Services
Users using the manual project creation won't benefit from this.
During the onboarding from an ALM, we will fetch the default branch from the ALM branches metadata, and rename the "master" branch accordingly if needed.
Details about ALM API endpoint are detailed in linked tickets.