Check every pull request before it merges, and show the verdict on it (hq ADR 0237, to-be 45 §9)
The forge's announcer announces each new head of an open pull request as pull.updated, once, and marks the head pending; the controller asks the build seat to check it against every machine of the mesh's facts, and says the verdict as checked, which the forge's holder sets as the head commit's status mesh/merge-gate - an error never as a success - with the check's own account as a comment when it is not a pass. merge-check.sh is the catalogue's check: every manifest through the running controller's module check and merge gate, and the Go tests of each module the change touches, a module whose dependencies cannot be fetched said as not tested.
This commit is contained in:
@@ -43,10 +43,21 @@ export interface GiteaPull {
|
||||
merged_at?: string;
|
||||
user?: string;
|
||||
head?: string;
|
||||
/** The commit the pull request's head is at now: what is checked before it merges (novox/hq to-be 45 §9). */
|
||||
head_sha?: string;
|
||||
base?: string;
|
||||
updated_at?: string;
|
||||
html_url: string;
|
||||
}
|
||||
|
||||
/** A commit status, as the forge keeps it: what a pull request shows beside its head commit. */
|
||||
export interface CommitStatus {
|
||||
state: "pending" | "success" | "error" | "failure" | "warning";
|
||||
context: string;
|
||||
description: string;
|
||||
target_url?: string;
|
||||
}
|
||||
|
||||
export interface GiteaComment {
|
||||
id: number;
|
||||
user?: string;
|
||||
@@ -314,6 +325,12 @@ export class GiteaClient {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Set a commit's status — what a pull request whose head it is shows beside it (novox/hq to-be 45 §9).
|
||||
* The forge keeps one per context, the newest, so setting it again replaces it. */
|
||||
async setCommitStatus(owner: string, repo: string, sha: string, status: CommitStatus): Promise<void> {
|
||||
await this.request(`/repos/${owner}/${repo}/statuses/${sha}`, { method: "POST", body: JSON.stringify(status) });
|
||||
}
|
||||
|
||||
async createPullRequest(
|
||||
owner: string,
|
||||
repo: string,
|
||||
@@ -427,7 +444,9 @@ export class GiteaClient {
|
||||
merged_at: p.merged_at ?? undefined,
|
||||
user: p.user?.login,
|
||||
head: p.head?.ref,
|
||||
head_sha: p.head?.sha ?? undefined,
|
||||
base: p.base?.ref,
|
||||
updated_at: p.updated_at ?? undefined,
|
||||
html_url: p.html_url,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user