Skip to content

Allow adding child epics from different group hierarchies

What does this MR do and why?

Related to #373704 (closed)

Part of implementation for &8502 (closed)

In order to allow child epics from different group hierarchies, we need to update epics validation. The new validation would look like:

Child epic's group Valid
Is the same group as parent epic Yes
Is an ancestor group of parent epic No
Is a descendant group of parent epic Yes
Is a different group hierarchy Yes

This MR updates the model validation behind the feature flag :child_epics_from_different_hierarchies so new child epics from different groups can be added only when enabled.

Also when FF is enabled we'll check that the user can admin_epic_link in the child epic's group and that subepics feature is available for that group.

These changes only apply to adding child epics using the UI, the implementation for REST endpoints will be done with #373709 (closed)

Screenshots

descendant_parent_error

How to set up and validate locally

  1. In the rails console enable the feature flag
    Feature.enable(:child_epics_from_different_hierarchies)
  2. Create 3 groups: Group A -> Subgroup 1 -> Subgroup 2 and an epic in each group
  3. Create a group in a different hierarchy Group B and an epic in it
  4. Visit epic in Subgroup 1 and try to add the epics from Group A, Subgroup 2 and Group B as child epics
  5. The epic from Group A will show the error seen the in the screenshot above, the other child epics will be valid

Note that the epic from Group B will not be shown in the children list as it hasn't been implemented yet. This will be done with #373709 (closed)

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