Skip to content

Fix roadmap filtering for nested epics

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

What does this MR do and why?

Second iteration for #412302 (closed)

In !123070 (merged) we introduced a new fix for duplicated child epics in roadmaps but it missed an edge case where filters apply to skipped levels of nesting. See !123070 (comment 1429762331)

Screenshots or screen recordings

Before After
roadmap_filter_nested_children_before roadmap_filter_nested_children_after

How to set up and validate locally

  1. Open rails console and create a group with nested epics:
user = User.first
start_date = 1.month.ago
end_date = Date.today + 2.months
group = Group.create!(name: 'Group with Roadmap', path: 'roadmap_group2')
label = GroupLabel.create!(title: 'Pink', group: group)

epic_1 = Epic.create!(title: 'Epic 1', author: user, start_date: start_date, end_date: end_date, group: group)
epic_2 = Epic.create!(title: 'Epic 2', author: user, start_date: start_date, end_date: end_date, group: group, parent: epic_1, labels: [label])
epic_3 = Epic.create!(title: 'Epic 3', author: user, start_date: start_date, end_date: end_date, group: group, parent: epic_2)
epic_4 = Epic.create!(title: 'Epic 4', author: user, start_date: start_date, end_date: end_date, group: group, parent: epic_3, labels: [label])
  1. Visit the group's roadmap and verify that filtering by the label Pink displays Epic 2 and Epic 4.

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