Add backend filtering for @ autocomplete
What does this MR do and why?
Allows backend filtering for the mention autocomplete so that we don't have to render a very large JSON payload when in large projects or groups or when the user has a lot of authorized groups.
Query plans
The current change adds an extra WHERE
clause and an ORDER
clause. Plans are very similar to the existing one where we fetch all results. We just add an extra filtering and sorting step.
-
Project members (When in an issue or MR)
-
Group members (When in an epic)
-
User's authorized groups (When in an issue, epic, or MR. This is used for mentioning groups)
How to set up and validate locally
- Enable
mention_autocomplete_backend_filtering
feature flag. - Open an issue / MR / Epic
- Type
@
in a comment text area and try autocompleting users or groups
You can check the network inspector to confirm that we're making requests with the search
param and returning limited results.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #209965 (closed)