Since branches don’t exist in Community Edition, I guess you’re using the “Community Branch Plugin”? If so, you should direct your questions to its maintainers.
I came across something with " -Dsonar.branch.name=$BRANCH_NAME" adding it in sonar.properties displays which branch being scanned currently ?
Tried using it in sonar.properties but no luck. Is other any other way to check which branch getting scanned currently ?
Can we change the scanning to be performed only on “Develop” branch in community edition only ?
Hi @ganncamp ,
One last question
How does the sonarqube knows we triggering from master branch .
Because when i add sonarqube stage in any branch and trigger it , I see project being created in sonarqube dashboard .
Is that its only picking up master/main branch present in the repo inspite of we trigger different branches !
If you’re in Community Edition, which doesn’t support branches, then every analysis must be of the main branch, since nothing else is supported/possible.
Okay .
It means even if we trigger test or feature or dev branch , sonarqube checks only for the main branch and displays the analyze report of main branch in sonarqube dashboard .
Please Correct me if i am wrong !
SonarQube analyzes the code you give it. If you give it main branch code, it analyzes main branch code. Give it a feature branch, and it analyzes that code. And reports everything as the main (i.e. only) branch of the project.