Include cross-hierarchy epics in epic ancestors
What does this MR do and why?
Because it will be possible to have ancestor epics from cross-group hiearrchies, we need to update listing of epic's ancestors to return only ancestors up to the first inaccessible epic (related discussion: #373708 (comment 1122265127)).
There are a couple of changes because of this:
- adds a separate Epics::AncestorsFinder - existing EpicsFinder is left as was (mostly) dedicated for finding epics in ancestor/descendats groups
- adds Epics::Findable module for logic shared by all finders (all = there will be at least one more for listing epic's children) - this contains mainly filtering and searching logic (while each finder takes care of providing "base" query)
Related to #373708 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- enable
child_epics_from_different_hierarchies
flag - Set parent from group in different hierarchy
- Run query like this:
query {
group(fullPath: "flightjs") {
epic(iid: "22") {
id
parent {
id
hasParent
}
ancestors {
edges {
node {
id
hasParent
parent {
id
}
}
}
}
}
}
}
If response is something like:
{
"data": {
"group": {
"epic": {
"id": "gid://gitlab/Epic/73",
"parent": {
"id": "gid://gitlab/Epic/72",
"hasParent": true
},
"ancestors": {
"edges": [
{
"node": {
"id": "gid://gitlab/Epic/71",
"hasParent": true
}
},
{
"node": {
"id": "gid://gitlab/Epic/72",
"hasParent": true
}
}
]
}
}
}
}
}
It means there is another ancestor above "gid://gitlab/Epic/71" (but user can't access it).
DB queries
This reuses most of logic introduced in !100012 (merged), only difference is in using different "base epics query" (in this case it loads all epics ancestors - which is maximum 7 epics).
- Getting permissioned groups: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/13103/commands/45918
- Getting list of epic ancestors in permissioned groups: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/13103/commands/45919
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.