feat(schedule): support weekday and raw cron schedules - #2098
feat(schedule): support weekday and raw cron schedules#2098jamesadevine wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46a9d42b-591c-4d80-96d2-1c0962554c7f
|
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. |
|
/review |
|
✅ Compiler Contract Reviewer completed the compiler contract review.
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Summary
Fixes #1965
Test plan
cargo test schedulecargo test --test compiler_tests test_schedulecargo clippy --bin ado-aw --tests -- -D warnings