[go: up one dir, main page]

Add duo_foundational_flows_enabled checks for duo code review DAP flow

What does this MR do and why?

This MR adds duo_foundational_flows_enabled as a required condition for Duo Code Review to be available via the Duo Agent Platform (DAP) flow.

Background: Duo Code Review can operate through two flows:

  • Classic flow (Duo Enterprise): Always available when the add-on is active, regardless of feature flags
  • DAP flow (Duo Pro/Core): Requires multiple conditions to be met

This change adds duo_foundational_flows_enabled as a prerequisite for the DAP flow, ensuring that the foundational flows infrastructure is properly enabled before allowing Duo Pro/Core customers to use Code Review features.

How to set up and validate locally

  1. Verify Duo Enterprise still works (unaffected by new setting):
   ApplicationSetting.current.update!(duo_features_enabled: true, duo_foundational_flows_enabled: false)
   # Add Duo Enterprise add-on: GITLAB_SIMULATE_SAAS=1 bundle exec 'rake gitlab:duo:setup' 
   ApplicationSetting.current.auto_duo_code_review_settings_available? # => true
  1. Verify Duo Core blocked when duo_foundational_flows_enabled = false:
   ApplicationSetting.current.update!(duo_foundational_flows_enabled: false, instance_level_ai_beta_features_enabled: true)
   Feature.enable(:duo_code_review_on_agent_platform)
   # Add Duo Core add-on: GITLAB_SIMULATE_SAAS=1 bundle exec 'rake gitlab:duo:setup[core]'
   ApplicationSetting.current.auto_duo_code_review_settings_available? # => false
  1. Verify Duo Core works when duo_foundational_flows_enabled = true:
   ApplicationSetting.current.update!(duo_foundational_flows_enabled: true)
   ApplicationSetting.current.auto_duo_code_review_settings_available? # => true
  1. Verify project-level override works:
   # Namespace enabled, project disabled
   group.namespace_settings.update!(duo_foundational_flows_enabled: true)
   project.project_setting.update!(duo_foundational_flows_enabled: false)
   project.auto_duo_code_review_settings_available? # => false

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 Integrate Duo Code Review into Duo Agent Platform (&18645)

Edited by Kinshuk Singh

Merge request reports

Loading