Add Duo Code Review DAP services

What does this MR do and why?

This MR introduces two new service classes for Duo Code Review's Duo Agent Platform (DAP) flow:

  • Ai::DuoWorkflows::CodeReview::AvailabilityValidator - Determines whether to use DAP or classic flow based on feature flags, add-on types, and configuration
  • Ai::DuoWorkflows::CodeReview::ReviewMergeRequestService - Handles DAP-based code review workflow execution with error handling and cleanup

Adds a new feature flag, duo_code_review_dap_internal_users, so that internal users could access DCR on DAP even with duo enterprise add-on.

More context: !212477 (comment 2894836099)

How to set up and validate locally

Run the specs:

bundle exec rspec ee/spec/services/ai/duo_workflows/code_review/availability_validator_spec.rb
bundle exec rspec ee/spec/services/ai/duo_workflows/code_review/review_merge_request_service_spec.rb

These services are not yet integrated into the application. Integration will happen in a follow-up MR.

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.

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/579921

Edited by Kinshuk Singh

Merge request reports

Loading