Skip to content

feat(schedule): support weekday and raw cron schedules - #2098

Open
jamesadevine wants to merge 1 commit into
mainfrom
feat/schedule-weekday-cron
Open

feat(schedule): support weekday and raw cron schedules#2098
jamesadevine wants to merge 1 commit into
mainfrom
feat/schedule-weekday-cron

Conversation

@jamesadevine

Copy link
Copy Markdown
Collaborator

Summary

  • add gh-aw-compatible weekday modifiers for daily, constrained daily, hourly, and hour-interval fuzzy schedules
  • preserve Monday-Friday semantics when UTC offset conversion crosses midnight, with actionable validation for conflicting modifiers
  • support validated five-field Azure Pipelines cron expressions and mixed fuzzy/raw schedule lists with per-entry branches
  • document the new syntax and the explicit UTC-only boundary for IANA timezones

Fixes #1965

Test plan

  • cargo test schedule
  • cargo test --test compiler_tests test_schedule
  • cargo clippy --bin ado-aw --tests -- -D warnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46a9d42b-591c-4d80-96d2-1c0962554c7f
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jamesadevine

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Compiler Contract Reviewer completed the compiler contract review.

🏗️ Compiler contract review by Compiler Contract Reviewer

@github-actions github-actions Bot mentioned this pull request Sep 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review: no regressions found

This diff extends schedule parsing (weekday modifiers + validated 5-field ADO cron support). It doesn't touch the trust boundaries this reviewer is scoped to (sandbox/token projection, network allowlist, safe-output application, sanitization bypass, path handling).

The new raw-cron path (schedule_expression_to_cron / validate_raw_cron) is well-defended: each of the 5 cron fields is restricted to an explicit allowlist ([a-zA-Z0-9*,/-]) before being accepted, numeric/named ranges are bounds-checked, and the resulting string is only ever serialized into YAML via serde_yaml's string node (lower.rs:399), not concatenated into a bash:/template string, so there's no injection surface into the generated pipeline or a ##vso[...] sink. display_name for schedule entries remains the fixed literal "Scheduled run", not derived from user input.

No merge-blocking findings — this is a security-neutral parsing/validation feature addition.

🔒 Security review by PR Security Reviewer · auto · 34.4 AIC · ⌖ 8.91 AIC · ⊞ 11.7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid feature addition with good test coverage. One finding flagged inline: the unreachable!() panic branches in DayFilter::cron_field()/cron_field_for_utc_time() are safe today (offsets are constrained by parse_utc_offset's ±12h/+14h range and only daily schedules carry non-zero offsets), but the invariant isn't enforced by the type system, so a future change could turn it into a live panic. Not merge-blocking given current call sites, but worth hardening.

Note: the rust-critic sub-agent did not return usable JSONL output after a blocking wait and follow-up prompt, so its findings are not included here — this review reflects my own pass only.

🦀 Rust code quality review by Rust Code Quality Reviewer · auto · 94.5 AIC · ⌖ 4.8 AIC · ⊞ 11.5K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid test coverage overall for the new weekday-modifier and raw-cron parsing logic — the table-driven negative tests for daily/interval rejection and raw cron validation are good. Three gaps worth closing (see inline comments): no compiler-level negative test for a malformed schedule-list entry, no interval-schedule test for the duplicate "on weekdays" guard, and two untested raw-cron validation branches (multiple step separators, empty list items). None of these are blocking, but they cover new branches that currently have no regression protection.

🧪 Test quality analysis by Test Quality Sentinel · auto · 97.6 AIC · ⌖ 1.97 AIC · ⊞ 11.3K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the schedule-weekday-cron changes for compiler-contract concerns (front-matter grammar, generated cron correctness, docs sync). The ScheduleConfig/ScheduleOptions/ScheduleListItem API migration is clean — no leftover callers of the old .expression()/.branches() accessors outside tests, and entries() covers all three variants. docs/schedule-syntax.md and docs/front-matter.md are updated in step with the new syntax, and the referenced gh-aw reference URL does document on weekdays. Weekday/UTC-offset cron rotation and the raw-cron validator are well covered by unit tests (verified all 24 fuzzy_schedule tests pass on the branch).

One contract gap found and flagged inline: ScheduleOptions (the pre-existing object form) doesn't get the same deny_unknown_fields treatment the PR adds to the new ScheduleListItem, so an unsupported timezone: key is silently ignored there instead of rejected — undermining the PR's own "must not be silently ignored" guarantee for that form.

🏗️ Compiler contract review by Compiler Contract Reviewer · auto · 138.5 AIC · ⌖ 2.06 AIC · ⊞ 12.8K
Comment /review to run again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent-issue]: support weekday-only fuzzy schedules and cron parity

1 participant