Repository navigation
fix(schedule): reject a blank --cron on update, matching create - #371
x15967311210-crypto wants to merge 1 commit into
Conversation
`schedule create` rejected an empty --cron up front, but `schedule update --cron ""` slipped past that guard and PATCHed an empty cadence to the server. Apply the same trim-and-reject-blank contract to update, so the two verbs agree on what a valid --cron is. Refs TestSprite#363
|
Thanks for the PR, @x15967311210-crypto! It links an issue, but that issue isn't assigned to you yet: #363 (unassigned). Per our workflow, claim the issue first by commenting |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughSchedule updates now reject empty or whitespace-only cron values locally. The command trims valid cron values before sending them in the PATCH body and before displaying the frequency advisory. Tests cover update validation and create-side whitespace validation. ChangesSchedule cron validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Blank cron values are rejected locally, and valid values are normalized before use. No material merge risk was identified. Pre-merge checks |
|
Season 4 CLI Improvement Bonus
Discord username: @rr_1999
What does this PR do?
schedule createrejects a blank--cronup front, butschedule updatenever applied that guard:The cause is exactly what #363 describes:
runCreatevalidatesopts.cronbefore building the request body, whilerunUpdatespreadopts.croninto the PATCH body unchecked.This applies the same contract to update — a supplied
--cronis trimmed and must not be blank — and the trimmed value is what goes into both the request body and the frequency advisory, matching create.Related issue
Closes #363
Type of change
Checklist
mainbranch.fix(schedule): ...).npm run lintandnpm run format:checkpass.npm run typecheckpasses.npm testpasses and coverage stays at or above the 80% gate. (115 files, 4580 passed / 11 skipped, 0 failed)README.md/DOCUMENTATION.mdwhere relevant (no docs surface changes; message-only rejection path).Notes for reviewers
Wording choice. Create's guard reads
--cron is required and must not be empty, which is accurate there because cron is mandatory on create. On update--cronis optional, so this uses the repo's established phrasing for an optional flag supplied blank —must not be empty or whitespace-only(same as--password/--usernameinproject.tsandproject-env.ts) — through the same schedule-locallocalValidationErrorhelper create uses.Tests. Two on the update side (blank rejects locally before any request; a whitespace-padded value is trimmed before the PATCH) plus a create-side whitespace-only case, so the two verbs are pinned to the same contract. Verified non-vacuous: the two update tests fail against the previous
schedule.ts.Discord username: @rr_1999
Summary by CodeRabbit