gitea: a member whose base is no watched branch is merged plainly with the note, not refused

G1b unwatched-base-merged: judgeMember marks a member plain when its base is no
watched branch, whatever its repository; the note's words are the one constant
for both cases (DQ-49); the refusal row leaves the table and a row is added.

Builds: design 47 H2 H-A-704, H-A-717 (DQ-49)
This commit is contained in:
2026-11-25 17:05:52 +01:00
parent f282a74e59
commit ce04011f96
4 changed files with 30 additions and 29 deletions
+2 -2
View File
@@ -91,9 +91,9 @@ test("a call says one merge-called of what landed; none for a call that landed n
assert.deepEqual(said.map((s) => s.body.members.map((x: any) => x.number)), [[1, 2]]);
assert.equal(said[0].body.refused, undefined, "a member not merged after a stop is no refused member");
assert.deepEqual(await sayUnsaid(calls, say), [], "said once");
// A member merged plainly, its repository having no watched branch, starts no delivery: the start's re-say leaves it
// A member merged plainly, its base being no watched branch, starts no delivery: the start's re-say leaves it
// out by the kept note (design 47 H2 H-A-471 addendum (2)), and a call of such members alone says none.
const noted = { ...m(4, "merged"), repository: "novox/hq", note: "no delivery: the repository has no watched branch" };
const noted = { ...m(4, "merged"), repository: "novox/hq", note: "no delivery: its base is no watched branch" };
await calls.put("00000000000000dd", { by: "lead@shanks", account: "x", at: "2026-11-20T03:02:00Z", members: [noted, m(5, "merged")], said: false } as any);
await calls.put("00000000000000ee", { by: "lead@shanks", account: "x", at: "2026-11-20T03:03:00Z", members: [noted], said: false } as any);
said.length = 0;
+15 -14
View File
@@ -66,7 +66,6 @@ test("a member refused at judging merges none and names every refused member and
{ name: "the second member's head moved", set: (p) => { p["novox/lib#9"].head = MOVED; }, why: /head-moved: its head is cccccccccccc, not the bbbbbbbbbbbb/ },
{ name: "already merged", set: (p) => { Object.assign(p["novox/lib#9"], { merged: true, merge: "e".repeat(40) }); }, why: /already-merged: .* as e{40}/ },
{ name: "closed", set: (p) => { p["novox/lib#9"].state = "closed"; }, why: /is closed/ },
{ name: "a base no registration watches", set: (p) => { p["novox/lib#9"].base = "feat/x"; }, why: /its base feat\/x is no watched branch/ },
{ name: "a required step failed at its head's fingerprint",
set: () => {}, over: { judge: async (h: string) => (h === B ? { run: "main.7", module: "lib", step: "unit", fingerprint: "fp" } : null) },
why: /the unit step of lib failed in run main\.7 at its build-input fingerprint fp/ },
@@ -83,20 +82,22 @@ test("a member refused at judging merges none and names every refused member and
}
});
// **A repository of no module is merged plainly** (design 47 H2 H-A-471 and its addendum): a member whose repository has
// no watched branch (no entry, or an empty set, in the registrations' watched branches) is judged against nothing of the
// **A base no registration watches is merged plainly** (design 47 H2 H-A-471 and its addendum, H-A-704): a member whose base
// is no watched branch, whatever its repository (no entry, an empty set, or a set that does not hold the base, in the
// registrations' watched branches), is judged against nothing of the
// module graph (no failed required step), merged in the order named, answered merged with the note no delivery, and left
// out of merge-called; the watched members of the same call are judged and delivered as any call's. A watched
// repository whose base is unwatched stays refused (the row above).
test("a member of a repository with no watched branch is merged plainly, noted no delivery, and left out of merge-called", async () => {
const NOTE = "no delivery: the repository has no watched branch";
const rows: { name: string; watched: Map<string, Set<string>> }[] = [
{ name: "no entry", watched: new Map([["novox/app", new Set(["main"])]]) },
{ name: "an empty set", watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set<string>()]]) },
// out of merge-called; the watched members of the same call are judged and delivered as any call's.
test("a member whose base is no watched branch is merged plainly, noted no delivery, and left out of merge-called", async () => {
const NOTE = "no delivery: its base is no watched branch";
const rows: { name: string; base: string; watched: Map<string, Set<string>> }[] = [
{ name: "no entry", base: "main", watched: new Map([["novox/app", new Set(["main"])]]) },
{ name: "an empty set", base: "main", watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set<string>()]]) },
{ name: "a watched repository's pull request into a branch it does not watch", base: "feat/x",
watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set(["main"])]]) },
];
for (const r of rows) {
const pulls = open();
pulls["novox/hq#799"] = { base: "main", head: B, state: "open", merged: false };
pulls["novox/hq#799"] = { base: r.base, head: B, state: "open", merged: false };
const f = forge(pulls);
const judged: string[] = [];
const said: any[] = [];
@@ -109,7 +110,7 @@ test("a member of a repository with no watched branch is merged plainly, noted n
assert.equal(got.members[0].state, "judged", r.name);
assert.equal(got.members[1].state, "refused", r.name);
// Without the failed step the call lands both: the unwatched noted, merge-called naming only the watched.
const f2 = forge(Object.assign(open(), { "novox/hq#799": { base: "main", head: B, state: "open", merged: false } }));
const f2 = forge(Object.assign(open(), { "novox/hq#799": { base: r.base, head: B, state: "open", merged: false } }));
said.length = 0;
const landed = await call(f2, mixed, { watched: () => r.watched, say: async (_s: string, body: unknown) => { said.push(body); } });
assert.deepEqual(f2.merges, ["novox/hq#799", "novox/app#5"], `${r.name}: merged in the order named`);
@@ -117,7 +118,7 @@ test("a member of a repository with no watched branch is merged plainly, noted n
[["novox/hq", "merged", NOTE, undefined], ["novox/app", "merged", undefined, undefined]], r.name);
assert.deepEqual(said.map((b) => b.members.map((m: any) => m.repository)), [["novox/app"]], `${r.name}: merge-called leaves it out`);
// A call of unwatched members alone merges and starts no delivery: no merge-called.
const f3 = forge({ "novox/hq#799": { base: "main", head: B, state: "open", merged: false } });
const f3 = forge({ "novox/hq#799": { base: r.base, head: B, state: "open", merged: false } });
said.length = 0;
const alone = await call(f3, { by: "lead@shanks", pulls: [mixed.pulls[0]] }, { watched: () => r.watched,
say: async (_s: string, body: unknown) => { said.push(body); } });
@@ -170,7 +171,7 @@ test("a member is merged plainly only from a watched-branches view read since th
const f3 = forge(pulls());
const landed = await call(f3, hq, { watched: view });
assert.deepEqual([f3.merges, landed.members.map((m: any) => [m.state, m.note])],
[["novox/hq#799", "novox/app#5"], [["merged", "no delivery: the repository has no watched branch"], ["merged", undefined]]]);
[["novox/hq#799", "novox/app#5"], [["merged", "no delivery: its base is no watched branch"], ["merged", undefined]]]);
});
test("a call is refused whole with no proved caller, no by, no registration or no pull request", async () => {