Skip to content

Add backend filtering for @ autocomplete

Heinrich Lee Yu requested to merge 209965-users-autocomplete-backend-filter into master

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.

  1. Project members (When in an issue or MR)

  2. Group members (When in an epic)

  3. User's authorized groups (When in an issue, epic, or MR. This is used for mentioning groups)

How to set up and validate locally

  1. Enable mention_autocomplete_backend_filtering feature flag.
  2. Open an issue / MR / Epic
  3. 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.

Related to #209965

Edited by Heinrich Lee Yu

Merge request reports