Add validation for epic issue group hierarchy
What does this MR do and why?
In https://gitlab.com/gitlab-org/gitlab/-/issues/330520 we added a fix that prevents leakage of some invalid data. !79557 (merged) will remove existing invalid records.
This MR removes the validation checks from services and adds a validation to the model instead.
Valid epic issue record means that both epic and issue belong to the same group hierarchy - the issue project has to be under the epic group (or its descendants).
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 #339514
Edited by Eugenia Grieff