Let a bed's forge take the lab's shallow checkouts (issue 689)
mesh/merge-gate head 7ed7da1398df merged into trunk 307dd23d6d2a — pass: the change touches no module of the mesh's graph
mesh/repo-check head 7ed7da1398df merged into trunk 307dd23d6d2a — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (typescript)…
mesh/delivery delivered

The lab module clones every repository with --depth 50, and a fresh bare
repository refuses a push whose history ends in a cut, so the genesis bed
raised its anchor and forge and then skipped. The three beds that carry a
checkout into a forge now share one helper that sets receive.shallowUpdate
on the bare repository. Unshallowing instead cannot work in a lab run: the
forge credential is removed once the run's clones are done.
This commit is contained in:
jochen
2026-10-14 02:21:21 +02:00
parent 1316a405a6
commit 7ed7da1398
5 changed files with 88 additions and 18 deletions
+3 -6
View File
@@ -43,6 +43,7 @@ import { destroy, exec, push } from "../../src/lifecycle/operate.ts";
import { bootstrapBinaryPath, hostBinaryPath } from "../../src/lifecycle/place.ts";
import { labIsUsable, destroyAll, foundationBundle } from "./harness.ts";
import { genesis, type GenesisResult } from "./genesis.ts";
import { carry } from "./forge.ts";
const SCENARIO = "genesis-untrusted";
const ANCHOR = "anchor";
@@ -98,13 +99,9 @@ async function must(machine: string, command: string, timeoutMs?: number): Promi
/** The control plane's repository at the checkout's HEAD, served from the forge machine over git's protocol. */
async function raiseForge(): Promise<string> {
const dir = mkdtempSync(join(tmpdir(), "mesh-lab-r92-forge-"));
const head = execFileSync("git", ["-C", controller, "rev-parse", "HEAD"], { encoding: "utf8" }).trim();
let head: string;
try {
const bare = join(dir, "mesh-controller.git");
execFileSync("git", ["init", "-q", "--bare", bare]);
// No collection after the push: one run in the background rewrites the objects while they are carried.
execFileSync("git", ["-C", bare, "config", "receive.autogc", "false"]);
execFileSync("git", ["-C", controller, "push", "-q", "--force", bare, "HEAD:refs/heads/main"], { stdio: "pipe" });
head = carry(controller, join(dir, "mesh-controller.git"));
const tar = join(tmpdir(), `mesh-lab-r92-forge-${process.pid}.tar`);
execFileSync("tar", ["-cf", tar, "-C", dir, "."]);
await push(instanceId, FORGE, tar, "/tmp/forge.tar");