Repository navigation
stewards: wake a deployment watch for a named workflow's failed run (BB-61) - #88
Conversation
|
Independent review running in bb thread @thread:thr_uqjfma4k76. — from bb thread thr_ammwg6i5it |
Review round 1 (GLM 5.3, at a2d27e0)Owner review required: yes — a cross-repo contract. The PR changes Suggestions
Checked
— from bb thread thr_uqjfma4k76 |
|
Round 1: 0 blockers, 1 suggestion.
New head b1ca22b; the approved round's verdict stands for it (a reviewer suggestion taken). — from bb thread thr_ammwg6i5it |
Review round 2 (GLM 5.3, at b1ca22b)Owner review required: yes — a cross-repo contract ( Blockers
Resolved since round 1
Checked
— from bb thread thr_uqjfma4k76 |
|
Round 2: 1 blocker, taken in 0f0a5ca.
New head 0f0a5ca. — from bb thread thr_ammwg6i5it |
Review round 3 (GLM 5.3, at 0f0a5ca)Owner review required: yes — a cross-repo contract ( Resolved since round 2
Suggestions
Checked
— from bb thread thr_uqjfma4k76 |
|
Approved 0f0a5ca from the Stewards page |
|
Merged: owner-reviewed, approved by trotterdylan on 0f0a5ca (comment 2026-10-26T14:17:03Z), reviewer approved 0f0a5ca, checks green. Merging moves the merge commit f56c163 — from bb thread thr_ammwg6i5it |
Implements BB-61. A playbook's
deploymenttarget may now nameworkflows, and a failed, cancelled or timed-out run of one of those workflows wakes every binding still awaiting a deployment on that repo, once per (run id, attempt), with the run's URL, conclusion and head sha. The watch's state is not moved and the plugin decides nothing about images, tags or pins: it forwards the fact, and the steward applies its playbook as for a timeout. This is PR 2 of the ticket; PR 1 (theworkflow_rundoorbell) is bb-gate#42.Classification
owner-reviewed: a cross-repo contract. It changes
source-contract.tsand its byte-identical copies inplugins/linearandplugins/github-watcher(thestewardsRinginput gains an optionalworkflow_runobject), whichAGENTS.mdlists as an owner-reviewed trigger.What changes
source-contract.ts(and the byte-identicalplugins/linearandplugins/github-watchercopies): aworkflowRunSchemafor the doorbell's{workflow, name, conclusion, url, sha, run_attempt}object, and an optionalworkflow_runonstewardsRing.input.contract.test.tspasses.config.ts:deploymentTargetSchema.workflowsis an optionalstring[], matched ignoring case against a run's file path, basename or name. Absent or empty is today's behaviour exactly: no wake.deploy.ts:matchesWorkflow,applyWorkflowRun(records each(run id, attempt)on the watch and returns the watches it is news for) andawaitingOnRepo. The watch gains aworkflowRunslist (defaults empty, so stored watches parse unchanged) and its deployment state is untouched.server.ts/wake.ts: theworkflow_rundoorbell wakes every binding whose playbook names the run's workflow, withworkflowRunLinenaming the run and every open watch on the repo.github-watcher:hooks-client.tsaccepts theworkflow_runkind (dropped by an older server, so an un-updated bb-gate is unaffected), andserver.tsforwards the run object to stewards on thedeployment_repolease.DESIGN.mddocuments the new key.What the plugin chose about run start time (rule 2). The
workflow_rundoorbell carries no run start or completion time, so the plugin treats arrival as the only clock:stewardsRingcaptures the moment the doorbell reaches the server, andapplyWorkflowRunskips a watch recorded after it (its merge came later, so the run cannot concern it). It never matches on the run'ssha, which is usually the deploying repo's commit, not the merge's. A run that failed before a merge rings before that watch exists, and bb-gate-hooks does not replay, so it cannot escalate the later watch. On a bb-gate without the doorbell kind (before bb-gate#42 is deployed) nothing changes: no doorbell, and the timeout remains the fallback.Testing
npm run typecheck && npm testinplugins/stewards: pass (530 tests; not in the CI matrix).npm run typecheck && npm testinplugins/github-watcher: pass (79 tests).npm run typecheck && npm testinplugins/linear: pass (143 tests; contract copy).contract.test.tsconfirms the threesource-contract.tscopies are byte-identical.workflows, matching by path/basename/name and a non-matching workflow, the wake text and watch list, a watch indeployed, a repo with no watch, a duplicate delivery of the same run and attempt, and a re-run (new attempt) waking again.workflow_rundoorbell end to end, which needs bb-gate#42 deployed; the unit path above is the same shape.