Set up a MonoRepo from multiple existing SonarCloud projects

TL;DR: is it possible to create a MonoRepo using multiple already existing SonarCloud projects? Or do I have to use an existing one and recreate the other ones (but lose their history)?

Hello all,

I have a project where previous maintainers created multiple SonarCloud projects for a single GitHub repository (one for the Java part, one for the C++ part). The thing is, it was before MonoRepo existed so they are considered different projects and in the GitHub PR, they appear with no specific name:

That causes a problem with the checks where the second analysis just erase the check result of the first. Which means that if the first fails but the second is ok, the check will appear ok…

On another repo where we only had one SonarCloud project, I created a MonoRepo and I now have both analysis appear with different names, which then creates a line for each analysis in the checks.


I would like to have the same for the first repo but I can’t find how to create the MonoRepo with the two existing repositories.

My question is: is it possible to create a MonoRepo using multiple already existing SonarCloud projects? Or do I have to use an existing one and recreate the second one (but lose the history)?

Template for a good new topic, formatted with Markdown:

Thank you for your help and your answers!

Hey there.

SonarCloud doesn’t let you convert multiple existing projects into a monorepo. You’ll have to take this approach:

Sorry. :confused:

We recently made project binding much more flexible (you can rebind projects after they’re created, which is a huge leap forward). Hopefully, we make the monorepo binding experience better in the future. :pray:

Hello!

Currently I’m in a similar situation (one monorepo + a stack of regular sonar project) and thanks for the information so far. I saw in the docs that it is possible to convert a regular sonar project to a monorepo sonar project when it is bound to a certain repo:

If you select a repository that is already bound to SonarQube Cloud, then this creates new projects as part of a monorepo setup and converts the existing project, which is bound to the selected repository, to the monorepo.

Perhaps this is something that can be used? Are there other restrictions?

Hey @GHoogslag

The limitation here is that only new projects can be added to the monorepo (except for that one project that is converted). Additional existing projects can’t be added to the monorepo, and that’s still the case today.