Repository navigation
feat(website): create a one-shot job from the schedule form - #31291
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Once reuses the existing [DESIGN-REVIEWED] 8f7481b Description read[DESCRIPTION-READ] 6265387639169ee0f0f8872a8c66a7e25203c88a649b9b392821e31219f64d4d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The PR adds a Once option to the new-job form and sends it through the existing What this change shipsInventory (6 items) — 6 justifiedIntent: let a user create a job that runs once, at a date and time they pick, from the dashboard's job form. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 8f7481b Description read[DESCRIPTION-READ] 59bf0710cf10df09d472de76fc1ad6eef57f2542d848d4c5b7bfb46433465a90 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the empty-date hint state. If someone picks Once and presses Create with no date, a hint appears that none of the three screenshots shows. Evidence gaps
Notes
[UX-REVIEWED] 8f7481b Description read[DESCRIPTION-READ] 285c7e77666de7964c902762a4bf363fe9c387e8957b1c28ee516f4d77ff5f19 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
440c8a8 to
fdc680f
Compare
The Schedule page's job form could edit an existing one-shot job but not create one: its schedule picker offered only an interval, a weekly schedule or a cron expression. A new job now gets a Once option with a date-and-time field and the zone picker the other modes use; the form sends the wall clock as at_time to POST /api/crons, where the shared one-shot parser reads it in the job's zone. An existing job never offers Once, since the update route takes no run time. Part of #9836
fdc680f to
8f7481b
Compare
chenmingwei23
left a comment
There was a problem hiding this comment.
Approving: green board, no conflicts, no outstanding change requests.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 8f7481b, no conflict, no open change request.
Problem / Motivation
Goal: A user can schedule a job that runs once, at a date and time they pick, from the Schedule page's job form.
The cron backend already takes one-shot jobs over REST (
at/delay/at_timeonPOST /api/crons), and the form already shows an existing one-shot's run time when editing it. But the create form's schedule picker offers only Every interval, Weekly schedule and Cron expression, so a one-shot job cannot be created from the dashboard at all; it takes a chat request or the CLI.Why it matters
"Remind me at 3pm on Friday" and "run this check once after the release" are ordinary schedules. Without a Once option the only dashboard route is a recurring job the user has to remember to delete after it fires.
Not a goal
What changed (motivation → approach → change)
The schedule picker on a new job (
components/JobForm.tsx) gains a Once option. Choosing it shows a date-and-time field and the same zone picker the weekly and cron modes use. On Create the form sends the picked wall clock asat_time(and the zone astimezonewhen the picker was touched) to the existingPOST /api/cronsroute. The backend's shared one-shot parser reads it in that zone, exactly ascron_addandkirocrew cron add --atdo, and refuses a time already past or one the zone's clocks skip. An empty field stops the save and says "Pick a date and time for this job to run" as plain text beside the field, markedaria-invalid, the way the auto-pause field shows its hint. It is a hint, not an error notice, because nothing failed.Reading the time in the job's zone, not the browser's, keeps one rule for the whole form: 09:30 means 09:30 in the zone shown beside it, whichever mode is chosen, and the job's "at …" label shows that same zone. An existing job never offers Once, because the update route cannot take a run time; an existing one-shot still opens showing its stored time, as before.
The three new strings are in every shipped catalog (
en.json,en.manual.json, the eleven translations and the generateden-XA), with translator context for the two short ones inen.context.json. The cron spec (learn-cron-dashboard.md) records what the form creates.Backwards compatibility
Compatible: the form only gains an option for new jobs; every existing request shape, and the edit form, is unchanged.
Removes nothing: no field, option, key or route is taken away.
Tests
website/src/test/JobForm.oneShot.test.tsxgains three tests:at_time: "2030-01-02T09:30", with nocronorevery. It fails onmain, which has no Once option.The existing three one-shot edit tests still pass unchanged. Determinism: no new test reads a clock or waits on a timer. The file passed 20 runs in a row with
--sequence.shuffleand a fixed, printed seed per run.Related suites run locally: before the last change, the 77 frontend spec files that name or reference a changed file and the 19 backend test files that reference one, all green; after it, every
JobForm.*spec and the i18n style suites (the Hindi one withI18N_BASE_REFset); plustsc -p tsconfig.app.json, eslint on the changed files,i18n:check,i18n:render,gen:ui --check, jscpd, semgrep on the diff, docs lint, and the file-line-cap, brand-name and comment-history checks.Manual verification
Ran the built dashboard against stubbed API routes in Chromium (Los Angeles time zone): opened Add Job, chose Once, entered 2 January 2030 09:30 with the zone picker on its Local default, and pressed Create. The captured
POST /api/cronsbody carriedat_time: "2030-01-02T09:30"and noat,cronorevery, in both the dark and light themes.Screenshots / video
The schedule picker on a new job, with Once listed:
Once chosen, with its date-and-time field filled and the zone picker beside it (dark and light):
Related Issues
Part of #9836
The composer shortcut half of that issue stays open; #11397 carries it.
Sibling sweep
N/A: a
featPR, not a fix.Pattern harvest
N/A: a
featPR, not a fix.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.