Skip to content

Fix roadmap filters for child epics

Eugenia Grieff requested to merge 412302-roadmap-filter-subepics into master

What does this MR do and why?

Related to #412302 (closed)

In roadmaps when applying a filter that matches a child epic but not its parent, the child is missing from the results. This happens because we filter epics by topLevelHierarchyOnly to prevent the following epics duplication:

Click to expand

duplication_bug

This MR introduces a new fix for the duplication bug that allows us to remove the topLevelHierarchyOnly argument from the GraphQL query.

Screenshots or screen recordings

Before After
before_filter_by_label after_filter_by_label

How to set up and validate locally

  1. Open rails console and create a group with epics:
user = User.first
start_date = 1.month.ago
end_date = Date.today + 2.months
group = Group.create!(name: 'Group with Roadmap', path: 'roadmap_group1')
label = GroupLabel.create!(title: 'Pink', group: group)
parent_a = Epic.create!(title: 'Parent A', author: user, start_date: start_date, end_date: end_date, group: group)
child_a = Epic.create!(title: 'Child A', author: user, group: group, parent: parent_a)
subchild_a = Epic.create!(title: 'Subchild A', author: user, start_date: start_date, end_date: end_date, group: group, parent: parent_a)
parent_b = Epic.create!(title: 'Parent B', author: user, start_date: start_date, end_date: end_date, group: group)
child_b = Epic.create!(title: 'Child B', author: user, start_date: start_date, end_date: end_date, group: group, parent: parent_b, labels: [label])
  1. Visit the group's roadmap and verify that epics are displayed correctly:
Collapsed Expanded
collapsed_epics epics_structure
  1. Filter epics by the Pink label and verify that Child B is the only result:

after_filter_by_label

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugenia Grieff

Merge request reports