Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3fmimn3rfl is past its budget: trevato/forge: "an answer git failed to give is not remembered" failed on 3 pulls in the last hour — the lane's red, no… #15896
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/15895-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 0 commits fork 1 thread · 1 unresolved
1 file
changed +14
−9
test/following-cache.test.ts +14 −9
| @@ -10,7 +10,7 @@ import { join } from "node:path"; | ||
| 10 | 10 | import { commitToBranch, createRepo, forkRepo } from "../src/actions/repos.ts"; |
| 11 | 11 | import { relationOf } from "../src/actions/forks.ts"; |
| 12 | 12 | import { createApp, type App } from "../src/app.ts"; |
| 13 | import { comparisons } from "../src/core/following.ts"; | |
| 13 | import { comparisons, keptStanding } from "../src/core/following.ts"; | |
| 14 | 14 | import { getRepo } from "../src/core/repos.ts"; |
| 15 | 15 | import { getUserByName } from "../src/core/users.ts"; |
| 16 | 16 | import { createUser } from "../src/core/users.ts"; |
| @@ -100,12 +100,17 @@ test("an answer git failed to give is not remembered", async () => { | ||
| 100 | 100 | const fork = getRepo(app.db, "bob", "lib")!; |
| 101 | 101 | const bob = getUserByName(app.db, "bob")!; |
| 102 | 102 | // A tip whose objects are missing: git cannot compare it with anything. |
| 103 | await writeFile( | |
| 104 | join(repoDir(app.reposRoot, "bob", "lib"), `refs/heads/${fork.defaultBranch}`), | |
| 105 | `${"c".repeat(40)}\n`, | |
| 106 | ); | |
| 107 | const before = comparisons.count; | |
| 108 | await relationOf(app, bob, fork); | |
| 109 | await relationOf(app, bob, fork); | |
| 110 | expect(comparisons.count).toBe(before + 2); | |
| 103 | // A follow started by an earlier commit may still be moving this ref and | |
| 104 | // overwrite the tip, so it is written again until a read has seen it. | |
| 105 | const parent = getRepo(app.db, "alice", "lib")!; | |
| 106 | const bogus = "c".repeat(40); | |
| 107 | const ref = join(repoDir(app.reposRoot, "bob", "lib"), `refs/heads/${fork.defaultBranch}`); | |
| 108 | let read = await relationOf(app, bob, fork); | |
| 109 | for (let i = 0; i < 20 && read?.forkTip !== bogus; i++) { | |
| 110 | await writeFile(ref, `${bogus}\n`); | |
| 111 | read = await relationOf(app, bob, fork); | |
| 112 | } | |
| 113 | expect(read?.forkTip).toBe(bogus); | |
| 114 | // What the forge kept for these two tips is nothing: git gave no answer. | |
| 115 | expect(keptStanding(app, fork, parent)).toBeUndefined(); | |
| 111 | 116 | }); |
new above
offline