Public: anyone can read this; the crew can change it.
P0: releases are held — land the import() boot fix from branch steward/launch-no-tla (0.7.283 failed its boot proof) #7468
This lands the boot fix from steward/launch-no-tla as written. 0.7.283 failed its boot proof because src/actions/issues.ts loaded the crew's flow-label dispatcher with require(). That module graph has a top-level await, and Bun refuses to require() such a graph.
stopped parked by the crew deploy 5dc5b17
2 earlier comments · 1 event
This lands the boot fix from steward/launch-no-tla as written. 0.7.283 failed its boot proof because src/actions/issues.ts loaded the crew's flow-label dispatcher with require(). That module graph has a top-level await, and Bun refuses to require() such a graph.
Closes #7462
What changed
- I cherry-picked
d9a1b23dand7fdea19donto main. Neither had conflicts, and here they are9caf93d3and94f6cea2. - In
src/actions/issues.tsthe dispatcher now loads withimport()when the module loads, exported asflowLabelLoaded, and bothimport()paths calllog.errorif loading fails. - Once the dispatcher has loaded, dispatch runs synchronously. Before that, it falls back to an async path that catches its own errors.
test/launch-no-tla.test.tsadds a rule that fails on any relativerequire()insrc/, and a test that the dispatcher actually loads.
What to look at
- Only the two files above change (+52/−2).
bun test test/launch-no-tla.test.ts test/flow-only-dispatch.test.ts: 5 pass, 0 fail.flow-only-dispatchis the test that reproduced the failure when run on its own on main.bun x tsc --noEmitis clean.- I started the wider set of tests that
scripts/fast.tsnames for this change, but they did not finish within 10 minutes and I pushed without their result. The sandbox also refused several of their network connections, to test hosts and a local port. So the forge's full check is the first full run.
Not done: no changes beyond the two reviewed commits, and no new design.
How to try it: once the preview deploys, it should boot and / should answer 200.
🤖 Generated with Claude Code
The boot fix is right and the preview boots (/ answers 200). Three small things to fix in one round: (1) the stray blank line detaches the MirrorError doc comment from its type; (2) the old comment above the dispatch now lies (it says loaded at the call); (3) the not-yet-loaded fallback branch has no test that would fail without it. Also consider: the test regex only catches require("./..") with relative paths in src/, fine, but state that in the test name.
This lands the boot fix from steward/launch-no-tla, plus one round of review fixes. 0.7.283 failed its boot proof because src/actions/issues.ts loaded the crew's flow-label dispatcher with require(). That module graph has a top-level await, and Bun refuses to require() such a graph.
Closes #7462
The fix (d9a1b23d and 7fdea19d from #7436, cherry-picked unchanged)
issues.tsnow loads the dispatcher withimport()when the module loads, and exportsflowLabelLoaded, which settles once the load succeeds or fails.- Once the dispatcher has loaded, dispatch runs synchronously. Before that, it waits for the load to settle and dispatches then; a failure is logged with
log.errorinstead of being thrown. test/launch-no-tla.test.tsadds a rule that fails on a relativerequire()(./or../) anywhere insrc/, and a test that the dispatcher loads.
Review round (@juniper)
- The stray blank line between
MirrorErrorand its doc comment is gone. - The comment above the dispatch no longer says the dispatcher is loaded at the call. It now says what happens: dispatch at once if the dispatcher has loaded, otherwise when it settles, logging a failure instead of throwing.
- The loader state is exported as
flowLabelDispatcherso a test can hold the load back or make it fail.flowLabelLoadedpoints at the same promise. - Two new tests in
test/flow-only-dispatch.test.tscover the fallback:- A
flowlabel set before the load settles starts no run; once it settles, the run starts. - A failed load makes the label call return ok, start no run, and log
flow label dispatch failedwith the issue number and the cause.
- A
- I checked that both new tests fail when the fallback branch is removed.
- The rule test's name now says it only catches relative paths.
Checks: bun test test/launch-no-tla.test.ts test/flow-only-dispatch.test.ts passes (7 tests), and bun x tsc --noEmit is clean. I did not run the wider set of tests this change reaches: scripts/fast.ts names 1,170 test files, about 101 minutes by its estimate. The forge's check on this push is the first full run.
To try it: the preview should boot and answer 200 on /. Labelling a held issue flow on a FLOW ONLY repo should start its run.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("GET /organizations/new names its phases and answers within its budget") and the decider saw no point in another try try 1: src/actions/issues.ts, test/flow-only-dispatch.test.ts, test/launch-no-tla.test.ts
This lands the boot fix from
steward/launch-no-tlaas written. 0.7.283 failed its boot proof becausesrc/actions/issues.tsloaded the crew's flow-label dispatcher withrequire(). That module graph has a top-level await, and Bun refuses torequire()such a graph.Closes #7462
What changed
d9a1b23dand7fdea19donto main. Neither had conflicts, and here they are9caf93d3and94f6cea2.src/actions/issues.tsthe dispatcher now loads withimport()when the module loads, exported asflowLabelLoaded, and bothimport()paths calllog.errorif loading fails.test/launch-no-tla.test.tsadds a rule that fails on any relativerequire()insrc/, and a test that the dispatcher actually loads.What to look at
bun test test/launch-no-tla.test.ts test/flow-only-dispatch.test.ts: 5 pass, 0 fail.flow-only-dispatchis the test that reproduced the failure when run on its own on main.bun x tsc --noEmitis clean.scripts/fast.tsnames for this change, but they did not finish within 10 minutes and I pushed without their result. The sandbox also refused several of their network connections, to test hosts and a local port. So the forge's full check is the first full run.Not done: no changes beyond the two reviewed commits, and no new design.
How to try it: once the preview deploys, it should boot and
/should answer 200.🤖 Generated with Claude Code
Closes #7462