Read the audit trail card from aiGovernanceSessions behind a flag
What does this MR do and why?
The AI Governance dashboard is moving from Duo workflow data to the new ai_governance_sessions table (#630706+s). This MR updates the "Most recent sessions" (audit trail) card to read from the new aiGovernanceSessions GraphQL field behind a shared flag, keeping today's behaviour when the flag is off.
- Behind the flag, the card queries
aiGovernanceSessionsfor the group or project instead ofduoWorkflowSessionArtifacts. - Row titles show the session id (
sessionId) and flow type. Sessions from external agents have no flow type, so the source name is shown instead (GitLab Duo, Claude Code (Compliance API), Claude Code (glab)). - Each row shows its source label.
- Row links open the audit events tab. Duo rows pass their workflow id (
sessionId), which is what the tab's drawer matches today. External rows link to the tab without a session, since the drawer cannot show them until #630785+s lands. - The new type has no
auditEventsCountyet (#630095+s), so rows show the source label in that spot until the count lands. - Adds two query files under
ee/app/assets/javascripts/ai/governance/graphql/queries, aSESSION_SOURCE_LABELSconstant, and pushes the flag from both governance controllers.
Feature flag
Frontend and backend share one flag, ai_governance_sessions_api (#630933+s). It is off by default, so the card keeps using duoWorkflowSessionArtifacts until the flag is enabled. The flag definition comes from Add aiGovernanceSessions GraphQL field (!257545 - merged), which is merged.
Open question
When #630785+s moves the audit events tab to aiGovernanceSessions, the drawer will match the session row id instead of the workflow id, and the link parameter here moves with it. Both are behind the same flag; the two MRs should land close together.
Depends on
- Built on Add aiGovernanceSessions GraphQL field (!257545 - merged), which adds the
aiGovernanceSessionsGraphQL field, and its ClickHouse finder Add ClickHouse finder for AI governance sessions (!258121 - merged). Both are merged, so this MR now targetsmaster. - No changelog entry: behind a disabled flag.
Screenshots
Captured against Add aiGovernanceSessions GraphQL field (!257545 - merged) • Hitesh Raghuvanshi • 19.5 with the flag on. Group and project names are masked.
| Card, flag on | Duo row click (drawer opens) | Claude Code row click (tab, no drawer) |
|---|---|---|
![]() |
![]() |
![]() |
How to validate
ee/spec/frontend/ai/governance/components/dashboard/cards/audit_trail_card_spec.js, extended with four flag-on cases. The flag is off by default.


