[FF] duo_code_review_clean_identity_start -- start Duo Code Review out of band

Summary

Roll out the feature currently behind the duo_code_review_clean_identity_start feature flag.

Note

Process and guidance live in the docs — this issue is just the commands and a place to track the rollout. "Rolling out" means incrementally enabling the flag on GitLab.com to validate stability — it is not the same as releasing the feature, which happens when the flag is removed. Feature flag controls · Feature flag lifecycle

What could go wrong?

The flag gates transport only. With it off, Duo Code Review starts inline in the requesting request or job, exactly as today. With it on, every review start for the actor project is enqueued to Ai::DuoWorkflows::CodeReview::StartReviewWorker instead.

Blast radius is therefore the full Duo Code Review start path, which is a GA foundational flow, and the risk is Sidekiq rather than the identity logic. Two of the four entry points already run in Sidekiq (EE::MergeRequests::AfterCreateService and EE::MergeRequests::RefreshService), so the change is only observable on the two interactive ones, reviewer assignment through EE::MergeRequests::UpdateService and re-request through MergeRequests::RequestReviewService.

The worker is urgency :low, which targets a one minute queue scheduling budget and five minute execution. :high is not available, because a worker cannot be both high urgency and externally dependent, and this one reaches Duo Workflow Service, Gitaly and CI.

Signals to compare before and after each step, per !249624 (comment 3684008495):

  • Ai::DuoWorkflows::CodeReview::StartReviewWorker failure rate, on the Sidekiq queue detail dashboard for ai_duo_workflows_code_review_start_review.
  • DCR5000 error note counts on merge requests, which should not rise.
  • Enqueue to workflow-created latency, which is the new user-visible gap between requesting a review and the "review session started" note.
  • Queue depth for the new queue, since it concentrates work that was previously spread across web and Sidekiq threads. The worker carries concurrency_limit -> { 100 }.

No data-loss risk. The worker is idempotent, guarded by MergeRequest#duo_code_review_in_flight?, and disabling the flag reverts to the previous behaviour byte for byte.

Rollout

Run all production /chatops in #production and cross-post the results. Background: incremental rollout process, feature actors.

The flag is checked against the merge request's project, so the actor is a project.

Non-production

/chatops gitlab run feature set duo_code_review_clean_identity_start 50 --actors --dev --pre --staging --staging-ref
/chatops gitlab run feature set duo_code_review_clean_identity_start true --dev --pre --staging --staging-ref

Production — start with our own projects, then percentage rollout (wait ≥15 min between steps, watch the signals above):

/chatops gitlab run feature set --project=gitlab-org/gitlab duo_code_review_clean_identity_start true
/chatops gitlab run feature set duo_code_review_clean_identity_start 1 --actors
/chatops gitlab run feature set duo_code_review_clean_identity_start 10 --actors
/chatops gitlab run feature set duo_code_review_clean_identity_start 50 --actors
/chatops gitlab run feature set duo_code_review_clean_identity_start 100 --actors

Before global rollout

Confirm the relevant gotchas before going to 100% — see enabling a feature for GitLab.com:

Cleanup

Remove the flag once deemed stable — see cleaning up. Remove the flag and its YAML definition from the codebase, then:

/chatops gitlab run release check <merge-request-url> <milestone>
/chatops gitlab run feature delete duo_code_review_clean_identity_start --dev --pre --staging --staging-ref --production

Rollback

/chatops gitlab run feature set duo_code_review_clean_identity_start false                                         # production
/chatops gitlab run feature set duo_code_review_clean_identity_start false --dev --pre --staging --staging-ref     # non-production
/chatops gitlab run feature delete duo_code_review_clean_identity_start --dev --pre --staging --staging-ref --production  # remove entirely