Add GraphQL fields for Note Duo session status
What does this MR do and why?
Adds three new GraphQL fields to the EE NoteType to expose Duo Agent Platform session data for notes:
duoSessionId: ID of the Duo Agent Platform session triggered by the noteduoSessionAgentName: Name of the agent for the Duo session triggered by the noteduoSessionStatus: Status of the Duo Agent Platform session triggered by the note
Also adds the TRIGGERED value to the DuoWorkflowNoteLinkType enum and updates the GraphQL reference documentation and introspection result files accordingly.
This MR is a prerequisite for !249824 (merged), which adds the frontend Note Session Status Bar component that consumes these fields.
References
- Child MR (Note Session Status Bar component): !249824 (merged)
- Related GitLab Work Item: #605132 (closed)
Screenshots or screen recordings
N/A — backend/GraphQL changes only.
How to set up and validate locally
- In a Rails console, query the GraphQL API for a note that has a triggered Duo workflow link:
# Verify the new fields are available on NoteType GitlabSchema.execute('{ __type(name: "Note") { fields { name } } }').to_h - Confirm
duoSessionId,duoSessionAgentName, andduoSessionStatusappear in the field list.
Database Query
Query 1:
SELECT "duo_workflows_workflow_notes".*
FROM "duo_workflows_workflow_notes"
WHERE "duo_workflows_workflow_notes"."link_type" = 2
AND "duo_workflows_workflow_notes"."note_id" IN (1910, 1915, 1925, 2058, 1911)
ORDER BY "duo_workflows_workflow_notes"."id" DESCQuery 2:
SELECT "duo_workflows_workflows".*
FROM "duo_workflows_workflows"
WHERE "duo_workflows_workflows"."id" IN (265, 266, 281, 272, 273)The nested preload also performs batched primary-key lookups on ai_catalog_item_versions, ai_catalog_items, and users when resolving these fields. These queries use WHERE id IN (...) and their respective primary-key indexes.
Query execution plan
Query 1: Populated Database Lab plan and analysis. The clone contains no existing link_type = 2 rows, so the representative plan was generated by temporarily updating five valid workflow-note links inside a transaction and rolling the transaction back. This local Database Lab run does not have a shareable Postgres.ai URL.
Query 2: https://console.postgres.ai/gitlab/projects/gitlab-production-main/sessions/54649/commands/157558
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.