feat(core): add spawned trigger type (#377)#380
Conversation
Extend TriggerTypeSchema with an explicit `spawned` value so a host can persist run provenance for agent-spawned jobs as a first-class enum rather than inferring it. Additive and backward-compatible. - core: `spawned` added to TriggerTypeSchema / TriggerType. `schedule` already covers scheduled runs, so no separate `scheduled` value is added. - web: job-history trigger-type map renders `spawned` with a Bot icon labelled "Spawned". - test: extend the TriggerTypeSchema enum test + a full-schema parse of a spawned job. Supports paddock#267 (provenance badges). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewed 5 changed files (7 hunks); 0 findings. |
edspencer
left a comment
There was a problem hiding this comment.
Additive, backward-compatible addition of a spawned value to TriggerTypeSchema plus its web-client mirror. Straightforward and low-risk.
I verified:
packages/core/src/state/schemas/job-metadata.ts—spawnedcorrectly appended to the Zod enum; no consumers rely on exhaustive matching that would break.packages/web/src/client/src/lib/types.ts— the hand-maintainedTriggerTypeunion is kept in sync with the new value.packages/web/src/client/src/components/jobs/JobHistory.tsx—Boticon imported and mapped; the existing?? map.manualfallback means unmapped values already degrade gracefully.- Tests extend the enum parse test and add a full spawned-job parse; the changeset (minor bump for core + web) is present and accurate.
Nothing to flag — the "no separate scheduled" reasoning in the PR body is sound since schedule already encodes that provenance.
Deploying herdctl with
|
| Latest commit: |
7e0208d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://df268805.herdctl.pages.dev |
| Branch Preview URL: | https://feat-trigger-type-spawned.herdctl.pages.dev |
Summary
Closes #377 (E2). Adds an explicit
spawnedvalue toTriggerTypeSchemaso a host (e.g. paddock) can persist run provenance for agent-spawned jobs as a first-class enum rather than inferring it. Additive and backward-compatible — no behaviour change for existing headless fleets.scheduledvsscheduleThe ticket asks for
spawnedand, if not already covered, a distinctscheduled. The existing enum already hasschedule, which is exactly the "triggered by a schedule" provenance — so a separatescheduledwould be redundant. Onlyspawnedis added.Changes
@herdctl/core—spawnedadded toTriggerTypeSchema(and therefore the exportedTriggerType).@herdctl/web— the job-history trigger-type icon/label map (JobHistory.tsx) rendersspawnedwith aBoticon labelled "Spawned"; the clientTriggerTypeunion intypes.tsgains the value.TriggerTypeSchemaenum test to coverspawned(plus the previously-untesteddiscord/slack/web), and add a full-schema parse of a spawned job.@herdctl/core+@herdctl/web.Verification
pnpm typecheck— all 11 packages pass (includes the web build).vitest runonjob-metadata-schema.test.ts— 40 tests pass.biome check— clean.Supports paddock#267 (provenance badges).