Add the scheduled automations setting to the Duo settings forms
What does this MR do and why?
Part of #634139 and MR 3 of 6.
This MR adds an Allow scheduled automations checkbox to the group and instance Duo configuration forms, and a matching row to the group readiness card so the control survives the duo_group_agent_readiness_settings flag.
Depends on !265174 (merged), which enforces the setting.
Expected Behaviour
How to set up and validate locally
Prerequisites
- Duo Enterprise enabled
- GDK running with all services up
- Self Managed Local Instance
1. Checkout this branch: 634139/sq/scheduled-triggers-group-settings
2. In Rails console (set up)
# Enable FFs
Feature.enable(:ai_flow_schedules)
Feature.enable(:autonomous_service_account_execution)
# Get a root group with a subgroup and at least one project in each to verify cascading behaviour
GROUP = Group.find(1000000) # or root group ID
# Clear stale objects
Gitlab::CurrentSettings.expire_current_application_settings
# Update settings
NamespaceSetting.where(namespace_id: Group.find(GROUP).self_and_descendant_ids)
.update_all(duo_scheduled_triggers_enabled: nil,
lock_duo_scheduled_triggers_enabled: false)
ProjectSetting.where(project_id: Group.find(GROUP).all_projects.select(:id))
.update_all(duo_scheduled_triggers_enabled: nil)
ApplicationSetting.current.update!(duo_scheduled_triggers_enabled: true,
lock_duo_scheduled_triggers_enabled: false)3. Confirm checkbox persists in the group form (GDK UI):
- Go to
Settings>General>GitLab Duo features>Flowsorhttp://172.16.123.1:3000/groups/test-status-bot-e63fd58e/-/edit#js-gitlab-duo-settings - You should see "Allow scheduled automations with a default checked and help text.
- Uncheck the setting and
Save changes. - Reload the page.
- Verify: it remains unchecked
4. Setting cascades to every descendant group (GDK UI):
- With the root group unchecked in step 3, open a subgroup's Duo configuration page. E.g.:
http://172.16.123.1:3000/groups/test-status-bot-e63fd58e/nested-test-group/-/edit#js-gitlab-duo-settings - Verify: "Allow scheduled automations is unchecked and greyed out. Hovering the padlock names the ancestor group that locked it
- Repeat for nested subgroups and should look identical
- Re-check the box on the root group and save.
- Verify: all subgroups now shows it checked and editable again.
5. Confirm settings work at instance level (GDK UI):
- Go instance admin level settings:
Admin>GitLab Duo>Configuration>Flowsorhttp://172.16.123.1:3000/admin/gitlab_duo/configuration - You should see "Allow scheduled automations with a default checked and help text.
- Uncheck the box and
Save changes - With the instance level unchecked, open a top-level group or any of the sub-groups
- Verify: "Allow scheduled automations is unchecked and greyed out. Hovering the padlock names the ancestor group that locked it
- Re-check the box on the instance and save.
- Verify: all groups and subgroups now shows it checked and editable again.
6. Confirm Duo Agent Platform parent switch (GDK UI):
- At the instance level:
Admin>GitLab Duo>Configuration>Flowsorhttp://172.16.123.1:3000/admin/gitlab_duo/configuration>GitLab Duo Agent Platform - Turn Duo Agent Platform off and save
- Reload the page
- Verify: "Allow scheduled automations is unchecked disabled along with its siblings: flow execution, foundation flows, custom agents, custom flows and external agents.
8. The setting depends on flow execution setting (GDK UI):
- In one of the groups, uncheck/disable "Allow flow execution"
- Verify: the scheduled checkbox greys out along its siblings and hovering its shows "This setting only applies when flow execution is on."
9. The setting blocks scheduled triggers creation when "Allow scheduled trigger" is unchecked/off (GDK UI)
- Uncheck "Allow scheduled automations" in a parent group
- Go to the trigger page of a project under your group, for example:
http://172.16.123.1:3000/test-status-bot-e63fd58e/test/-/automate/triggers/ - Create a trigger with the Schedule event type > Select
Developerflow and schedule cadence Save- Verify: Trigger creation is blocked with a message:
Event types scheduled events are turned off
10. The setting blocks adding scheduled to an existing trigger when "Allow scheduled trigger" is unchecked/off (GDK UI)
- Select and edit an existing trigger with another event type like
mention - Remove the
mentionevent type and instead addOn a schedulecondition with schedule cadence Save- Verify: Trigger edit is blocked with a message:
Event types scheduled events are turned off
11. Existing schedule triggers stays editable (GDK UI) - without this, turning the setting off would make existing scheduled automations unsaveable.
- Edit an existing schedule trigger and change any of its fields, e.g. description, frequency or removes the event type.
- Verify: It saves cleanly
- Re-add a schedule event type afterwards on the trigger. Verify: it fails since it's now newly added
12. The API mutation errors when the setting is off:
In rails
# get the last flow trigger ID
Ai::FlowTrigger.lastIn GraphQL: http://172.16.123.1:3000/-/graphql-explorer
mutation {
aiFlowScheduleCreate(input: {
flowTriggerId: "gid://gitlab/Ai::FlowTrigger/<trigger_id>"
description: "verification schedule"
cron: "0 * * * *"
cronTimezone: "UTC"
}) {
aiFlowSchedule { id description cron active }
errors
}
}Expect error: "Scheduled triggers are turned off for this project"
13. Confirm the setting exists in the new readiness card UI:
group = Group.find(1000000)
Feature.enable(:duo_group_agent_readiness_settings,group)- Reload your group page.
- The flows card switches to readiness rows; a Scheduled triggers row with a toggle sits between Foundational flows and Custom flows, and saves the same way.
Screenshots or screen recordings
1. Admin Setting (On)
2. Group setting when Scheduled automations are switched off at the admin level
3. Group level setting (Off)
4. Setting in the readiness card (Verification step 13)
Notes for reviewers
This MR also includes two small UI cleanup changes that are not part of the scheduled automations setting itself:
- The foundational flows picker now renders only when there are foundational flows to show. This fixes a pre-existing empty wrapper/spacing issue in the flows settings form.
- The
injectdeclarations in the Vue components were changed to object form so the new scheduled automations setting can provide defaults consistently with the existing cascading settings.
It also adjusts the lock icon positioning in the flows settings form. That change is intentional for this form, but duo_custom_agents_and_flows_settings.vue still uses the older lock icon classes, so the two forms may not be visually identical until that file is aligned separately (tracked here).
MR Stack
- Add duo_scheduled_triggers_enabled cascading se... (!264600 - merged)
- Enforce the scheduled triggers setting (!265174 - merged)
- This MR
- Show when scheduled runs are turned off and blo... (!265545 - merged)
- Add scheduled automations setting to Projects (!266298 - merged)
- Exposes duo_scheduled_triggers_enabled in the p... (!267069)
References
| Before | After |
|---|---|
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.



