Skip to content

Advanced Epic Search

Madelein van Niekerk requested to merge 250699-advanced-epic-search into master

Currently all epic searches are doing a Basic Search and we want to allow Advanced Search to be used when Elasticsearch is available for faster and better searching.

To achieve this, we need the following:

This MR

The feature is behind feature flag advanced_epic_search.

The search functionality is based on the implementation of EpicsFinder:

  • Epic search is only done when the following criteria is met, otherwise no results are returned:
    • Searching from a group
    • The user has to have the ability to read epics for the group: Ability.allowed?(current_user, :read_epic, group)
  • A basic_query_hash is used to perform the search on title and description
  • A prefix filter is done on traversal_ids so that epics from the group and its descendants are returned
  • A confidentiality filter is also applied:
    • If the user is able to read confidential epics for this group, they inherit this ability for descendant groups: Ability.allowed?(current_user, :read_confidential_epic, group)
    • If not, we only return epics that either:
      • Is not confidential
      • Is confidential AND belongs to a group that the user is able to read confidential epics (Group.groups_user_can(group_and_descendants, current_user, :read_confidential_epic))
  • Routed by the group's root ancestor id

Screenshots or screen recordings

Video showing different levels of ownership for a group with a parent and child. The results of the Epic list for each group is shown alongside Epic search for comparison.

Epic_search

How to set up and validate locally

  1. Ensure elasticsearch is running
  2. Execute the migration worker a few times to add epics into elasticsearch: Elastic::MigrationWorker.new.perform
  3. Execute Feature.enable(:advanced_epic_search)
  4. Navigate to a group and perform a search and click on Epics. Note that advanced search is used.

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

Edited by Madelein van Niekerk

Merge request reports