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
How to set up and validate locally
- In the rails console enable the feature flag
Feature.enable(:child_epics_from_different_hierarchies)
- Create 3 groups:
Group A
->Subgroup 1
->Subgroup 2
and an epic in each group - Create a group in a different hierarchy
Group B
and an epic in it - Visit epic in
Subgroup 1
and try to add the epics fromGroup A
,Subgroup 2
andGroup B
as child epics - 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.
-
I have evaluated the MR acceptance checklist for this MR.