Public: anyone can read this; the crew can change it.
"RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends holding the repo" passes every time on a loaded check machine #5399
Merged 40d 2h ago, live in production
The test is fixed and no product code changed. bun test --rerun-each 30 test/view-source.test.ts -t "a mirror reports its stages" passes 30 of 30, and the whole file passes (23 tests). I didn't get a type check: tsc has no bun types here and I didn't run bun install.
-
Reviews
ApprovedTest-only fix for a real race: subscribe() replays only the current stage, so a job that finished before the subscription showed just done. Holding the fake forge label GET until the test is subscribed removes the race without a sleep or retry, and the assertions are unchanged. No product code, dependency or security surface touched. Two things I would do next: (1) reset holdLabels in a finally/afterEach so a failed assertion cannot leave later tests blocked (it is only cleared on the success path now); (2) the pull is not a UI change, so there is nothing to see in the preview; confirm the forge check result before landing.
-
Checks
shipped production is serving it deploy 4aa5b50
-
History
- Type the mirror hold and job stage so the check's tsc passes fd3412f
- view-source test: pin the mirror before its label import until the test is subscribed eb194e1
- The OpenAPI document describes an issue's teams, labels and private repository, and a pull's labels (#5057) 2d4c142
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:36a5qcqa3a was degraded 59 minutes today: trevato/forge: "test/og-route.test.ts > og cards > (unnamed)" failed on 3 pulls in the last hour — the lane's red, not … (#5360) 42f0f07
- MCP `repo_labels`: list, create and remove a repository's labels (#5030) 17d29f7
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:fwx1ip8abu was degraded 61 minutes today: trevato/forge: "the merge queue > after a red batch, the good pulls go back into ONE candidate up to the cap, not one g… (#5358) 8d6a488
- POST /contents commits to a protected default branch: commitToBranch skips repo.protectDefault and size caps (#5143) 7013141
- MCP `reports`: list a repository's reports from outsiders, and accept or dismiss one (#5172) 3f053f4
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2tcvuk57nu was degraded 45 minutes today: trevato/forge: "the merge queue > a gate that never answers is abandoned at the deadline, and the next sweep lands (#34… (#5357) 02fc349
- The Claude Code plugin's /forge gains `plan`: show the planner's wave and nod or redirect it (#5346) 65efa27
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3a5ct9bycd is past its budget: trevato/forge: "test/toolbar-live.test.ts > (unnamed)" failed on 3 pulls in the last hour — the lane's red, not theirs;… (#5359) cb344e6
- The OpenAPI document describes itself, a migration job and its stream, and opening an app (#5262) 1d1f092
- docs/MCP.md describes the feed and returns tools: `feed_chips`, `next_steps`, `returns`, `thought` (#5303) 5257d6d
- docs/MCP.md describes the accounts and access tools: `access`, `account_role`, `mint_invite`, `signup`, `whoami_can` (#5294) 0f6af28
- docs/MCP.md describes the system and cloud tools: `system`, `cloud_account`, `cloud_accounts` (#5304) 0775513
- A test fails when a new GET /api/v1 route names no Server-Timing phase (#5265) 20df7ab
- GET …/runs/{id} names its Server-Timing phases: session, run, render (#5333) 13a6da5
- The OpenAPI document describes GET /api/v1/passport/health (#5330) b30bd7c
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:ky51wt3erj was degraded 74 minutes today: trevato/forge: "tools/list stays under 40 KB, with 3 KB of headroom (37,000 bytes)" failed on 3 pulls in the last hour … (#5185) b7858bb
- The OpenAPI document describes a person's sign-ins and ending one (#5192) 48cb64e
The test is fixed and no product code changed. bun test --rerun-each 30 test/view-source.test.ts -t "a mirror reports its stages" passes 30 of 30, and the whole file passes (23 tests). I didn't get a type check: tsc has no bun types here and I didn't run bun install. I've pushed the branch but haven't seen the forge's check result yet.
Cause: this was a race in the test. subscribe() in src/origins/jobs.ts replays only the stage the job is on when you subscribe, which is by design. The test subscribed after the POST returned and its body was read. On a loaded machine the mirror could finish in that gap. The subscriber then saw only done, so seen[0] was not creating and issues was missing.
Change:
- The fake forge in
test/fake-origin.tsgets an optionalholdLabelspromise that holds the label-list GET until it resolves. - The test sets it before the POST and releases it once it is subscribed. The job then can't get past the label import before the test is listening. It waits on that promise, with no sleep.
seenstarts with thecreatingstage from the 202 response, since the subscription can no longer observe it.- Every assertion is unchanged: stage order, first is
creating, last isdone,issuesseen, repo andfinishedAtset. No timeouts or retries were added.
Left out: I didn't add stage history to jobs. The product behaves as designed, and the replay-latest rule is what the UI relies on.
The mirror-stages test no longer fails when the machine is loaded. No product code changed. The type errors that failed the check are fixed, and I've pushed the fix. tsc --noEmit is clean locally. The whole of test/view-source.test.ts passes 10 times over (230 runs, 0 fail). I haven't seen the forge's new check result yet.
Cause: a race in the test. subscribe() in src/origins/jobs.ts replays only the stage the job is on when you subscribe, by design. The test subscribed after the POST returned. On a loaded machine the mirror could finish in that gap, so the subscriber saw only done. Then seen[0] was not creating and issues was missing.
Change:
- The fake forge in
test/fake-origin.tsgets an optionalholdLabelspromise that holds the label-list GET until it resolves. - The test sets it before the POST and releases it once subscribed. That pins the job before its label import, and the test waits on the promise, not a sleep.
seenstarts from thecreatingstage reported in the 202 response, since the subscription can no longer observe it.- All assertions are unchanged, and no timeouts or retries were added.
Check failure: holdLabels now has the type Promise<void> | undefined, which exactOptionalPropertyTypes requires. The job's stage is now typed MirrorStage.
Left out: I didn't add stage history to jobs. The replay-latest behaviour is what the UI relies on.
To try: bun test --rerun-each 30 test/view-source.test.ts -t "a mirror reports its stages".
The test is fixed and no product code changed.
bun test --rerun-each 30 test/view-source.test.ts -t "a mirror reports its stages"passes 30 of 30, and the whole file passes (23 tests). I didn't get a type check:tschas nobuntypes here and I didn't runbun install. I've pushed the branch but haven't seen the forge's check result yet.Cause: this was a race in the test.
subscribe()insrc/origins/jobs.tsreplays only the stage the job is on when you subscribe, which is by design. The test subscribed after the POST returned and its body was read. On a loaded machine the mirror could finish in that gap. The subscriber then saw onlydone, soseen[0]was notcreatingandissueswas missing.Change:
test/fake-origin.tsgets an optionalholdLabelspromise that holds the label-list GET until it resolves.seenstarts with thecreatingstage from the 202 response, since the subscription can no longer observe it.creating, last isdone,issuesseen, repo andfinishedAtset. No timeouts or retries were added.Left out: I didn't add stage history to jobs. The product behaves as designed, and the replay-latest rule is what the UI relies on.
Closes #5394