Align DAP Duo Code Review with standard DAP identity and setup patterns

Background

As part of implementing the routing logic for Duo Code Review between legacy and DAP versions (see #579921), we have an opportunity to align DAP Duo Code Review with how the rest of DAP works, specifically regarding identity and setup patterns.

Suggestions from #579921

Based on the discussion in https://gitlab.com/gitlab-org/gitlab/-/issues/579921#note_2880464424, we should consider aligning DAP Duo Code Review with standard DAP patterns:

1. Use DAP Service Account for Identity

Current state: Uses @GitLabDuo bot account for triggering and posting comments

Proposed change: Use a DAP service account (e.g., @duo-code-review) that gets created the same way as for any other flow in accordance with &19478

2. Add Default Trigger as Part of Normal DAP Setup

Proposed change: Add the default trigger of "assign-to-review" as part of the normal DAP setup for the Code Review flow, similar to how we'll add assign to issue for issue to MR in #568031 (closed)

Benefits

  1. Clearer differentiation between "old" DCR and the new DAP version
  2. Code reduction - allows getting rid of more custom code once old DCR gets removed
  3. Consistency with other DAP flows and foundational patterns
  4. Alignment with ongoing foundational flows development in &19897

Considerations

  • User experience impact: Customers are used to using @GitLabDuo, so this would require some sort of deprecation notice (e.g., @GitLabDuo (deprecated))
  • Timeline: Should only be considered if we have time until 18.7, as foundational flows development is still ongoing
  • Dependencies: Depends on foundational flows and agent identity work in &19897

Implementation Notes

From the discussion:

  • The foundational flows setup should provide the SA (Service Account) instead of using a separate bot account
  • This aligns with the broader DAP identity strategy
  • Development for foundational flows and agent identity is happening in &19897
  • Parent issue: #579921 (Duo Code Review Available on DAP for Core/Pro users)
  • Related epic: &19478 (DAP identity)
  • Related epic: &19897 (foundational flows)
  • Related issue: #568031 (closed) (assign to issue for issue to MR)
Edited by 🤖 GitLab Bot 🤖