Add GraphQL for linking Duo workflow sessions to notes
What does this MR do and why?
Adds GraphQL support for linking GitLab Duo Agent Platform workflow sessions to notes (both directions):
- Allows fetching all notes for a session (created by session)
- Allows fetching all Sessions from a Note
References
Links to Work Items previously added in !242540 (merged)
Companion MR to add for MRs: !246268 (merged)
Relates to #604024 (closed)
How to set up and validate locally
-
In an MR or Issue, start a developer flow with a comment:
@duo-developer-gitlab-duo - What is the date? -
After the flow completes, get the ID for the note that the session creates. You can find the ID in the note URL (on the date posted), and convert that to a GID in the form:
gid://gitlab/DiscussionNote/11205 -
Run the GraphQL Query to get all Workflows for that Note:
query WorkflowsforNote ($noteId: NoteID!){
note(id: $noteId) {
id
duoWorkflowLinks {
nodes {
linkType
workflow {
id
title
}
}
}
}
}- Confirm the Notes are available from the workflow:
query WorkflowNotes {
duoWorkflowWorkflows(workflowId: "gid://gitlab/Ai::DuoWorkflows::Workflow/4705") {
nodes {
id
noteLinks {
nodes {
linkType
createdAt
note { id body }
}
}
}
}
}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.