Draft: Use fuzzy searching in label widgets
What does this MR do and why?
Makes the label widgets on work items and MRs use the same fuzzy label search that markdown/rich text label autocomplete uses.
In markdown, typing ~bugu suggests bug::ux. In the label sidebar widgets, bugu returns no results because the backend matches searchTerm as a contiguous substring. Both widgets already re-rank results client-side with fuzzaldrin-plus, so passing fuzzySearch: true (added in !252372 (merged)) in the two shared label queries is the only change needed: the backend returns the fuzzy superset and the existing client-side filter ranks it identically to markdown autocomplete.
This is part 2 of 2, stacked on !252372 (merged).
Do not merge until !252372 (merged) is deployed to production (workflow::production label). @gl_introduced cannot be applied to GraphQL arguments, so a frontend sending fuzzySearch to a backend without it would fail the entire labels query. This MR targets the backend branch and should auto-retarget to master when !252372 (merged) merges. Also do not merge until !255424 has merged. Fuzzy search matches a superset of the rows contiguous search matches, and without the contiguous-first ordering that MR adds, the 100-row page cap on the labels field can drop labels that are findable today. It is set as blocking this MR, so the order is enforced.
References
- Part 1 of 2 (backend): !252372 (merged)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Check out this branch (it includes the backend changes from !252372 (merged)).
- Create scoped labels such as
foo::barandfoo::bazin a project. - Open a work item (or an MR) in that project and open the Labels widget in the sidebar.
- Type
faz—foo::bazappears as the first result. Onmaster, this search returns "No matching results". - Ranking check: with labels
CapriceandCaravan, searchcar—Caravan(contiguous match) ranks aboveCaprice.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.