We have a gitlab project that passes the sonarcloud analysis on our master branch from the gitlab CI stage however the background task reporting on the sonarcloud dashboard fails with the following error:
Project or branch in report (my-project-name) does not match the project or branch under which it was submitted (my-project-name:BRANCH:master)
The master branch is designated main branch and other projects with the same setup are successful so I’m not sure what’s going on here. This is consistently failing. Any help would be greatly appreciated.
Hi @Jeffrey_Kranking and welcome to our Community!
Could you please check what is the main branch of your project? You can check this at the “Main Branch” section of the left sided toolbar. Let me know if it’s
master or something else (so far i understood the name is
main, but i want do double check and avoid mistakes).
For the background task you saw this error, can you provide me with the analysis ID, please? I can start a private message with you if you don’t want to share this here, just let me know.
Hi @Alexandre_Holzhey ,
master is our main branch. The analysis ID is
Hi @Alexandre_Holzhey any update on this issue?
Hi @Jeffrey_Kranking , sorry for the delay.
I look at the task you provided and it confirmed the error you already provided. What i can see here is that when processing the report it does not detect it as for the main branch, leading to this error. I will look further today and give you more information soon.
Hello again @Jeffrey_Kranking . Seems to me your main branch is named “main” at GitLab and “master” at SonarCloud, leading to this problem and similar to this topic. Could you double check the name of the main branch at both sides, please?
@Alexandre_Holzhey Confirmed that the default branch is
master on both gitlab and sonarcloud.
Thanks a lot @Jeffrey_Kranking . Could i ask you to provide your CI script/configuration? I want to check branch configuration. I can send you a private message if you want to not make it public, just tell me.