Advanced Epic Search
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:
- Create the index in Elasticsearch: Create Epic Elasticsearch index (!121635 - merged)
- Make sure epics are created/updated/deleted when needed: Keep epics index up to date in Elasticsearch (!123526 - merged)
- Enable the feature flag and remove from code
- Backfill all epics: Backfill Epics into elasticsearch (!125663 - merged)
-
Perform advanced search using the new epic index
👈 This MR
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 ontitle
anddescription
- 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)
)
- Is not
- If the user is able to read confidential epics for this group, they inherit this ability for descendant groups:
- 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.
How to set up and validate locally
- Ensure elasticsearch is running
- Execute the migration worker a few times to add epics into elasticsearch:
Elastic::MigrationWorker.new.perform
- Execute
Feature.enable(:advanced_epic_search)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #250699 (closed)
Edited by Madelein van Niekerk