Skip to content

[backend] Validate time window for schedules

Follows up on #504598 (comment 2301728686).

We want to enforce a minimum and maximum time window for scheduled pipeline execution policies . We thought about different values and methods to calculate the min and max (#504212 (comment 2353912607)) and tried to come up with a flexible validation in !183993 (closed) that would ensure it's not longer than the cron frequency. However, this approach has some drawbacks. The flexible validation approach shifts the burden of calculating the correct time window to the user, which may lead to confusion and potential misconfigurations. Instead, we can implement a static validation approach:

  1. Allow a time window of up to one month,
  2. The actual time window will be dynamically calculated when the schedule is executed, based on the time to the next run.

Implementation Details

  • Add a validation check that ensures time_window_seconds is less than or equal to one month (in seconds).
  • Implement logic to calculate the effective time window at runtime, considering the next scheduled run.
Edited by Andy Schoenen