Subgroups are fetched from Gitlab when fetching a user's groups
Problem
When we fetch namespaces from GitLab, we use the /api/v4/namespaces
endpoint, which returns all groups the user has access to. In some cases we limit this to groups that the user owns
, but mostly we just filter out the ineligible namespaces from the results on CustomersDot.
On my local machine, I have a user that has owner
access to 4472 groups, but only 23 of these are top level groups. When I perform actions that require fetching namespace information from GitLab, I only see information about a subset of these top level groups, because the current API call is returning all these subgroups, which we filter out on the CustomersDot side. We only make 4 requests (returning a total of 200 groups, which for this user is almost entirely subgroups) to GitLab to fetch namespaces.
Result
The main place I noticed this was the change linked namespace page because I wasn't seeing a group I had just created. I assume this affects all areas of the app where we need bulk namespace information from GitLab (purchasing, community programs, rendering the admin UI).
Proposal
Update the API call to GitLab to ask for ONLY top level groups, so that GitLab does the filtering, not CustomersDot. This will speed up the UI and reduce the amount of unneeded processing.
Support Priority Score: (1, 0, 0, 2, -, 2, 3, 2, 2, -, -) => 12