Fix incorrect flow/agent settings when DAP is disabled

What does this MR do and why?

Fixes #597245 (closed).

When DAP is disabled, its child settings (remote flows, foundational flows, foundational agents) are visually disabled in the UI but their form state remained stale. This meant saving the form would persist the incorrect true values downstream.

Changes:

  • ai_common_settings_form.vue: When DAP is toggled off, child form state (flowEnabled, foundationalFlowsEnabled, foundationalAgentsEnabledInput) is now cascaded to false and the corresponding change events are emitted so page-level handlers stay in sync.
  • duo_foundational_agents_settings.vue: Renamed props enabledfoundationalAgentsEnabled and disabledreadOnly for clarity. Also ensured the foundational agents radio group is disabled when DAP is disabled.

References

Incorrect Foundational Agents and Flows Setting... (#597245 - closed)

Screenshots or screen recordings

SM SaaS

How to set up and validate locally

SM:

  • GITLAB_SIMULATE_SAAS=0 gdk start
  • Go to instance-level Duo settings: /admin/gitlab_duo/configuration
  • Disable DAP. Observe flow and agent settings are read-only.
  • Save changes. Go back to Duo settings page. Observe flow and agent settings values are false.
  • Go to Duo settings at top-level group, subgroup, and project level. Observe that only flow settings are visible and are locked.
  • Re-enable DAP and agent/flow settings.
  • Go to Duo settings at top-level group, subgroup, and project level. Observe that only flow settings are visible and are not locked.

SaaS:

  • Ensure DAP is enabled at the instance-level before switching to SaaS mode.
  • Run GITLAB_SIMULATE_SAAS=1 gdk start
  • Go to Duo settings at top-level group (groups/gitlab-duo/-/settings/gitlab_duo/configuration)
  • Disable DAP. Observe flow and agent settings are read-only.
  • Save changes. Go back to Duo settings page. Observe flow and agent settings values are false.
  • Go to Duo settings at subgroup and project level. Observe that only flow settings are visible and are locked.
  • Re-enable DAP and agent/flow settings.
  • Go to Duo settings at subgroup and project level. Observe that only flow settings are visible and are not locked.

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 Cindy Halim

Merge request reports

Loading