sonar-auth-gitlab-plugin
sonar-auth-gitlab-plugin copied to clipboard
Sonarqube not syncing Gitlab groups
I have already read this issue and have been setting everything as it should which is :
- Gitlab Oauth working
- Gitlab group created and user added
- Sonarqube group added with the same name as gitlab one
- First login of user in sonarqube with gitlab
Still it is attributed the default sonar-users group.
Is there something i am missing?
@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?
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.
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.
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
I have the same issue. Groups from the end of the list do not sync from GitLab.
me too.