Expose restartDuoWorkflow on the Duo workflow permission type
What does this MR do and why?
Adds the existing restartDuoWorkflow to the DuoWorkflowPermissions GraphQL type, with no behaviour change
- The permission depends on rules the frontend can't evaluate - workflow ownership, chat type, and project level, so it should be resolved on the backend
- This matches how the existing cancel action already works, since it also relies on a GraphQL permission (
updateDuoWorkflow) on the same type to drive its enabled state
References
- Related to FE: Add retry button to sessions view when a se... (#598746 - closed) • Allison Villa • 19.6 • On track
- Related frontend MR: !257412 (merged)
Screenshots or screen recordings
No UI changes
How to set up and validate locally
-
Get a Duo Agent Platform session in a
stoppedstate. ex. Run any flow in a project, then cancel it from the session details page -
Find the workflow id, either from the session page URL or in the Rails console with
Ai::DuoWorkflows::Workflow.last.id. Openhttp://gdk.test:3000/-/graphql-explorerand run:query { duoWorkflowWorkflows(workflowId: "gid://gitlab/Ai::DuoWorkflows::Workflow/<ID>") { edges { node { id status userPermissions { restartDuoWorkflow } } } } } -
Confirm
restartDuoWorkflowreturnstruefor yourstoppedorfailedsession. As a negative check, run the same query against arunningorfinishedsession and confirm it returnsfalse.
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.