SonarQube Enterprise - GitHub main vs master

Version 8.5.1 (build 38104)

Objective
Following the GitHub change in ‘master’ branch naming schema - migrating from ‘master’ to ‘main’ we have a hybrid of projects in our environment - legacy projects with a ‘master’ branch and new projects with a ‘main’ branch. When a scan occurs on a new project with a ‘main’ branch it is incorrectly assumed to be named ‘master’ which produces the following message:

“master” branch has not been analyzed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.

The remediation seems to be manual intervention in the UI to re-assign the main branch. However, this does not scale well as our integration is based on the original behavior of automatic main branch discover/assignment.

I have been unable to find a config property for explicitly setting the main branch. Is there such a setting? Is guidance available for a system where both ‘main’ and ‘master’ are present as main branch identifiers?

Hello @timficmon ,

We’re aware of these caveat. There is currently no solution outside of the manual intervention that you mention.
We have the intention to fix that in a reasonable future. I cannot tell you when exactly.
See https://jira.sonarsource.com/browse/MMF-2173

Olivier

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