Questions about setting up a monorepo in Azure Devops

Template for a good new topic, formatted with Markdown:

  • ALM used
    Azure DevOps
  • CI system used
    Azure DevOps
  • Scanner command used when applicable (private details masked)
    TypeScript/Javascript

What is the correct procedure for setting up a monorepo? So far I have

  • imported our main repo at the point of registering for SonarCloud.
  • I’ve then selected this as the source repo for some additional monorepo projects.
  • I’ve then created new keys and names for those project, that then appear in the project list. (however, if I look in the settings for the project the toggle control for Enable support for monorepo, this is off)
  • I follow the steps in ‘configure analysis’.
  • I’ve set the key and name specified into the devops pipeline, but i still get analysis for the entire repo?

Also I have been following the steps on Monorepo Support | SonarCloud Docs, which has some CI specific links at the bottom of the page, but these just seem to be circular links back to the current page.

Am I doing this correctly?

Would I be right in saying that the monorepo support is essentially the ability to point more than one SonarCloud project at the same repo, and that the scoping of what is analyzed in those sub projects, is down to setting the right analysis scopes via the existing config mechanism in the constituent projects?

Or is there more too it than that?

Hey there.

Yes – monorepo support ensures that when multiple SonarCloud analyses happen in the context of a single repo (with mutliple SonarCloud projects), the results don’t overwrite each other. It is still up to you, for each individual project analysis, to make sure that the analysis is scoped to only the relevant files.

Thanks, I understand what I have to do now.

Just a quick nudge that the links of the bottom of this page don’t go anywhere, not sure if there is meant to be CI specific info behind them. Monorepo Support | SonarCloud Docs,

I’ll ping our docs folks. Thanks.