Reporting single activity with multiple sonar properties file

Hello there, I hope everybody is doing great!

I have the following situation:

  • My project(repository) has multiple services, each one using and reporting to SonarCloud with its own sonar-properties file. This will generate, for a single repository, multiple reports
  • I would like to “merge” those reports into a single one. This is because we are creating some global rules for the company to check Sonar quality gate. For this purpose, it would be way easier to keep a single report (even if the team responsible for the repository prefer to have this report granularity per service)
  • I could create a sonar properties file on the repository root path, but I am wondering if there is another way to solve this

Thanks in advance

Hey there.

In order to view a single report, you would need to find a way to run the scanner only once for the whole project (and post the entire analysis at once to your project).

What language(s) are you analyzing?

Hi Colin, thanks for the quick response.

We use Golang


In that case, with a single repository, you should just be able to run the sonar-scanner at the top-level directory that contains all the microservices and target a single SonarCloud project key. I guess you already figured this out:

Right now, there’s no aggregation feature in SonarCloud, although we might get there someday (bringing in the SonarQube concept of Applications or something similar)

And, I’d like to return to this point:

Can you tell me what about having a single report makes this easier? A single Quality Profile or Quality Gate can be applied to multiple projects, so I’m not sure how a single project makes applying these “global rules” easier (and at the cost of annoying developers).

Hi Colin, thanks again for the response.

The single report I meant was per repository. The main issue is related to the way some repositories were configured, with multiple sonar property files, reporting as multiple projects on Sonar.

I just wanted to make sure there wasn’t a way to aggregate this. But as you said, there isn’t possible, so I am going ahead with the solution to keep a single properties file per repository.

Really appreciate your help and clarification