Loading
Offer 7 day and 30 day windows on the AI Governance dashboard
What does this MR do and why?
The AI Governance dashboard's date range control only offered "Last 7 days". This adds a "Last 30 days" option (7 days stays the default).
- Switching the window re-queries the AI agents and AI sessions summary tiles, plus the Developer activity and Project exposure cards.
- The summary tile delta label follows the window: "+N this week" for 7 days, "+N this month" for 30 days.
- Three cards cannot be scoped to a window, so each now carries a footnote naming what it actually shows: AI agent inventory (rankings always based on the last 30 days), Audit logs (most recent sessions, not filtered by date range), MCP servers (current registry, not filtered by date range).
- Frontend only. The
AiGovernanceMetricsTimeframeenum and theaiGovernanceMetrics(timeframe:)argument already existed and are already honoured by both metrics backends, so no backend change was needed. - The enum also accepts
LAST_24_HOURS, and the backend already supports it. The product manager has asked for it, and it is agreed as a stretch goal for the next iteration. It is not in this change because the 24 hour window is bucketed hourly, and the summary tile chart formats every x-axis label as a date, so 25 hourly buckets collapse onto 2 labels. That needs an hourly axis and label format first. - One Apollo cache fix came with it. Passing
timeframeto the developer activity and project exposure queries gives them the sameaiGovernanceMetricscache key as the summary query, so all three write one cache entry with disjoint field sets and the last response replaces the whole object. Without a merge policy, the summary metrics query and the developer activity query both read backnull. Addedmerge: truetype policies forGroup.aiGovernanceMetricsandProject.aiGovernanceMetrics, covered by a new spec,ee/spec/frontend/ai/governance/graphql/cache_config_spec.js. - Behind the existing
ai_governance_dashboardfeature flag. No new flag.
References
- Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/610984
- Design: https://pajamas-prototype-kit-c21410.gitlab.io/#/ai-governance-ga/dashboard
Documentation
The AI Governance dashboard has no user documentation page yet. One is being written as part of the separate beta graduation change, so the date range option will be documented there instead of in this change.
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- The
ai_governance_dashboardflag is already enabled. Open the AI Governance dashboard on the groupcompliance-group-testing-and-demos. - Switch the date range between "Last 7 days" and "Last 30 days".
- Confirm the summary tiles, the Developer activity card and the Project exposure card update, and that the other three cards show their footnotes.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Dheeraj Joshi