Make user autocompletes at the project and group level complete and consistent
Currently, there are multiple ways we query data for the user autocompletes. Some use the AutocompleteController#users
endpoint while others use the GraphQL projectMembers
/ groupMembers
queries.
We currently have issues with using the GraphQL queries because the results are incomplete: #387603 (closed), #343306 (closed). There's also the issue where group boards use a slightly different GraphQL query from group issues list: #412331 (comment 1403069150).
Proposed solution
- Create a GraphQL version of the
AutocompleteController#users
endpoint. - Update issue list filter bar, issue board filter bar, issue board scope assignee list, issue sidebar assignee list to all use the same endpoint.
Project-level autocomplete
For project-level autocomplete (project issue board / lists, issue sidebar), we should list all members of the project including those from shared groups and indirect shared groups. AutocompleteController#users
already does this so we can use the same finder.
Group-level autocomplete
For group-level autocomplete, there are 2 scenarios:
-
Aggregated lists of project-level objects (group issue board / list)
In this case, since we're aggregating project-level objects, we should include members of child projects even though they're not group members (a member of a project is granted read access to ancestor groups but they're technically not a member of the ancestor group since they can only see a limited part of that group). This is basically #412331 (closed).
AutocompleteController#users
does not handle this right now. It only queries group members. So we should modifyAutocomplete::UsersFinder
to include these users. -
Lists of group-level objects (epic list) and group-level object sidebar (epic sidebar)
Since we're dealing with a group-level object, the most likely participants / assignees would be group members. We can skip members of child groups / projects here so the results are more relevant. Also, for the author filter, only group members would be authors.
We don't have assignees for epics so this is mostly theoretical but this will also be applicable to group-level work items.
There's also the case of combined lists like if we have a group work item list that included group-level and project-level work items. In this case, we'd want to show the more complete list, the one with child group / project members.
To lessen complexity, we can also decide to just include the child group / project members all the time even in group-level only lists / group-level objects. These are suggestion endpoints anyway and there's less harm to including more results than omitting them.