Fix bug with label_name search filter
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 toLabelsFinder
- project -
project_id
(s) andgroup_id
(if provided) are sent toLabelsFinder
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
Filtering applied: https://gdk.test:3000/search?scope=issues&search=sed&label_name%5B%5D=Afterpod
User | Before | After |
---|---|---|
admin | ![]() |
![]() |
non-admin | ![]() |
![]() |
anonymous | ![]() |
![]() |
How to set up and validate locally
- setup gdk for elasticsearch
- make sure you have issues with labels assigned to them
- perform a global issues search, manually add a label param to the URL
- ensure that the filtering applies to the result
- also test with non-admin and anonymous users
Edited by Terri Chu