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

Merged opened this

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

Merged

scout/forge:scout/4464-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/4464-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as d8f99a1.

Review

Sign in to review this change.
1 file changed +14 −15
test/migrate-after.test.ts +14 −15
@@ -171,6 +171,19 @@ describe("migrate: after", () => {
171171 expect(getRepo(app.db, "alice", copy)).toBeDefined();
172172 });
173173
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
174187 test("mirror: no write at migration, then one push to GitHub after a landing", async () => {

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.

175188 const { job, name, copy } = await migrate("mirror");
176189 expect(job?.stage).toBe("done");
@@ -182,11 +195,7 @@ describe("migrate: after", () => {
182195 await commit(alice, "alice", copy, "landed.txt");
183196 const mine = await resolveOid(repoDir(app.reposRoot, "alice", copy), "refs/heads/main");
184197 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);
190199 expect(await resolveOid(sourceDir, "refs/heads/main")).toBe(mine);
191200 // The credential travelled as a header in git's environment: the API
192201 // log has no write, and the stored target holds no secret.
@@ -197,16 +206,6 @@ describe("migrate: after", () => {
197206 expect(JSON.stringify(target)).not.toContain("token");
198207 });
199208
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
210209 test("mirror: the crew's work branches never go to the source", async () => {
211210 const { name, copy } = await migrate("mirror");
212211 const copyDir = repoDir(app.reposRoot, "alice", copy);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs