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

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Check out this branch (it includes the backend changes from !252372 (merged)).
  2. Create scoped labels such as foo::bar and foo::baz in a project.
  3. Open a work item (or an MR) in that project and open the Labels widget in the sidebar.
  4. Type fazfoo::baz appears as the first result. On master, this search returns "No matching results".
  5. Ranking check: with labels Caprice and Caravan, search carCaravan (contiguous match) ranks above Caprice.

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.

Edited by Chad Lavimoniere

Merge request reports

Loading
Loading