sonar-auth-gitlab-plugin icon indicating copy to clipboard operation
sonar-auth-gitlab-plugin copied to clipboard

Sonarqube not syncing Gitlab groups

Open jarodevs opened this issue 5 years ago • 6 comments

I have already read this issue and have been setting everything as it should which is :

  1. Gitlab Oauth working
  2. Gitlab group created and user added
  3. Sonarqube group added with the same name as gitlab one
  4. First login of user in sonarqube with gitlab

Still it is attributed the default sonar-users group.

Is there something i am missing?

jarodevs avatar May 23 '19 10:05 jarodevs

@Mnjaro hi,did you solve this problem? i have the same problem. another problem @gabrie-allaigre , i manually put a gitlab user in sonarqube group, and when the user log out, and then log in , the group remove this user, is there a solution?

qimei8685 avatar Jun 18 '19 08:06 qimei8685

Any updates? I did the same test as @Mnjaro and it didn't work either. I'm using SonarQube 7.9.1 and sonar-auth-gitlab-plugin 1.3.2.

rodrigomageste avatar Aug 28 '19 14:08 rodrigomageste

After log in with GitLab, the callback method (GitLabIdentityProvider#callback) of plugin is executed and users groups syncronized.

To sync groups, the plugin use this hash:

{ 
    Link: <https://host.com/api/v4/groups?order_by=name&owned=false&page=2&per_page=20&sort=asc&statistics=false&with_custom_attributes=false>; rel="next", 
          <https://host.com/api/v4/groups?order_by=name&owned=false&page=1&per_page=20&sort=asc&statistics=false&with_custom_attributes=false>; rel="first", 
          <https://host.com/api/v4/groups?order_by=name&owned=false&page=3&per_page=20&sort=asc&statistics=false&with_custom_attributes=false>; rel="last"
}

The problem is that the plugin does not iterate in the second and third pages, it only sync groups listed in first page (the first 20 groups).

NOTE.: To work sync, the groups of user must be present in the first page and you must create the group manually in SonarQube Server.

rodrigomageste avatar Aug 28 '19 19:08 rodrigomageste

I've had the problem with groups not synching from Gitlab to SonarQube. I my case, I could resolve the problem by changing the group name to all lowercase characters (Sonar-rules-admin to sonar-rules-admin). Problem with upper/lowercase handling? I've got fewer than 10 groups in Gitlab so a 20 groups limitation is not applicable here.

We're using:

  • SonarQube Developer EditionVersion 8.5.1 (build 38104)
  • GitLab Enterprise Edition 13.8.4-ee

wmeeus avatar Feb 17 '21 08:02 wmeeus

I have the same issue. Groups from the end of the list do not sync from GitLab.

AGovorukha avatar Mar 02 '21 14:03 AGovorukha

me too.

AndiSusanto15 avatar Mar 15 '22 02:03 AndiSusanto15