Using a Gitlab Service Account

The walk-through for setting up a Gitlab project in Sonar Cloud connects using a user’s account. This means that the quality gate emails sent to developers comes from a user rather than a service account. This is confusing to developers.

A) How can I set up the connections so that the quality gate info on MRs is not linked to a user?
B) How can I make this change to an already existing project?

Hello @Joshua_Gruber,

We suggest creating a technical or bot account that has the appropriate rights in your Gitlab group. Using the access token of this technical/bot account will make it clear that the Quality Gate comment is not posted by a specific user.

B) How can I make this change to an already existing project?

Updating the access token will automatically make sure that all future Quality Gate MR comments are posted by the new account. You can do this by navigating to Your organization on SonarCloud > Adminstration > Organization Settings > Gitlab Connectivity Settings > Personal Access Token

Hope that helps

Hi @TomVanBraband,

is there a specific reason why GitLab group tokens can’t be used? I added one with api scope and sonar says it’s “valid” but it fails to list projects or to run within our pipelines.