Skip to content

Support label_name in addition to labels param

Terri Chu requested to merge 467387-convert-backend-to-label-name into master

What does this MR do and why?

Related to #467387 (closed)

Add backend support for issues label filter param label_name. The old param labels still works but will prefer label_name if provided.

The labels param will be removed in #470402

A few things to note:

  • label name in the URL is case sensitive
  • no differentiation in selecting project or group label if the name is identical
  • project level searches will also return issues with group labels if the name matches

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No UI difference, but here is a few screenshots of it working

labels passed

image

label_name passed

image

label_name and labels passed

image

How to set up and validate locally

I tested a few variations of labels:

  • group label named GroupLabel
  • project label named ProjectLabel
  • group and project label both named Duplicate
  1. setup elasticsearch for gdk, enable, and index everything

  2. create group and project labels in a group/project

  3. add group and project labels to issue(s)

  4. perform a group issues search (search or go to). the labels filter will populate.

  5. select one or more labels and apply

    http://gdk.test:3000/search?search=dismiss&nav_source=navbar&group_id=24&scope=issues&labels%5B%5D=249

  6. run the same search but replace in the URL labels with the label_name param. Note: the label name is case sensitive

    https://gdk.test:3000/search?search=dismiss&nav_source=navbar&group_id=24&scope=issues&label_name%5B%5D=Duplicate

  7. run the same search with both params (will need one of the label ids)

    http://gdk.test:3000/search?search=dismiss&group_id=24&scope=issues&project_id=3&label_name%5B%5D=Duplicate&labels%5B%5D=250

Edited by Terri Chu

Merge request reports