Use lowercase values in user search ordering
What does this MR do and why?
Fixes a subtle bug in the user search ranking where a case-sensitive match (PostgreSQL string equality) was used on a value that had previously been converted to lowercase. As a result, exact matches could receive the lowest priority instead of the higest priority.
For distinctive usernames, this was not a problem, as those would result in unique matches anyway. However, when the username matched a prefix of a common human name, an exact match could get buried at the bottom of the results.
For example, since Alexander is a very common name, this made it
virtually impossible to find @Alexand
in most GitLab dropdowns.
Database Review
Before and after changes, query explains
When searching via the users API (inviting memebers):
- before: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9724/commands/34474
- after: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9721/commands/34472
When searching via the autocomplete controller (adding reviewers):
- before: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9731/commands/34484
- after: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9729/commands/34482
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
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.