Chart cumulative trend on the AI Governance KPI tiles

Dependency

Stacked on Add cumulative trend to AI governance KPIs (!251201 - merged), which adds the cumulativeTrend field, and targets its branch directly. That MR is the real dependency: without the field this query does not validate. Retarget to master once !251201 (merged) merges.

There is no file overlap with !251201 (merged) (it is backend only), so this stays a clean 3-file frontend diff.

What and why

The KPI sparklines charted trend, the count of new items per bucket. That dips to zero on quiet days, and for agents it is not summable at all (an agent active on 3 days is counted 3 times). Per #616814 the tiles should show a running level instead.

Changes

  • get_ai_governance_metrics.query.graphql: request cumulativeTrend { bucketStart count } on both KPIs, for the group and project paths.
  • dashboard_app.vue: chartData prefers cumulativeTrend, falling back to trend when it is absent or empty, so the tile still renders against a schema without the field.

Screenshots

Same demo data, same seven day window. The only change is which series feeds the sparkline.

Before: per-bucket trend

After: cumulativeTrend

before-agents.png

before-sessions.png

after-agents.png

after-sessions.png

The difference is clearest on the agents tile: the per-bucket series dips when an agent is simply idle for a day, implying agents disappeared, while the running total steps up and holds.

/cc @andrew.jung

Tests

ee/spec/frontend/ai/governance/components/dashboard is green, 71 examples. Two new cases: charts cumulativeTrend in preference to trend, and falls back to trend when cumulativeTrend comes back empty.

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Dheeraj Joshi

Merge request reports

Loading
Loading