cli, seat, harness: git socket hardening and refusal tests, row 100 (#1594)
Row 93 follow-up: SIGTERM then SIGKILL for host git, rollback-failed, a total body deadline, fetch-aborted for a reviewer gone mid-fetch, working refs first in have, and tests for five untested refusals. Dewey approved in 28226 and Sage in 28225; Sage's full gate passed 16:57:32-17:01:32Z. The host side is live at the next bus restart. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -169,11 +169,16 @@ export async function pushWorking({ path, cap, workspace, task_ref, project, bra
|
||||
// Resolves { project, ref, commit, clone }; ref is the clone's remote ref.
|
||||
export async function fetchReview({ path, cap, workspace, task_ref, request, tmp = "/tmp", env = process.env }) {
|
||||
// Commits the host may leave out: what the clones' remotes already hold.
|
||||
// The working refs come first, newest first, since a review is most often
|
||||
// of a commit built on one; origin's fill what is left of HAVE_MAX.
|
||||
const have = new Set();
|
||||
for (const project of projectsIn(workspace)) {
|
||||
const r = await git(["-C", join(workspace, project), "for-each-ref", "--format=%(objectname)", "refs/remotes/origin", "refs/remotes/working"], env);
|
||||
if (r.ok) for (const oid of r.out.split("\n")) if (OID.test(oid) && have.size < HAVE_MAX) have.add(oid);
|
||||
}
|
||||
const projects = projectsIn(workspace);
|
||||
for (const remote of ["refs/remotes/working", "refs/remotes/origin"])
|
||||
for (const project of projects) {
|
||||
if (have.size >= HAVE_MAX) break;
|
||||
const r = await git(["-C", join(workspace, project), "for-each-ref", "--sort=-committerdate", "--format=%(objectname)", remote], env);
|
||||
if (r.ok) for (const oid of r.out.split("\n")) if (OID.test(oid) && have.size < HAVE_MAX) have.add(oid);
|
||||
}
|
||||
const file = join(tmp, `fetch-${randomBytes(8).toString("hex")}.bundle`);
|
||||
try {
|
||||
const conn = open(path);
|
||||
|
||||
Reference in New Issue
Block a user