Monorepo Help for Node.js and .NET projects

Must-share information (formatted with Markdown):

  • Sonarqube Server: Enterprise Edition v2025.1
  • Used in: Sonarqube Task in Azure Devops Pipeline

So, to give a little context, we used to have several applications, some frontends, a couple backends and some other thing in-between. We had set up Sonarqube separately for each project, and everything worked wonders. I had a sonar-project.properties file on the root of each project that dictated what had to be included, what had to be excluded, and what were tests and whatnot.
However, recently we moved all the projects inside of a new Monorepo, so basically a folder with all the projects inside of that folder, all living in a single repo, with new pipelines that trigger each build independently and use Sonarqube to scan each project individually.

However, even though the scans seem to work, we get strange reports with 0 code coverage. The issues are found and reported, but the Code Coverage is not working.
Furthermore, we get the test files we make as part of the “New code” and “Uncovered code”, despite the sonar.properties being defined inside of the project still.
Our pipeline looks like this on the prepare step:



I changed some names in the images to protect company data but, the idea is still there, i added “device-manager” to reflect the project folder inside of the monorepo, but this resulted fruitless too. So I reverted it back to not having the folder prefix :slight_smile:
Things we tried include:

  • Delete projects from Sonarqube and set them up as Monorepo now
  • Change sonar-project.properties to reflect the new monorepo structure and other routes just to see if it worked.
  • Added cliSources to pipeline task as you can see.

Any ideas would be appreciated.

Hi,

So, coverage was working fine before the monorepo-ization, but not after?

I suspect this is about the paths in your reports. Can you share the analysis log from one of these projects?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann