Dear Sonar community,
I am looking for help to understand how the Sonar Scanner chooses the branch name.
On the one-hand, my understanding is that if the property sonar.branch.name is left empty, the analysis results will be uploaded to the “master” branch.
This is consistent with what I observed when I ran sonar-scanner on my local machine and uploaded the results to SonarCloud.
However, when running the same command from our remote Gitlab-CI machine, I noticed a new line in the sonar-scanner log stating:
INFO: Auto-configuring branch XXX
(with XXX being the name of the GIT branch of the project being analysed), and the analysis results were uploaded in SonarCloud in a new “XXX” short-lived branch instead of the Sonar’s master branch.
In our case, although XXX is not called master, it is our main development branch which serves as a reference for short-lived branches, and as such we want it to be used as the Sonar’s master branch.
I could not find information about what this “auto-configuration” does.
Are there some documentation available that I missed ? Is there an inconsistency with the documentation of the sonar.branch.name property ?
Note: version used:
INFO: SonarScanner 184.108.40.2062
DEBUG: SonarCloud 220.127.116.1130
Thanks a lot !