We are developing software using both Java and C# and we have opted for a Bitbucket GIT based monorepo in our CI process. Currently our build server (TeamCity) executes an analysis on the C# code using the dotnet CLI runner, while the SonarQube Scanner plugin for TeamCity runs the analysis on the Java code. In SonarQube we have set up a single project with ALM integration to Bitbucket and pull request decoration enabled on the project.
While the above setup works and we are able to see quality reports posted to our pull requests in BitBucket with inline decoration, only the SonarQube analysis results of either the Java analysis or the C# analysis are preserved under the project in SonarQube (whichever runs last in the build process)
To overcome this we tried splitting our SonarQube project into 2 distinct projects with the same underlying BitBucket repository and ALM integration/PR decoration. Now the analysis results from the build process are preserved for both the Java and C# scan in SonarQube. So far so good. However this has led to our current problem: There is no way to distinguish quality reports posted from the 2 distinct SonarQube projects, which are linked to the same Bitbucket project key. The end results are therefore the same; the last scan (be it Java or C#) from the build server is the only quality report available in Bitbucket post-build.
Unless we’ve missed something in the SonarQube configfuration, there doesn’t appear to be a way to tweak the settings to avoid the issue we are having. Would it therefore be possible to incorporate the following feature in the project configuration page in SonarQube?
- Give the user the ability to specify the ALM project key of the quality report posted to Bitbucket in the project settings dialog in SonarQube under Project → Settings → Pull Request Decoration. Currently it seems to be “hardcoded” to com.sonarsource.sonarqube
- Likewise give the user the option to specify the name of the Quality report posted to Bitbucket. Like SonarQube (C#) / SonarQube (Java).
Since Bitbucket can handle multiple analysis reports via it’s code-insight feature, we believe this would be enough to accomplish our goal of supporting both C# and Java analysis of our project.