GIT15: the forge module guesses no base branch for a pull request the forge gave none

The base "main" fallbacks of the open-pulls read and the announcer are gone (the indexer's module name and tool went with GIT10).
The manifest's version is MAN1's, written with the fill's source it needs.

Builds: design 47 G §7, §428

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 11:44:59 +01:00
parent 312d824e4f
commit e6aab55008
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -413,9 +413,10 @@ export class GiteaClient {
const pull = await this.getPullRequest(found.owner, found.name, found.number);
if (pull.state !== "open" || !pull.head_sha) continue;
// The base's protection as the forge applies it to that branch (appliedProtection): readable without administration.
const base = `${full}:${pull.base || "main"}`;
if (!rules.has(base)) rules.set(base, await this.appliedProtection(found.owner, found.name, pull.base || "main").catch(() => undefined));
const rule = rules.get(base);
// A pull request the forge gave no base is not guessed one (design 47 §7): its protection is unknown.
const base = `${full}:${pull.base ?? ""}`;
if (pull.base && !rules.has(base)) rules.set(base, await this.appliedProtection(found.owner, found.name, pull.base).catch(() => undefined));
const rule = pull.base ? rules.get(base) : undefined;
const checks = await this.headChecks(found.owner, found.name, pull.head_sha);
const labels = found.labels ?? [];
out.push({ owner: found.owner, repo: found.name, number: pull.number, base: pull.base ?? "", head: pull.head, head_sha: pull.head_sha,
+1 -1
View File
@@ -275,7 +275,7 @@ async function announceHead(client: GiteaClient, repo: RepoOf, pull: OpenOf): Pr
// where it is: in the build queue from now, until a build machine takes it (novox/hq issue 446). Only where the base
// still requires mesh/merge-gate (issue 1301): a main that requires mesh/check is the checker's;
// a rule that cannot be read is said pending, as before.
const rule = await client.appliedProtection(repo.owner, repo.name, String(pull.base || "main")).catch(() => undefined);
const rule = pull.base ? await client.appliedProtection(repo.owner, repo.name, String(pull.base)).catch(() => undefined) : undefined;
if (writesGate(requiredOf(rule))) await gates.pending(repo.owner, repo.name, sha);
return true;
}