Add backend for mr filter by source_branch
What does this MR do and why?
Related to #463373 (closed)
Feature flag: search_mr_filter_source_branch
This MR adds a the source_branch
filter to SearchService
for merge requests.
The backend will accept source_branch
for =
and not[source_branch]
for !=
searches.
The frontend is expected to only send one param, but the backend will allow both. If both are supplied an OR operation is done
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
Search filter | Screenshot |
---|---|
No filter | |
source_branch=BRANCH_NAME |
|
not[source_branch]=BRANCH_NAME |
How to set up and validate locally
- enable elasticsearch for gdk, and index everything using
gitlab:elastic:index
rake task - pick a project
- create two merge requests with the same searchable text
- note the branch names (i used the web IDE editor to create the merge requests easily)
- search for the text in the project
- verify all results come back
- add the
source_branch=BRANCH_NAME
param to the URL
- verify only the result from that branch comes back
- add the
not[source_branch]=BRANCH_NAME
param to the original URL
- verify the result from that branch does not come back
NOTE: You can repeat the test for group and global search
Edited by Terri Chu