Monorepo Setup Generates Reports with Random Keys

We’ve recently started using a monorepo setup with SonarQube, and while everything seems to work fine in generating multiple reports per PR, we’re facing an issue with Bitbucket’s Code Insights.

Before moving to the monorepo configuration, each PR had a single report with a consistent Report Key: com.sonarsource.sonarqube. However, after the change, each report now generates with a random string appended to the key, like: com.sonarsource.sonarqube_aymr5t9hblbxj-71x-tt, for each project or module within the monorepo.

This random key generation breaks our Bitbucket Code Insights integration because it expects a consistent report key (com.sonarsource.sonarqube) to show the insights.

NOTE: The monorepo setup is simple, multiple projects are linked to the same repo. Monorepo setting is enabled. Then when doing scans via docker it’s all the same, we’re passing a project key per repo to scan.

Unfortunately, this is a limitation of our integration with Bitbucket Cloud.

As documented:

Preventing pull request merges when the quality gate fails is not supported for monorepos.

Thanks, Colin! I was mainly focused on the monorepo documentation. It would be great to have all the monorepo limitations listed in one place within the documentation. Anyway, thanks!

1 Like

I will ping our Docs folks. Thanks for the suggestion.

Thanks for your feedback, we do appreciate hearing from users about ways we can improve the documentation.

I’ll pass this suggestion on to the Docs team member responsible for the monorepo documentation.

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