Skip to content

Add merge request search query builder

Terri Chu requested to merge 462679-add-merge-request-query-builder into master

What does this MR do and why?

Related to #462679 (closed)

High level: this MR refactors the Elasticsearch query generation to use the new query builder classes. It's done behind a derisk feature flag. There is no behavior change in the UI or backend, just refactor of how the ES query is generated.

  • Add Merge request query builder and specs
  • Add support in by_authorization filter to not attempt traversal_ids filtering. Not all indexes have traversal_ids indexed yet.
  • Add more filter specs for missing checks: when traversal_id_prefix is provided, new support check for traversal_ids
  • Create shared examples to for queries, filters, and formats. These are now used issues and merge request query builder specs

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

N/A

How to set up and validate locally

  1. enable elasticsearch and advanced search in gdk
  2. index everything using gitlab:elastic:index rake task
  3. ensure flag is disabled
 echo "Feature.disable(:search_merge_request_query_builder)" | gdk rails c
  1. perform searches for merge requests at project, group, global levels
  • note the results and counts returned for each
  1. ensure flag is enabled
 echo "Feature.enable(:search_merge_request_query_builder)" | gdk rails c
  1. perform the same searches for merge requests at project, group, global levels
  • verify you get the same results and counts returned for each
Edited by Ravi Kumar

Merge request reports

Loading