Add duo_auto_mode UI toggle to Duo settings

What does this MR do?

This is the UI layer of Duo auto mode: it adds the frontend toggle and feature-flag plumbing so admins and group owners can control duo_auto_mode_availability. The underlying cascading setting and capability advertisement landed in Add duo_auto_mode cascading setting implementat... (!255441 - merged), now merged into master.

UI toggle

  • Adds ee/app/assets/javascripts/ai/settings/components/duo_auto_mode_settings.vue, a new Vue toggle rendered on two pages: Group Settings > GitLab Duo and Admin Area > Settings > GitLab Duo.
  • Wires the tri-state duo_auto_mode_availability value end to end through ai_common_settings_form.vue, ai_common_settings.vue, the settings pages, and index.js.
  • Matches the cascading-lock behavior of the sibling tool_approval_for_session setting (same lock/inherit semantics at the group level).
  • Pushes the duo_auto_mode frontend feature flag from the Duo configuration controllers, with the actor aligned to backend enforcement:
    • Admin: actor :instance.
    • Group settings: ee/groups_controller.rb and groups/settings/gitlab_duo/configuration_controller.rb use actor @group.root_ancestor.
  • Admin::AiConfigurationPresenter exposes duo_auto_mode_availability only when the duo_auto_mode flag is enabled; when disabled, the key is omitted from the payload.
  • Adds duo_auto_mode_enabled and duo_auto_mode_availability to the admin visible_attributes, plus the corresponding group settings helper wiring.

Feature flag

  • Transitions duo_auto_mode from wip to beta: the definition file moves from config/feature_flags/wip/duo_auto_mode.yml to ee/config/feature_flags/beta/duo_auto_mode.yml, with type: beta and default_enabled: false.
  • Done now because this MR completes the user-facing surface for the flag.
  • Rollout is tracked in [FF] `duo_auto_mode` -- advertise the Duo auto ... (#629172).

Out of scope (lives elsewhere)

How to test

  1. With the setting and flag present on master (from Add duo_auto_mode cascading setting implementat... (!255441 - merged)), enable the duo_auto_mode feature flag for the instance and/or group under test.
  2. Confirm the duo_auto_mode_settings.vue toggle renders on both Group Settings > GitLab Duo and Admin Area > Settings > GitLab Duo.
  3. Toggle duo_auto_mode_availability at the group level and confirm cascading-lock parity with tool_approval_for_session (lock state and inheritance from a parent group behave the same way).
  4. Disable the duo_auto_mode feature flag, then confirm the toggle disappears from both pages and the admin payload from Admin::AiConfigurationPresenter omits duo_auto_mode_availability.

Notes

Closes Auto mode: duo_auto_mode cascading setting, cap... (#618088 - closed)

Edited by Dylan Bernardi

Merge request reports

Loading
Loading