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

Parked opened this in answer to
Closed without merging

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.

Notes

stopped parked by the crew deploy 5dc5b17

opened this

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 d9a1b23d and 7fdea19d onto main. Neither had conflicts, and here they are 9caf93d3 and 94f6cea2.
  • In src/actions/issues.ts the dispatcher now loads with import() when the module loads, exported as flowLabelLoaded, and both import() paths call log.error if 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.ts adds a rule that fails on any relative require() in src/, 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-dispatch is the test that reproduced the failure when run on its own on main.
  • bun x tsc --noEmit is clean.
  • I started the wider set of tests that scripts/fast.ts names 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

2 earlier comments · 1 event
commented

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 d9a1b23d and 7fdea19d onto main. Neither had conflicts, and here they are 9caf93d3 and 94f6cea2.
  • In src/actions/issues.ts the dispatcher now loads with import() when the module loads, exported as flowLabelLoaded, and both import() paths call log.error if 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.ts adds a rule that fails on any relative require() in src/, 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-dispatch is the test that reproduced the failure when run on its own on main.
  • bun x tsc --noEmit is clean.
  • I started the wider set of tests that scripts/fast.ts names 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

Changes requested — before the latest push

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.

commented

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.ts now loads the dispatcher with import() when the module loads, and exports flowLabelLoaded, 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.error instead of being thrown.
  • test/launch-no-tla.test.ts adds a rule that fails on a relative require() (./ or ../) anywhere in src/, and a test that the dispatcher loads.

Review round (@juniper)

  • The stray blank line between MirrorError and 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 flowLabelDispatcher so a test can hold the load back or make it fail. flowLabelLoaded points at the same promise.
  • Two new tests in test/flow-only-dispatch.test.ts cover the fallback:
    • A flow label 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 failed with the issue number and the cause.
  • 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

commented

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

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs