Add scheduled automations setting to Projects

What does this MR do and why?

Part of #634139. MR 5/6.

Groups and the instance can turn scheduled automations off, but a project could only inherit the value. A project owner had no way to stop schedules for their own project while leaving the rest of the group alone.

This MR adds an Allow scheduled automations toggle to the project Duo readiness card, nested under flow execution with the same cascading lock treatment as its neighbours.

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-project-settings

2. In Rails console (set up):

Feature.enable(:ai_flow_schedules)
Feature.enable(:autonomous_service_account_execution)
  • Use a group with 2 projects to verify that the project level setting affects one and not the other
# Start from a clean inherited state in case you have leftover state from previous reviews
group_id = <group id>
NamespaceSetting.where(namespace_id: Group.find(group_id).self_and_descendant_ids)
                .update_all(duo_scheduled_triggers_enabled: nil,
                            lock_duo_scheduled_triggers_enabled: false)
ProjectSetting.where(project_id: Group.find(group_id).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. (GDK UI): Switching off makes scheduled automation unavailable in the project

  • Go the project's Settings > General > GitLab Duo or http://172.16.123.1:3000/test-status-bot-e63fd58e/test/edit#js-gitlab-duo-settings
  • You should see the "Allow scheduled automations setting on by default
  • Turn it off and save changes
  • Go to Automate > Triggers
  • Create a trigger with the Schedule event type and try to save
  • Verify: save is rejected with event_types: scheduled events are turned off
  • Turn the project setting back on
  • Create a trigger with the Schedule event type again and save
  • Verify: trigger creation is successful

4. (GDK UI): The setting only affects its project and not another one

  • Switch off "Allow scheduled automations" in project 1
  • Open the second project in your group.
  • Verify: the second project's "Allow scheduled automations" is still on and editable
  • Following the steps in step 3 above, try to create a trigger in project 2 while the setting is switched off in project 1
  • Verify: trigger creation is successful in project 2

5. (GDK UI): A group/ancestor lock disables the project setting regardless of its setting

  • Go to the project's parent group or instance level
  • Go to Settings > General > GitLab Duo features > Flows or http://172.16.123.1:3000/groups/test-status-bot-e63fd58e/-/edit#js-gitlab-duo-settings
  • Turn scheduled triggers off in the group
  • Back on the project settings page
    • Verify: the toggle is off and greyed out with a padlock icon. Hover the icon and you should see the notification: Setting cannot be changed This setting has been enforced by an owner of <group-name>.

6. (GDK UI): Trigger list with the "not running" badge in the old UI

  • Go to the project http://172.16.123.1:3000/test-status-bot-e63fd58e/test/-/automate/triggers/
  • With the setting off: the scheduled automation's row shows a warning Not running badge, next to the schedule summary. Hovering it reads "Scheduled runs are turned off in GitLab Duo settings. This schedule is kept but does not run."
    • The row's active toggle stays on since the schedule is still active and still has a next run time; the badge is what tells you it won't fire.
  • The non-scheduled trigger must show no badge.
  • Turn the setting back on and reload: the badge disappears the scheduled automation.

7. (GDK UI): Trigger list with the "not running" badge in the new "Automations UI"

  • Enable the feature flag in rails console: Feature.enable(:duo_automations)
  • Reload the triggers page.
  • Repeat step 4 and the badge appears in the same way beside the schedule summary, in the card view beside the event tokens.
  • Disable the feature flag: Feature.disable(:duo_automations)

8. (GDK UI): The allow scheduled trigger setting depends on flow execution setting

  • Go to the project's setting
  • Turn "Allow flow execution" off on the project and save
  • Verify: the "Allow scheduled automations" setting is now blocked and its toggle disabled
  • Turn "Allow flow execution" back on on the project and save. The scheduled trigger
  • Verify: the "Allow scheduled automations" setting sis now unblocked and toggeable again.

9. (GDK UI) The allow scheduled trigger depends on the Duo Agent Platform parent switch:

  • At the instance level: Admin > GitLab Duo > Configuration > Flows or http://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 and disabled in the project along with its sibling: "Allow foundational flows".

MR Stack

  1. Add duo_scheduled_triggers_enabled cascading se... (!264600 - merged)
  2. Enforce the scheduled triggers setting (!265174 - merged)
  3. Add the scheduled automations setting to the Du... (!265569 - merged)
  4. Show when scheduled runs are turned off and blo... (!265545 - merged)
  5. This MR
  6. Exposes duo_scheduled_triggers_enabled in the p... (!267069)

References

Screenshots or screen recordings

Setting on Setting off Locked by group
Project Duo settings Screenshot_2026-10-29_at_14.02.21 Screenshot_2026-10-29_at_14.02.14 Screenshot_2026-10-29_at_14.03.01
**Scheduled Trigger Creation / Edit ** Screenshot_2026-10-29_at_14.05.48 Screenshot_2026-10-29_at_14.06.24
Trigger list (step 6 and 7) Screenshot_2026-10-29_at_14.10.18 Screenshot_2026-10-29_at_14.06.36

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 Shola Quadri

Merge request reports

Loading
Loading