Resolve dashboard test ownership through category_owners
The four CI health and coverage dashboards resolved a test file's owner from the section, stage and group stamped on each row of shared.test_file_mappings. Those record who owned the category when the row was written, so they go stale after a reorg, and the exporter is about to stop writing them.
Two read anyLast(group), which picks arbitrarily when a test has several: the same query resolved anywhere from 12,526 to 19,114 of 23,278 test files depending only on how ClickHouse chose to execute it. The other two filter on the columns directly, across seven sites.
All four now resolve through the test's feature category against category_owners. The filters use a semi-join rather than a real join, because two sites use PREWHERE, which cannot reference one. sql.libsonnet gains responsibleGroupCte and ownershipFilters so the logic lives once, plus a tiebreak so it matches how the gem resolves owners.
Expect visible changes: attribution becomes deterministic where it was arbitrary, and filtering by section dev matches 19.3M rows rather than 23.8M, the difference being rows whose category has since moved.
Related: gitlab-org/quality/analytics/team#789 (closed)
Verification
Live copies of all four dashboards, querying production:
- https://dashboards.gitlab.net/d/rchong-verify-ci-health-incidents
- https://dashboards.gitlab.net/d/rchong-verify-ci-health-incident-detail
- https://dashboards.gitlab.net/d/rchong-verify-code-coverage-actionables
- https://dashboards.gitlab.net/d/rchong-verify-code-coverage-health-check
On the first, compare responsible_group against production https://dashboards.gitlab.net/d/dx-ci-health-incidents over the same 90-day range: around 13 of 120 incidents differ. On the other two, exercise the section, stage and group pickers, which is the path that changes.
I rendered every dashboard with jsonnet and ran the resulting SQL against production, including a PREWHERE site to confirm the subquery is accepted there. Owner resolution returns 20,048 of 23,278 test files, identically across eight execution-setting perturbations. jsonnetfmt --test passes on all five files.
Delete the four playground copies once this merges.