Loading
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_availabilityvalue end to end throughai_common_settings_form.vue,ai_common_settings.vue, the settings pages, andindex.js. - Matches the cascading-lock behavior of the sibling
tool_approval_for_sessionsetting (same lock/inherit semantics at the group level). - Pushes the
duo_auto_modefrontend feature flag from the Duo configuration controllers, with the actor aligned to backend enforcement:- Admin: actor
:instance. - Group settings:
ee/groups_controller.rbandgroups/settings/gitlab_duo/configuration_controller.rbuse actor@group.root_ancestor.
- Admin: actor
Admin::AiConfigurationPresenterexposesduo_auto_mode_availabilityonly when theduo_auto_modeflag is enabled; when disabled, the key is omitted from the payload.- Adds
duo_auto_mode_enabledandduo_auto_mode_availabilityto the adminvisible_attributes, plus the corresponding group settings helper wiring.
Feature flag
- Transitions
duo_auto_modefromwiptobeta: the definition file moves fromconfig/feature_flags/wip/duo_auto_mode.ymltoee/config/feature_flags/beta/duo_auto_mode.yml, withtype: betaanddefault_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)
- The cascading
duo_auto_mode_enabledsetting itself, its columns/migrations, and capability advertisement (Ai::FlowsMetadataService,compute_server_capabilities) landed in Add duo_auto_mode cascading setting implementat... (!255441 - merged) (plus its split-1 migration MR), now merged intomaster. - Governance relaxation for local surfaces (
Ai::ToolRules::Permissions.local_effective,ResolutionService#local_surface?,read_only_filesask to allow) is part of the governance-surface re-key work, Auto mode: re-key GovernanceSurface + privilege... (#618761), which is stacked on top of this branch. None of that code is in this MR.
How to test
- With the setting and flag present on
master(from Add duo_auto_mode cascading setting implementat... (!255441 - merged)), enable theduo_auto_modefeature flag for the instance and/or group under test. - Confirm the
duo_auto_mode_settings.vuetoggle renders on both Group Settings > GitLab Duo and Admin Area > Settings > GitLab Duo. - Toggle
duo_auto_mode_availabilityat the group level and confirm cascading-lock parity withtool_approval_for_session(lock state and inheritance from a parent group behave the same way). - Disable the
duo_auto_modefeature flag, then confirm the toggle disappears from both pages and the admin payload fromAdmin::AiConfigurationPresenteromitsduo_auto_mode_availability.
Notes
- Milestone: %19.5.
- Epic: [Auto Mode] Iteration 0: Client-side enabled au... (&23199 - closed).
- Spec coverage:
duo_auto_mode_settings_spec.js,ai_common_settings_form_spec.js,ai_common_settings_spec.js, theAdmin::AiConfigurationPresenterspec, the group settings helper spec, the admin Duo configuration request spec (asserts the pushed flag on/off and the presenter key gating), and the group settings request spec (ee/spec/requests/groups_controller_spec.rb, asserts the pushed flag on/off across the group hierarchy). - Stack: the setting and flag landed in Add duo_auto_mode cascading setting implementat... (!255441 - merged) (merged into
master); the governance re-key (Auto mode: re-key GovernanceSurface + privilege... (#618761)) is stacked on top of this branch.
Closes Auto mode: duo_auto_mode cascading setting, cap... (#618088 - closed)
Edited by Dylan Bernardi