Skip to content

Fix bug with label_name search filter

Terri Chu requested to merge tchu-fix-label_name-global-level into master

What does this MR do and why?

Related to #479987

This MR fixes a bug found with global search for issues using the label_name param.

The fix is to take into account what search level is being requested (this is known and sent down as an option). Labels are queried differently for each level:

  • global - all labels are queried
  • group - group_id is sent to LabelsFinder
  • project - project_id (s) and group_id (if provided) are sent to LabelsFinder

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

No filtering applied: http://gdk.test:3000/search?scope=issues&search=sed

image

Filtering applied: https://gdk.test:3000/search?scope=issues&search=sed&label_name%5B%5D=Afterpod

User Before After
admin image image
non-admin image image
anonymous image image

How to set up and validate locally

  1. setup gdk for elasticsearch
  2. make sure you have issues with labels assigned to them
  3. perform a global issues search, manually add a label param to the URL
  1. ensure that the filtering applies to the result
  2. also test with non-admin and anonymous users
Edited by Terri Chu

Merge request reports