SonarQube Overwriting Scans?

Must-share information (formatted with Markdown):

  • Currently using SonarQube Enterprise 8.9.5
  • My organization has multiple pipelines in a monorepo that we tried consolidating into one project in SonarQube to save some LOC. However, each time I would set one pipeline to run under the same project name, it would overwrite the previous scan from the other pipeline that ran with the same sonar project name. Is there a configuration setting to be able to do set pipelines to the same project name without overwriting previous scans? I want it to be able to simply add code coverage from one pipeline to the scan from the other pipeline.

Hey there.

It’s not possible to enrich an analysis with data from a separate scan (like adding code coverage after the fact). All the data needs to be there when the scan is submitted.

Hey Colin,
Thanks for the response. Maybe this question belongs in another thread, but what is the best way to handle mono-repos that contain multiple pipelines? We are getting a lot of duplication eating up LOC. We could create more detailed exclusions for each pipeline but that would require a massive sonar.exclusions argument for every single pipeline file. Is there a more efficient way to narrow the focus?

sonar.inclusions or sonar.sources might help you limit to just a single application without a big list.

β”œβ”€β”€ app1
β”œβ”€β”€ app2
└── app3

By setting sonar.sources=app1 or sonar.inclusions=app1/**/*, you would automatically limit the files included. The documentation on Narrowing the focus with analysis scope is helpful here.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.