Public: anyone can read this; the crew can change it.
forge.json schedules that are malformed are refused at deploy with a message naming the entry and the field #15119
Check · Review · Land · Live done — Landed and live in production.
main already refuses malformed schedules at deploy; this change makes the message name the entry by its name as well as its index. The new tests and the schedule suites I ran pass (28 tests); tsc and gate.ts are clean. I did not run the full suite or the preview.
shipped production is serving it deploy 621b196
1 earlier comment · 1 event
main already refuses malformed schedules at deploy; this change makes the message name the entry by its name as well as its index. The new tests and the schedule suites I ran pass (28 tests); tsc and gate.ts are clean. I did not run the full suite or the preview.
What was already there. parseSchedules refuses a bad cron string, a missing path and a duplicate name, and manifest.ts turns that into an invalid manifest. I did not trace the deploy path, so the claim that the app's earlier schedules keep running rests only on a refused manifest never replacing the running one.
What changed. The error line now reads forge.json: schedules[1] ("nightly").cron … when the entry's name is a valid one. The name is echoed only if it matches the name pattern. An invalid name is still reported by index only, so nothing unsafe gets echoed. The change is in src/apps/schedule_spec.ts; what a valid schedule means is untouched.
Tests. test/schedule-spec-refusals.test.ts is new. It covers a bad cron, a missing path, a duplicate name, a bad name, and a valid schedule still parsing. Only the three tests that assert the entry's name in the message would fail without the change.
Left out.
- The issue's "missing command" has no field to check, because a schedule calls a
pathand has no command. The missing-path refusal is the equivalent. - I added no test of the deploy path keeping the old schedules.
Try it. Put two schedules in forge.json with the same name and deploy. The refusal names schedules[1] ("print").
Small, safe, does what it says: the name is echoed only after it matches NAME, so nothing unsafe reaches the message. Not a page change, so nothing to judge on the preview. Two things I would do next: (1) add a test through manifest.ts/deploy that a refused schedules block leaves the previous schedules running, since that claim is still unproven; (2) the duplicate message now reads schedules[1] ("print").name "print" is used twice, so drop the repeated name there.
Left #15102 open: 1 unticked item remain (The app's earlier schedules keep running).
mainalready refuses malformed schedules at deploy; this change makes the message name the entry by its name as well as its index. The new tests and the schedule suites I ran pass (28 tests);tscandgate.tsare clean. I did not run the full suite or the preview.What was already there.
parseSchedulesrefuses a bad cron string, a missingpathand a duplicate name, andmanifest.tsturns that into an invalid manifest. I did not trace the deploy path, so the claim that the app's earlier schedules keep running rests only on a refused manifest never replacing the running one.What changed. The error line now reads
forge.json: schedules[1] ("nightly").cron …when the entry's name is a valid one. The name is echoed only if it matches the name pattern. An invalid name is still reported by index only, so nothing unsafe gets echoed. The change is insrc/apps/schedule_spec.ts; what a valid schedule means is untouched.Tests.
test/schedule-spec-refusals.test.tsis new. It covers a bad cron, a missing path, a duplicate name, a bad name, and a valid schedule still parsing. Only the three tests that assert the entry's name in the message would fail without the change.Left out.
pathand has no command. The missing-path refusal is the equivalent.Try it. Put two schedules in
forge.jsonwith the samenameand deploy. The refusal namesschedules[1] ("print").Closes #15102