Hey, I started testing SonarQube today with a test key for the Team license and have problems to get the scan of our main branch to work and got forwarded to ask here from my Sonar AE.
When I look at the project (monorepo setup) and go to Projects → Analysis → Summary, I see:
"main" branch has not been analyzed yet and you have multiple branches already. It looks like it is not your Main Branch, check your configuration.
In Administration → Analysis method I kept the default Automtic Analysis turned on
in Project → Branches → main is the only enabled one and labeled as Main Branch
What am I missing or why is it not showing up? My AE mentioned that it should be working and I should ask here for suggestions. Anything I forgot to enable / configure?
Code is hosted on GitHub (monorepo), for CI we use Buildkite but still irrelevant, main Languages of the production code is Python+TypeScript but also still irrelevant. We use SonarQube Cloud
stumbled over this reading the documentation on monorepo support - might explain things (and slightly disappointed that the AE doesn’t mention that to be honest):
Currently, monorepo support is available for GitHub, Bitbucket Cloud, Azure DevOps and GitLab repositories. Note that the analysis of a monorepo configuration is only supported for the CI-based analysis, not for the automatic analysis.
Hey @mwe, welcome to the Community! Yes, as you found out, Automatic Analysis does not support monorepo configurations, so enabling it will not analyze your main branch as expected in this setup.
Was Automatic Analysis active by default in the project? If it was, then I would argue it shouldn’t since well, it’s not supported for monorepos, so perhaps this is something I could flag for the team to have a look at.
I think it was enabled by default. But either way, the error/warning is for sure wrong.
Also fyi, I deleted the project and created multiple sub-projects that I scan with a CI pipeline. But the project still shows up in the project selector and then of course errors when you try to choose it.
I see, okay, so there are a few things here for our teams to have a deeper look into. Before that, could you share the project key of the project you tried to delete, and also elaborate a bit more on what’s the error that you see (screenshots if you can)?