Enable filtering by parent epic reference
in GLQL
New Proposal
Support epic
filter that takes in a reference containing project / group / namespace path and an IID in GLQL.
It should work like epic = 'project/path#34'
where project/path
is the project path and #34
is the IID of the object. The parent can be an epic, an issue or an objective. An epic can have other epics and issues as children, an issue can have tasks as its children and an objective can have key results as its children.
Expand old proposal
Currently ( gitlab-query-language%"0.0.5-rc1" ) epic
is not implemented optimally.
Firstly, epic = n
is broken for all uses of numbers (or numbers as strings)
epic = 1
epic = "1"
This is captured in task:
However, the bigger issue is that this expects an id
and not an iid
or reference. id
is rarely exposed to the user, and there is currently no easy way to retrieve it.
Once we release GLQL it's a breaking change to reverse the decision to use epic = id
so we should consider it carefully
iid
is only guaranteed to be unique on the (top-level?) group level, so a query without a group or project specified would be ambiguous.
Proposals
- Continue supporting
id
but expose it to the user in the table or list so they can expose it with an epic wildcard and use it. - Support gid (
gid://gitlab/Epic/2211441
) as an more specific id. This has the benefit of being a String, so it's not a breaking change to change it in future.-
So the steps would look like:
- Add
epicIid
as a filterable attribute to groupissues
GraphQL API operation (and possibly finder also) - Add
epicIid
as a filterable attribute to projectissues
GraphQL API operation (and possibly finder also) - Alias
epic
in GLQL toepicIid
when supplied with a number or string and target isgraphql
(`_components`) - Update semantic analyser to reject queries with
epic
but no scope
Optional:
- Add
epic_iid
as a filterable attribute to issue list group and project issue list params - Alias
epic
in GLQL toepic_iid
when supplied with a number or string and target isurl_params
- Add
-
- Support
iid
but require that people include thegroup
parameter. Requires an update to GraphQL so pushes the timeline out another milestone. Also requires an update to the language to force group and possibly anticipate group from project, if given that scope.