Skip to content

Exclude archived projects in search results by default

What does this MR do and why?

Users have been requesting to exclude archived projects from the search results for the project scope.

How

  • Add a filter include_archived - added to CE since both basic and advanced search will use it
  • Exclude archived projects if the filter is not added as a parameter
  • Include archived projects if the filter is added as a parameter
  • Basic search uses the archived field on projects
  • Advanced search searches use the archived field already present in Elasticsearch

Next steps

Screenshots or screen recordings

Type Level Before After include_archived=true
Basic Global Screenshot_2023-05-29_at_13.51.59 Screenshot_2023-05-29_at_13.59.01 Screenshot_2023-05-29_at_13.59.18
Basic Group Screenshot_2023-05-29_at_13.52.40 Screenshot_2023-05-29_at_14.00.39 Screenshot_2023-05-29_at_14.01.02
Advanced Global Screenshot_2023-05-29_at_13.53.12 Screenshot_2023-05-29_at_14.02.16 Screenshot_2023-05-29_at_14.02.42
Advanced Group Screenshot_2023-05-29_at_13.53.46 Screenshot_2023-05-29_at_14.03.58 Screenshot_2023-05-29_at_14.03.37

How to set up and validate locally

  1. Do a basic search (add &basic_search=true to the url) for an existing project and verify that the project is returned in search results
    1. Without selecting a group/project
    2. With a group selected
  2. Archive the project
  3. Do the same basic searches and verify that the project is not returned
  4. Unarchive the project
  5. Do an advanced search (make sure Elasticsearch is setup) for the project and verify that the project is returned
    1. Without selecting a group/project
    2. With a group selected
  6. Archive the project
  7. Do the same advanced searches and verify that the project is not returned

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

Edited by Madelein van Niekerk

Merge request reports