Skip to content

Allow excluding archived projects from merge request search

What does this MR do and why?

Enables excluding merge requests from archived projects from search results behind a feature flag search_merge_requests_hide_archived_projects

  1. Add archived (boolean) to merge request mappings
  2. Backfill archived for all merge requests in the index
  3. Add a filter for excluding archived projects if the option include_archived is not true (only if the migrations are finished and the feature flag is enabled)

How to set up and validate locally

  1. Ensure elasticsearch is running
  2. Run the migration worker a few times to execute the migrations
  3. Disable the feature flag Feature.disable(:search_merge_requests_hide_archived_projects)
  4. Find a project with a merge request
  5. Do search for the merge request: the merge request should be in the results
  6. Enable the feature flag Feature.enablesearch_merge_requests_hide_archived_projects)
  7. Do search for the merge request: the merge request should be in the results
  8. Archive the project
  9. Do search for the merge request: the merge request should NOT be in the results
  10. Do search for the merge request with the param include_archived=true: the merge request should be in the results
  11. Repeat steps 2-10 with the added param basic_search=true

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #414904 (closed)

Edited by Madelein van Niekerk

Merge request reports

Loading