From e6aab55008cb7b56848b76889da937bf7cf123de Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 11:44:59 +0100 Subject: [PATCH] GIT15: the forge module guesses no base branch for a pull request the forge gave none MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/gitea/client.ts | 7 ++++--- modules/gitea/index.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/gitea/client.ts b/modules/gitea/client.ts index 78648b3fb..d7402f378 100644 --- a/modules/gitea/client.ts +++ b/modules/gitea/client.ts @@ -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, diff --git a/modules/gitea/index.ts b/modules/gitea/index.ts index 37c897c3a..d5ff40722 100644 --- a/modules/gitea/index.ts +++ b/modules/gitea/index.ts @@ -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; }