Make model a filterable query field on the DuoWorkflows source
Problem
model can be used as a GLQL dimension on the DuoWorkflows source today, but not as a filter. Using it in a filter fails with:
Error: `model` is not a recognized field for Duo workflows. Valid fields: created, flowType, status, user, flowTypesUsed, activeDays.This blocks any query that wants to scope results to a specific model rather than just group by it.
Proposal
This needs two coordinated changes:
- gitlab-org/glql: add
modelas a recognized query field for the DuoWorkflows source (themodeldimension itself shipped via !511 (merged)). - gitlab-org/gitlab: add
exact_match :model_used, :stringto thefilters doblock inee/app/models/analytics/aggregation_engines/duo_workflows.rb.
Delivery chain
The glql compiler reaches the monolith as the @gitlab/query-language-rust npm package, currently pinned at 0.39.0 in package.json. The glql change needs a release of that package, followed by a version-bump MR in gitlab-org/gitlab. Both changes have to land before model filtering works end to end.
Performance note
model_used is not part of the ClickHouse table's sort key (ORDER BY (traversal_path, created_at, id) in db/click_house/main.sql). A filter on model_used will scan within the existing scope/date-range filter rather than prune via the sort key. At current cardinality this is fine, but worth knowing if usage grows.
What this unblocks
This resolves the TODO already sitting in dap_impact.yaml (lines 1111-1112):
Totals all credits for now; narrows to model-attributed credits once modelUsed is filterable, which is when this and the Credits tile diverge.
This issue is independent of issues 1-3 and can be worked in parallel with them.