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.

  1. Part 1 MR: Adds Service Account ID column to duo_workflows... (!220828 - merged)
  2. Part 2 MR: Backfills service account id on duo_workflows_w... (!221894 - merged)
  3. Part 3 MR: Updates codepaths so new rows in duo_workflows_... (!222090 - merged)
  4. 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 Flows configured 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

  1. Navigate to an issue in the UI: for example http://gdk.test:3000/gitlab-duo/test/-/issues and select any of the issue
  2. Test agent started note:
    • Click Generate MR with Duo button to trigger the issue_to_merge_request workflow
    • 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"
  3. 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"
  4. Test agent failed note:
    • Trigger another issue_to_merge_request workflow by clicking the Generate MR with Duo button
    • 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"

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 Screenshot_2026-03-09_at_15.33.26 Screenshot_2026-03-09_at_15.27.17
Session Started & Failed Screenshot_2026-03-09_at_15.33.36 Screenshot_2026-03-09_at_15.28.13

References

  1. Implement agent activity tracking in work item ... (#570291 - closed)
  2. 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

Merge request reports

Loading