Group Members API returning null user details
Summary
Since the release of GitLab 8.11 requesting the members of a group can return null users if there are users which have been invited to join the group.
Steps to reproduce
- Create a new group
- Got to members page
- Enter the email address of a user that isn't a user on the system. This should invite the user to join the GitLab instance.
- Now request the member list via the API
Expected behavior
Either a single user, or details for the invited user. Not sure what was happening in GitLab 8.10 or earlier but it wasn't sending back null records.
Actual behavior
There are 2 users, one is null, the second is the user who created the group
Relevant logs and/or screenshots
Member list confirmation:
$ curl -s --header "PRIVATE-TOKEN: redacted" "https://somehost.com/api/v3/groups/9203/members"
[
null,
{
"name":"Steve Norman (Admin)",
"username":"admin.steve",
"id":5268,
"state":"active",
"avatar_url":"https://somehost.com/uploads/user/avatar/5268/admin.jpg",
"web_url":"https://somehost.com/u/admin.steve",
"access_level":50,
"expires_at":null
}
]
Possible fixes
There were a lot of changes in the member API for 8.11 from what I can see, merging the project and group membership so something may have changed in that, nothing seems to be obvious though.