[BE] Filter by work item type GID
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
In our mind the only way to reliably filter with internationalized system-defined types and custom types is to use the GID instead of the name.
To make custom types filtering work we also cannot rely on the enum filter type any more because we cannot dynamically create the enum for each group.
Proposal
Use GID for filtering only. Rework the backend and frontend to use GID filtering and the FE should display the (translated) work item type name in the search token instead of the GID.
This will work for system-defined and custom types and is the same strategy we used for custom fields.
The downside of this approach is that we'll need to support the "old" enum based filter in the future. But that should be fine because we can resolve the enum name to the correct system-defined or converted type.
Another downside is that the URL doesn't contain the name of the type anymore and is less readable. But I think that's a valid tradeoff.
Alternatives
Use the name of the custom type and the english name of the system-defined type. This has the downside of a) additional logic to distinguish between system and custom types and b) the URL filter might not work any more when the name of the type changed. That's especially painful if you bookmarked many filters.
GraphQL queries
These are the queries we currently make on the frontend:
// https://gitlab.com/-/graphql-explorer
query {
// work items list (group/project issues list, epics list, consolidated list)
namespace(fullPath:"gitlab-org/gitlab") {
workItems(types:TASK) {
nodes{
id
}
}
}
// issues dashboard
issues(assigneeUsernames:"msaleiko", types:TASK) {
nodes {
id
}
}
// boards
project(fullPath:"gitlab-org/gitlab") {
board(id:"gid://gitlab/Board/7373629"){
lists {
nodes {
title
issues(filters:{types:TASK}) {
nodes {
id
}
}
}
}
}
}
}