Skip to content
Snippets Groups Projects

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

Merged results pipeline #938929513 passed

Pipeline: Ruby 3 forced pipeline

#938934409

    Pipeline: GitLab

    #938935050

      Pipeline: TRIGGERED_EE_PIPELINE

      #938935097

        +2

        Merged results pipeline passed for a69af4ca

        Test coverage 82.39% from 2 jobs

        Merged by Dmitry GruzdDmitry Gruzd 1 year ago (Jul 20, 2023 2:23pm UTC)

        Loading

        Pipeline #939020553 passed

        Pipeline passed for d7fce20e on master

        Test coverage 66.60% from 2 jobs
        10 environments impacted.

        Activity

        Filter activity
        • Approvals
        • Assignees & reviewers
        • Comments (from bots)
        • Comments (from users)
        • Commits & branches
        • Edits
        • Labels
        • Lock status
        • Mentions
        • Merge request status
        • Tracking
      • Ghost User
      • Ghost User
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Please register or sign in to reply
        Loading