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
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).
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).
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.