The main branch of this project is empty for certain services

I want to the sonar report of dev branch specifically .
But for certain services it shows “The main branch of this project is empty”.

Not finding option to change the branch name in project settings.

  • Community Edition
  • Version 9.6
    sonarqube running as docker container .

Please assist on this

Hi,

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.

 
Ann

Hi Ann,
Thank you for your response.
yes I am using community edition.

Hi @ganncamp ,

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 ?

Please help me out on this scenario .

Hi,

Community Edition simply doesn’t support branches.

 
Ann

Thank you for your response !

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 !

Please clarify me on this

Hi,

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.

 
HTH,
Ann

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 !

Hi,

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.

 
Ann

Great !
Though it analyze from every branch we give but report gets generated only for main branch rite .