Sonarqube config w/ concurrent workflows in CircleCI

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 9.9
    SonarScanner 5.0.1.3006

  • how is SonarQube deployed: zip, Docker, Helm
    Helm

  • what are you trying to achieve
    We’ve got a monorepo w/ 4 services and a shared lib. This is configured in CircleCI workflows to run concurrently (build/test/deploy for shared lib and each service runs in a separate workflow) and conditionally (the build/test for a service/lib only triggers if that service/lib has been modified).

What’s happening is that each build/deploy’s sonarscan job overwrites the previous coverage info so only the last one to run persists in the SQ UI.

I’d like all of the coverage/repo info to persist.

  • what have you tried so far to achieve this
    I’ve tried persisting the coverage reports and running sonarscan at the end but at that point sonar scan doesn’t have access to the full file system and the scan will error out.

Currently exploring how to make this work, but I’ve also been looking in SQ help and documentation to see if there’s a way to keep the last report for a given source dir cached if it doesn’t get updated in a scan.

Any info here?

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

Correct me but I’m wrong, but it sounds like you have everything targeting one SonarQube project.

It would be better for you to have 4 separate SonarQube projects (and 4 separate scans pointing at different keys). This is our suggested setup for monorepos.