Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1uelmre57z is past its budget: trevato/forge: "migrate: after > mirror: the crew's work branches never go to the source" failed on 3 pulls in the last… #4479
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4464-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork 1 thread · 1 unresolved
1 file
changed +14
−15
test/migrate-after.test.ts +14 −15
| @@ -171,6 +171,19 @@ describe("migrate: after", () => { | ||
| 171 | 171 | expect(getRepo(app.db, "alice", copy)).toBeDefined(); |
| 172 | 172 | }); |
| 173 | 173 | |
| 174 | /** The copy's mirror target, once `ok` says the push has settled. */ | |
| 175 | const settledTarget = async (copy: string, ok: (t: NonNullable<ReturnType<typeof getMirrorTarget>>) => boolean) => { | |
| 176 | // A deadline, not a count of naps: a loaded check machine slows the push, | |
| 177 | // never the verdict. | |
| 178 | const deadline = Date.now() + 40_000; | |
| 179 | while (Date.now() < deadline) { | |
| 180 | const held = getMirrorTarget(app.db, getRepo(app.db, "alice", copy)!.id); | |
| 181 | if (held !== undefined && ok(held)) return held; | |
| 182 | await Bun.sleep(25); | |
| 183 | } | |
| 184 | throw new Error("the mirror push did not settle"); | |
| 185 | }; | |
| 186 | ||
| 174 | 187 | test("mirror: no write at migration, then one push to GitHub after a landing", async () => { |
| 175 | 188 | const { job, name, copy } = await migrate("mirror"); |
| 176 | 189 | expect(job?.stage).toBe("done"); |
| @@ -182,11 +195,7 @@ describe("migrate: after", () => { | ||
| 182 | 195 | await commit(alice, "alice", copy, "landed.txt"); |
| 183 | 196 | const mine = await resolveOid(repoDir(app.reposRoot, "alice", copy), "refs/heads/main"); |
| 184 | 197 | expect(mine).not.toBe(before); |
| 185 | for (let i = 0; i < 600; i++) { | |
| 186 | const held = getMirrorTarget(app.db, getRepo(app.db, "alice", copy)!.id); | |
| 187 | if (held?.tips["refs/heads/main"] === mine) break; | |
| 188 | await Bun.sleep(50); | |
| 189 | } | |
| 198 | await settledTarget(copy, (t) => t.tips["refs/heads/main"] === mine); | |
| 190 | 199 | expect(await resolveOid(sourceDir, "refs/heads/main")).toBe(mine); |
| 191 | 200 | // The credential travelled as a header in git's environment: the API |
| 192 | 201 | // log has no write, and the stored target holds no secret. |
| @@ -197,16 +206,6 @@ describe("migrate: after", () => { | ||
| 197 | 206 | expect(JSON.stringify(target)).not.toContain("token"); |
| 198 | 207 | }); |
| 199 | 208 | |
| 200 | /** The copy's mirror target, once `ok` says the push has settled. */ | |
| 201 | const settledTarget = async (copy: string, ok: (t: NonNullable<ReturnType<typeof getMirrorTarget>>) => boolean) => { | |
| 202 | for (let i = 0; i < 600; i++) { | |
| 203 | const held = getMirrorTarget(app.db, getRepo(app.db, "alice", copy)!.id); | |
| 204 | if (held !== undefined && ok(held)) return held; | |
| 205 | await Bun.sleep(50); | |
| 206 | } | |
| 207 | throw new Error("the mirror push did not settle"); | |
| 208 | }; | |
| 209 | ||
| 210 | 209 | test("mirror: the crew's work branches never go to the source", async () => { |
| 211 | 210 | const { name, copy } = await migrate("mirror"); |
| 212 | 211 | const copyDir = repoDir(app.reposRoot, "alice", copy); |
new above
offline
Consider including the elapsed time and the last-seen tips in this error, so a timeout in the check log shows whether the push was slow or never started.