Importing from Gitlab subgroups

Hi Sonar community!
We have multiple Gitlab projects organized in subgroups and intend to integrate with SonarCloud just one of them. I understand Gitlab subgroups are not supported in SonarCloud and wondering what would be a recipe to complete the integration? I’ve practically confirmed the limitation attempting to import the Gitlab subgroup in Sonarcloud receiving Gitlab subgroups aren't supported error.

Thinking of:

  • Importing topmost Gitlab group including its subgroups (not sure it is supported either) and then restrict certain users to Sonacloud projects correspond to Gitlab subgroup in question. The approach depends on a project key naming in Sonar that magically embeds subgroup(s) name
  • Adding Gitlab projects from subgroup in question externally via Sonar API
  • Hearing from Sonar subgroups will be supported soon :wink:

Thanks much in advance!

Hello Ilia,

Thank you for your insight.

Today, SonarCloud does not support importing a specific sub-group from GitLab. You can import your topmost group: It will give you access to the projects of all sub-groups within this group. Then, you can select the list of projects you would like to analyze and add the needed permissions to the right users.

We are studying how we can support this better in the future.

Thank you.

1 Like

Thanks much, Ilham! For the scenario suggested, would SonarCloud generate project keys based on Gitlab groups hierarchy (something along the lines org-group-subgroup-project) so that I could utilize permissions template with a pattern?

Hello Ilia,

Today the key generated by SonarCloud for a project is a concatenation of the project’s topmost group URL name + the project’s name. You can edit this key and include the mention to your projects’ subgroups if this helps you in your setup.
We take note of your need to include subgroups in this concatenation. We’ll review it once we plan to introduce subgroups.


Very much appreciated, Ilham - that’d work in the interim, would be awesome to see subgroups being part of generated project name.

1 Like