Skip to content

Return results if project archived for merge requests

What does this MR do and why?

Add the condition that the search scope is project then don't add the archive filter. Added options[:search_scope] != 'project'

There is no need to add specs for this change. There is a shared example spec for checking if the archived filter is added. This change will not add the archived filter to the project search for the archived project. Looks like there was no spec for an archived filter for archived project searches so there is nothing to remove in specs.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Ensure the elasticsearch is enabled
  • Enable the feature flag search_merge_requests_hide_archived_projects
Feature.enable :search_merge_requests_hide_archived_projects
  • Archive the project where you want to do the project search.
  • Wait a little to ensure that the Sidekiq job to update the archived field is completed.
  • Now perform a project advanced search on the archived project as a non-admin user
  • You should see the results for merge requests

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 #420906 (closed)

#424863 (closed)

Edited by Ravi Kumar

Merge request reports

Loading