Skip to content

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):

When searching via the autocomplete controller (adding reviewers):

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.

Edited by João Alexandre Cunha

Merge request reports

Loading