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 = 1epic = "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
idbut 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
epicIidas a filterable attribute to groupissuesGraphQL API operation (and possibly finder also) - Add
epicIidas a filterable attribute to projectissuesGraphQL API operation (and possibly finder also) - Alias
epicin GLQL toepicIidwhen supplied with a number or string and target isgraphql(`_components`) - Update semantic analyser to reject queries with
epicbut no scope
Optional:
- Add
epic_iidas a filterable attribute to issue list group and project issue list params - Alias
epicin GLQL toepic_iidwhen supplied with a number or string and target isurl_params
- Add
-
- Support
iidbut require that people include thegroupparameter. 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.