Update flows agent tracking to consumer service account
What does this MR do and why?
This MR is part 4 (of 4) of the solution that addresses #584271 (closed).
This MR updates flows agent tracking to consumer service account. It also fixes the regression that broke the tracking functionality when consumer service accounts were implemented.
- Part 1 MR: Adds Service Account ID column to duo_workflows... (!220828 - merged)
- Part 2 MR: Backfills service account id on duo_workflows_w... (!221894 - merged)
- Part 3 MR: Updates codepaths so new rows in duo_workflows_... (!222090 - merged)
- Part 4 MR (feature implementation draft): <--- this MR
How to set up and validate locally
Prequisites
- An active Ultimate license.
- Duo Enterprise subscription configured:
bundle exec 'rake gitlab:duo:setup[duo_enterprise]' -
Remote Flowsconfigured locally. Follow these steps to set up and configure.
Once the correct license and Remote Flows have been set up locally, follow the validation steps below.
Validation Steps
-
Navigate to an issue in the UI: for example
http://gdk.test:3000/gitlab-duo/test/-/issuesand select any of the issue -
Test agent started note:
- Click
Generate MR with Duobutton to trigger theissue_to_merge_requestworkflow - Verify a system note appears in the Issue timeline: "Duo Developer started session [ID][session_link] triggered by [User][user_profile_link] 1 hour ago"
- Click
-
Test agent completed note:
- Wait for the workflow from step 2 to complete successfully
- Verify a system note appears in the Issue timeline: "Duo Developer completed session [ID][session_link] 1 hour ago"
-
Test agent failed note:
- Trigger another
issue_to_merge_requestworkflow by clicking theGenerate MR with Duobutton - Click the session ID to navigate to sessions page
- Cancel the workflow job manually -- this is accessible via the
Executor ID - Return to the issue and verify a system note appears: "Duo Developer session ID failed (dropped) 1 hour ago"
- Trigger another
Expected Results
- All three system notes should appear in the issue timeline with:
- Clickable links to the agent and agent session details
- Appropriate trigger source or failure reason
- Correct timestamps
Screenshots
| Note Type | Before | After |
|---|---|---|
| Session Started & Completed |
![]() |
![]() |
| Session Started & Failed |
![]() |
![]() |
References
- Implement agent activity tracking in work item ... (#570291 - closed)
- Implements issue_mr_flow agent tracking (!212776 - merged)
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.
Edited by Shola Quadri



