Two different SCM providers in one project

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Version 7.4 (build 18908)
    sonar-scanner-cli 3.1.0.1141

  • what are you trying to achieve
    I have a project where as modules I use both git and svn repositories. Is it possible to configure the project in such way that different modules have different scm providers?

  • what have you tried so far to achieve this
    I tried to put sonar.scm.provider=svn or sonar.scm.provider=git line depending on the repository type in the sonar-project.properties file for each module to force a specific scm provider. Unfortunately, the first one encountered is set for the entire project.

Hello @damianschmidt,

Welcome to the community.
First of all I would encourage you to upgrade SonarQube to a sufficiently new version of SonarQube (7.9 or 8.3 latest (8.4 to be released in a few days)) to make sure you get all the latest capabilities.

That said I believe that even recent versions of SonarQube would not fix your problem.
I can see 2 different alternatives, both with drawbacks:

  • Set sonar.scm.disabled=true to turn off SCM integration. The drawbacks are:
    – You won’t get the Authors of the code, so auto-issue assignment won’t work
    – You won’t get detection of new code based on SCM data. It will fallback to the SonarQube built-in new code detection algorithm, that’s less accurate
  • Scan the SVN and GIT parts of your project as 2 separate projects (using different sonar.sources properties for each part), and let the SCM plugins do their jobs separately. The drawback is:
    – Your project is broken down into 2 separate projects in SonarQube

If you can explain a bit more in detail the structure of your project and why you have pieces in 2 differents SCM, maybe I could find a more suitable solution.

Olivier

PS: There’s a feature in commercial editions that’s called Applications that could completely eliminate the drawback of the 2nd option above by aggregating projects in SonarQube into a meta-project called an “Application” in SonarQube terminology

Hello @OlivierK,

Thank you for the quick reply. I think you answered my question.

Damian