Direct-transfer placeholder users drop-down containing only Enterprise users.
Problem to solve
Direct-transfer placeholder users mapping feature offers a drop-down list of users for re-assignment.
This list shows all active users of the destination instance. On gitlab.com this is millions of users.
For customers using SCIM, usernames of destination users are not necessarily known for the reassigning Owner; when SCIM provisioning happens, the (source) usernames might be created with suffixes, to make them unique, and so in the dropdown, we get e.g. 5 usernames, so it’s hard to know which user is the correct one.
To limit human error and reduce the blast radius of potential mistakes this list should be narrowed down when possible.
In case of direct-transfer imports to gitlab.com, where the importing group is under a Premium or Ultimate license, we have the Enterprise users list available to offer for user re-assignment.
This list assumes only users that have already been onboarded/provisioned on gitlab.com and should therefore be the default selection but not enforced.
Proposal
Enterprise users are tied to (claimed by) a top-level group. It's a Premium+ feature.
If the top-level group, where the groups/projects imported, uses the gitlab.com Enterprise users feature, limit the placeholder users drop-down list to only Enterprise users present under the top-level group.
Hi @m_frankiewicz, while testing with a customer on .com I've realized they can only search the placeholder user drop-down by name or username. Search by email does not work for non-admin users. This means the Owner re-assigning the users would need to know the exact username (from IdP?) in order to find the correct user.
Did a bit more testing and realized one can search the re-assignment users by name, username or email. And if I enter my email in the dropdown I get a unique match. So, although the source email is not provided under the Source column of Placeholders it might after all be ok as long as they can retrieve the IdP email used to provision the user.
I just did some testing myself. For my, search by email for non-admin worked.
Not in Admin mode, if I type full email of the user on destination, the search gives the single correct user:
or
Without full email (still typing) it doesn't work:
Typing name gives lots of results:
Correct destination username works - one result (this we know):
Hi @m_frankiewicz. Thanks for checking. It seems both of you have the public_email field exposed, which explains why you can search as a non-admin. If you e.g. try to search for me that should not work.
@m_frankiewicz We can add it to the next refinement issue, but I won't open one before next week. There are still items to be refined on the current refinement issue.
But it sounds like enterprise users are a special kind of user within a group, for example in these docs it mentions that you can filter members by enterprise users.
In the members controller, enterprise members filtering happens through GroupMembersFinder when passed enterprise: true argument.
So I don't think we can't query enterprise users through the users GraphQL field - it's using a different finder.
There is an existing GraphQL query that uses this finder, group.members, through GroupMembersResolver added in !145331 (merged).
For example this query should return back enterprise members for a group:
{group(fullPath:"<group full path>"){groupMembers(enterprise:true){nodes{iduser{idname}}}}}
For me, the query does not actually work locally, but this is because it silently ignores the filter here if my group hasn't been set up to support enterprise users - which it hasn't in my case.
So long as the feature check we make when determining if we should query users is the same one that GroupMembersFinder makes, it should all work.
In this case the frontend would switch between searching users through the existing users GraphQL query that it currently does, or the group.groupMembers query, based on if the group supports enterprise users or not.
It would make this work mostly frontend I think, with perhaps the backend needing to supply the boolean property to help the frontend know which GraphQL query to use.
@tachyons-gitlab does the above sound correct to you, specifically that we would check group.domain_verification_available? to decide if we should query enterprise users for the group or not?
We only allow filter members in a group by Enterprise badge if it is gitlab.com and the group has at least GitLab Premium subscription - that is the main goal of the group.domain_verification_available? check.
I don't understand the context of the issue, but in case if we need get list of all enterprise users regardless they are members of the group, there is GET /groups/:id/enterprise_users API endpoint that group Owners can use.
Thanks @bdenkovych. The context is when re-assigning (Placeholder) users to contributions on a gitlab.com group, one does not want to search among all users on .com, but rather have a way to filter the list. In case of this issue, the idea is to use the already available group enterprise users list, if possible, to limit human error by allowing the Owner to serch for a user by email instead of username.
Thanks for looking into this @.luke. I also noticed that the EE helper for group members includes an attribute can_filter_by_enterprise which includes the domain_verification_available? check. I guess we still need an new attribute that shows if a group has SCIM enabled.
@m_frankiewicz So just to reiterate the requirements of this issue (and correct me if I am wrong). When we have an Owner of a group on gitlab.com, they are at least on GitLab Premium plan, and have SCIM enabled, we should filter by Enterprise users of that group only instead of all users on the instance.
On the frontend, we need to change the query for this scenario (hopefully to the GraphQL query as we are already using this), then make sure all functionality still works as expected.