Add monthly cadence to scan execution rule mode

What does this MR do and why?

Scan execution policy schedules could only be set to a daily or weekly cadence in rule mode, even though the backend already accepts monthly cron cadences (for example 0 0 1 * *) and the docs document monthly scheduling. Users who wanted a monthly schedule had to drop to YAML mode.

This MR adds Monthly as a selectable cadence in the scan execution policy rule-mode schedule builder, with a multi-select Days of month control (1-31) that generates cadences like 0 9 1,15 * *, mirroring the pipeline execution schedule policy editor.

It also closes a latent correctness gap: a monthly cron opened in rule mode was mis-classified as daily and silently narrowed on edit. Cadences that rule mode cannot represent exactly (ranges, steps, minute offsets) now route to YAML mode by disabling the rule section, instead of being silently rewritten. That hand-off gets its own message - "Schedule not editable in rule mode" - rather than reusing the generic "Invalid syntax" alert, which would have told users to fix YAML that is valid and still running.

This is a frontend-only change. No backend, GraphQL, database, or feature-flag changes are needed.

References

Screenshots or screen recordings

Recording of the full flow (3x speed): switch to Custom, change the condition to a schedule, pick monthly, then select days 1 and 15 - the cadence in the .yaml preview follows along to 0 0 1,15 * *, and the label pluralizes to "days of the month".

Scenario Before After
Drop down Rule mode offers only Daily and Weekly Rule mode offers Daily, Weekly, and Monthly with a days-of-month selector day
Day selection - multiple_day multi_day_yaml
Monthly schedule in rule mode - 01-monthly-rule-mode
Cadence rule mode cannot display Generic "Invalid syntax" alert telling the user to fix valid YAML 05-unsupported-cadence-new-copy

Visual verification

Verified against a local GDK at /groups/flightjs/-/security/policies/new?type=scan_execution_policy, with 0 console errors attributable to the change:

  • Period dropdown offers daily / weekly / monthly.
  • Selecting monthly defaults to day 1 and the singular "day of the month" (0 0 1 * *).
  • Selecting days 1, 15, 28 produces 0 0 1,15,28 * * and the plural "days of the month"; changing the hour to 09:00 produces 0 9 1,15,28 * *.
  • Round trip: a policy with 0 9 1,15 * * opens in rule mode as monthly, days "1, 15", 09:00.
  • Daily and weekly are unchanged (0 0 * * * and 0 0 * * 0).
  • 0 0 */2 * *, 30 9 1 * *, and 0 9 1-5 * * disable the conditions section and show the new schedule-specific message.
  • 00 18 * * * and 0 0 * * 04 remain editable in rule mode (previously both were rejected).

How to set up and validate locally

  1. Upload a GitLab Ultimate license.
  2. Go to a project, then Secure > Policies > New policy > Scan execution policy.
  3. Add a schedule rule and open the cadence dropdown, then select Monthly.
  4. Select one or more days of the month and a time, then switch to YAML mode and confirm the cadence is correct (for example 0 9 1,15 * *).
  5. In YAML mode, set a cadence with a range (for example 0 0 1-5 * *) and confirm the rule section is disabled and directs you to YAML mode.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Alexander Turinske

Merge request reports

Loading
Loading