Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:hwr5ogflj6 is past its budget: trevato/forge: "migrate: after > POST /api/v1/migrate with an unknown `after` is a 400 naming the three words" failed o… #4535

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The unknown-`after` 400 test now has a fixture of its own, so it no longer shares setup with the migrate-after suite that has been failing. I never reproduced the failure: `bun test test/migrate-after.test.ts` passes here (9 pass), and I couldn't see the check logs. The new fixture is my best guess at the cause. `bun x tsc --noEmit` couldn't run: it stops on `Cannot find type definition file for '…

shipped production is serving it deploy d63cf43

opened this

The unknown-after 400 test now has a fixture of its own, so it no longer shares setup with the migrate-after suite that has been failing. I never reproduced the failure: bun test test/migrate-after.test.ts passes here (9 pass), and I couldn't see the check logs. The new fixture is my best guess at the cause. bun x tsc --noEmit couldn't run: it stops on Cannot find type definition file for 'bun', so the change isn't type-checked.

What changed

  • The handler at POST /api/v1/migrate already rejects a bad after with a plain 400 before doing any work, so the code under test isn't what varies.
  • The test had already been moved to the front of its suite (#4480), but it still ran after the suite's beforeAll. That setup starts the fake GitHub, connects an origin and starts the mirror loop, so a slow setup could fail the first test.
  • The test now lives in its own describe in test/migrate-after.test.ts. That block has a minimal app, a server and one user and token, and nothing else. It has 60 s timeouts and retried cleanup.
  • The assertions are unchanged.

Left out

  • I didn't touch the rest of the migrate-after suite, which keeps its own fixture.
  • I didn't change src/http/api.ts, because the handler is already correct.

How to try it

  • Run bun test test/migrate-after.test.ts.
  • Whether this clears shared:01m23vygyffx5hg2f5vm8r74sr:hwr5ogflj6 depends on the check that runs against this push. If it still fails, its log should show the real cause.

Closes #4533

commented

The unknown-after 400 test now has a fixture of its own, so it no longer shares setup with the migrate-after suite that has been failing. I never reproduced the failure: bun test test/migrate-after.test.ts passes here (9 pass), and I couldn't see the check logs. The new fixture is my best guess at the cause. bun x tsc --noEmit couldn't run: it stops on Cannot find type definition file for 'bun', so the change isn't type-checked.

What changed

  • The handler at POST /api/v1/migrate already rejects a bad after with a plain 400 before doing any work, so the code under test isn't what varies.
  • The test had already been moved to the front of its suite (#4480), but it still ran after the suite's beforeAll. That setup starts the fake GitHub, connects an origin and starts the mirror loop, so a slow setup could fail the first test.
  • The test now lives in its own describe in test/migrate-after.test.ts. That block has a minimal app, a server and one user and token, and nothing else. It has 60 s timeouts and retried cleanup.
  • The assertions are unchanged.

Left out

  • I didn't touch the rest of the migrate-after suite, which keeps its own fixture.
  • I didn't change src/http/api.ts, because the handler is already correct.

How to try it

  • Run bun test test/migrate-after.test.ts.
  • Whether this clears shared:01m23vygyffx5hg2f5vm8r74sr:hwr5ogflj6 depends on the check that runs against this push. If it still fails, its log should show the real cause.
Approved

Test-only change: the unknown-after 400 test moves into its own small describe (app, server, one admin user and token), so the fake GitHub, origin connection and mirror loop in the big suite cannot slow it. Assertions are unchanged, and I ran bun test test/migrate-after.test.ts here: 9 pass. No product code, security surface or dependency is touched, and imports are all already present.

Two things I would do next:

  1. If the check still fails on this test, read its log for the real cause. The fixture change is a guess, and scout did not reproduce the failure.
  2. Add test/helpers support for a shared minimal app fixture if a third suite needs the same shape, rather than copying the create/serve/cleanup block.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs