Replace DuoWorkflowAction with assign-based trigger for "Generate MR with Duo" button
What does this MR do?
Replaces the DuoWorkflowAction component on the work item detail page with a new DuoAssignDeveloperButton that uses the assign trigger path instead of directly sending a goal to the workflow.
Previously, the "Generate MR with Duo" button constructed a goal (the work item URL) and passed it directly to the workflow with a hardcoded developer/v1 workflow definition and agent privileges. Now it simply assigns the Duo Developer service account to the work item, which triggers the developer flow through the existing assign event path — the same path used when you manually assign the service account.
This is the frontend counterpart to !231681 (merged) (backend goal template routing). The two MRs are independent and can be merged in any order.
Key changes
| File | Change |
|---|---|
ee/.../duo_assign_developer_button.vue (new) |
Replaces DuoWorkflowAction — assigns the service account instead of sending a goal directly |
ee/.../get_duo_developer_service_account.query.graphql (new) |
Query to discover the service account GID from configured flow triggers |
app/.../work_item_detail.vue |
Swapped DuoWorkflowAction for DuoAssignDeveloperButton, removed agentPrivileges |
What changed in behavior
| Before | After |
|---|---|
Button sent workItem.webUrl as goal directly to developer/v1 workflow |
Button assigns service account → assign trigger fires → goal constructed server-side |
Hardcoded workflow-definition="developer/v1" and agentPrivileges in template |
Discovers service account dynamically via aiCatalogConfiguredItems query |
Button always visible when duoRemoteFlowsAvailability was true |
Button only visible when a flow with an assign trigger and service account is configured |
| Replaced all assignees | Appends service account to existing assignees |
Design decisions
- Separate component (not inlined):
work_item_detail.vueis a CE file. The button depends on EE-only imports (getDuoDeveloperServiceAccountquery,FLOW_TRIGGER_TYPE_ASSIGNconstant), so it must use theee_componentimport pattern - Append vs replace assignees: The mutation appends the service account to existing assignees using a
Setfor deduplication, rather than replacing all assignees - No magic numbers: Uses
FLOW_TRIGGER_TYPE_ASSIGN.valueIntfrom the shared constants instead of hardcoded1
Related: #574990
How to set up and validate locally
Prerequisites
- A Duo Developer trigger configured on a test project with the
developer/v1flow with an assign event type
Test 1: Button visible — happy path
- Go to an issue/work item that has a
developer/v1flow configured with an assign trigger - Verify: The "Generate MR with Duo" button is visible
- Click the button
- Verify: The Duo Developer service account appears in the assignees (existing assignees are preserved)
- Verify: The assign flow triggers automatically
Test 2: Button hidden — no assign trigger
- Edit the flow trigger to only have the mention event type (remove assign)
- Go to the same issue
- Verify: The button is not visible
- Re-add the assign event type and refresh — Verify: The button reappears
Test 3: Button hidden — no flow configured
- Go to an issue in a project with no
developer/v1flow configured - Verify: The button is not visible
Test 4: Existing assignees preserved
- Assign a human user to the issue
- Click the "Generate MR with Duo" button
- Verify: Both the human user and the Duo Developer service account are now assigned