mesh-catalog: narrow the placing by a string, which the check's non-strict compile can follow
mesh/merge-gate head 7ee2869d60eb merged into trunk e1c8965ddbf1 — pass: builds mesh-catalog → novox; no bus step; every machine composes with the change a…
mesh/repo-check head 7ee2869d60eb merged into trunk e1c8965ddbf1 — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-…
mesh/delivery superseded: a newer head of the same pull request

This commit is contained in:
jochen
2026-10-14 20:04:37 +02:00
parent 0b74c04aa8
commit 7ee2869d60
3 changed files with 14 additions and 14 deletions
+7 -7
View File
@@ -59,19 +59,19 @@ export const BUILD_EVENTS = [
* version the catalogue calls current.
*/
export function placeable(body: Built):
| { place: true; module: string; commit: string }
| { place: false; why: string; fault: boolean } {
| { placed: "yes"; module: string; commit: string }
| { placed: "no"; why: string; fault: boolean } {
if (body["check-outcome"] != null || body.check != null) {
return { place: false, why: "a merge check or a try: nothing of it merged", fault: false };
return { placed: "no", why: "a merge check or a try: nothing of it merged", fault: false };
}
if (body["dry-run"]) {
return { place: false, why: "a dry run is looked at, never taken in", fault: false };
return { placed: "no", why: "a dry run is looked at, never taken in", fault: false };
}
if (body.failed) {
return { place: false, why: "a failed build made no module-version", fault: false };
return { placed: "no", why: "a failed build made no module-version", fault: false };
}
if (!body.module || !body.commit) {
return { place: false, why: "it named no module or no commit", fault: true };
return { placed: "no", why: "it named no module or no commit", fault: true };
}
return { place: true, module: body.module, commit: body.commit };
return { placed: "yes", module: body.module, commit: body.commit };
}
+1 -1
View File
@@ -33,7 +33,7 @@ const graph = Graph.fromEnv();
const placeTheBuild = async (event: { body: unknown }): Promise<void> => {
const body = (event.body ?? {}) as Built;
const placing = placeable(body);
if (!placing.place) {
if (placing.placed === "no") {
// A check, a try, a dry run and a failure are the build seat's ordinary outcomes: passed over. One
// that names no module or commit is a fault in the builder, said rather than dropped, so it does
// not look like a missing event.
+6 -6
View File
@@ -26,9 +26,9 @@ test("the catalogue hears the build seat that builds now, not only the retired o
});
test("a walk's build is placed, under its module and commit", () => {
assert.deepEqual(placeable(walkBuild), { place: true, module: "mailu", commit: walkBuild.commit });
assert.deepEqual(placeable(walkBuild), { placed: "yes", module: "mailu", commit: walkBuild.commit });
// A walk that took the check's build of the same key says so, and is placed all the same (ADR 0350 §2).
assert.equal(placeable({ ...walkBuild, reused: "the check's build" } as never).place, true);
assert.equal(placeable({ ...walkBuild, reused: "the check's build" } as never).placed, "yes");
});
test("a merge check, a try, a dry run and a failure are passed over without a fault", () => {
@@ -39,8 +39,8 @@ test("a merge check, a try, a dry run and a failure are passed over without a fa
[{ ...walkBuild, failed: "exit status 1" }, "failed"],
] as const) {
const placing = placeable(body);
assert.equal(placing.place, false);
if (!placing.place) {
assert.equal(placing.placed, "no");
if (placing.placed === "no") {
assert.match(placing.why, new RegExp(why));
assert.equal(placing.fault, false);
}
@@ -49,6 +49,6 @@ test("a merge check, a try, a dry run and a failure are passed over without a fa
test("an outcome that names no module or commit is said as the builder's fault", () => {
const placing = placeable({ repository: walkBuild.repository, commit: walkBuild.commit });
assert.equal(placing.place, false);
if (!placing.place) assert.equal(placing.fault, true);
assert.equal(placing.placed, "no");
if (placing.placed === "no") assert.equal(placing.fault, true);
});