Repository navigation
fix(platform): let a scheduled pack start from its own trigger - #3381
Merged
Merged
Conversation
Every shipped pack that ships a schedule has been refused at start since
v0.5.17. The scheduler wraps a run input as `{ trigger, firedAt }`, and all
eight packs declared `additionalProperties: false` without those fields, so
each occurrence was refused before a run row existed. The trigger recorded
`start_refused` and nothing else surfaced.
The wrapper is the documented contract — `develop/webhooks` says a declared
input schema must describe it — so the packs are what was wrong, not the
validation. Each now declares `trigger` and `firedAt`.
A guard in packs.test.ts asserts that a pack shipping a schedule does not
close its inputs against the wrapper. It stays narrow on purpose: the GitHub
packs may still refuse a scheduled start for the `owner` and `repo` they
require, which is an authoring choice, while being closed against the wrapper
is the pack forbidding the only start its own trigger can perform.
Two documentation fixes follow from it. `automations/builtin` presented the
refusal as expected behaviour for the GitHub packs. `automations/triggers`
showed `firedAt` as a string when the scheduler sends epoch-ms, so an author
following the table would declare `type: string` and reintroduce the refusal
as a type error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3377.
Every shipped pack that ships a schedule can start again. Since v0.5.17 each occurrence was refused before a run row existed, so no scheduled automation has run on any install on that release or later.
Why
The scheduler starts a run with the trigger wrapper, not bare workflow input:
{ trigger: 'schedule', firedAt }triggers.ts:254{ trigger: 'event', event, payload }triggers.ts:343{ trigger: 'webhook', payload }triggers.ts:482beginRunInTxvalidates that against the deployed version'sinputsschema. All eight packs declaredadditionalProperties: falsewithouttriggerorfiredAt, so the refusal was certain and permanent.The wrapper is the documented contract —
develop/webhooksstates that a declared input schema must describe it — so the packs were wrong, not the validation.What changed
triggerandfiredAt.packs.test.tsgains a guard: a pack shipping a schedule must not close its inputs against the wrapper.automations/builtinno longer presents the refusal as expected GitHub behaviour.automations/triggersshowedfiredAt: "…", but the scheduler sends epoch-ms (triggers.ts:205). An author following that table would declaretype: stringand reintroduce the refusal as a type error.Risk
The guard is deliberately narrow. It asserts only that the wrapper is not rejected as an unknown property, so the GitHub packs still refuse a scheduled start for the
ownerandrepothey require. That refusal is an authoring choice and this does not change it; being closed against the wrapper is not a choice, it is the pack forbidding the only start its own trigger can perform.The German and French doc edits follow
CONVENTIONS.md— nonbreaking space before the French colon, typographic apostrophe, code literals identical across locales. Worth knowing when reviewing: the docs prose suite currently pins nearly every style check toreport, includingstyle-nbspandstyle-apostrophes, so a green run is not evidence for those. These files produce no findings in either mode, which is the strongest signal the tooling offers.Tests
packs.test.tsfails on all eight packs without the schema change, withexpected [ 'trigger', 'firedAt' ] to deeply equal []. Suites: 60 automations tests, 22 docs prose tests, oxlint and oxfmt clean.Scope
Fixes the shipped packs only. It does not reach an existing install:
seedDefaultAutomationPacksskips any automation the organization already has (provisioning/service.ts:88), so an upgraded instance keeps its refused version and needs a schema edit and a newly deployed version. #3377 should not be closed on the strength of this alone.Independent of #3376 — an install that takes both still ingests no email until that one lands too.