Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

13 linesCodeBlameRaw
1/** Branch health and deployed-code checks refer to different commits after a no-op deploy. */
2export function projectCheckSections(head: string | null | undefined, branch: string | null | undefined, deployed: string | null | undefined) {
3 const sections: { kind: "branch" | "production"; label: string; sha: string }[] = [];
4 if (head) sections.push({ kind: "branch", label: `Latest on ${branch ?? "default branch"}`, sha: head });
5 if (deployed && deployed !== head) sections.push({ kind: "production", label: "Checks for deployed commit", sha: deployed });
6 return sections;
7}
8
9/** A retry of the same SHA is still a separate attempt, including when no deployment ID was returned. */
10export function hasSeparateAttempt(currentId: string | null | undefined, servingSha: string | null | undefined, latest: { id: string; sha: string; state: string }): boolean {
11 if (!servingSha) return false;
12 return currentId ? latest.id !== currentId : latest.sha !== servingSha || latest.state !== "success";
13}