feat(FN-4760): complete Step 2 — add PR checks endpoint and client

Fusion-Task-Id: FN-4760
Fusion-Task-Lineage: 71db4a53-ee59-49f0-a1f7-232954b86660
This commit is contained in:
Fusion (runfusion.ai)
2026-05-17 08:32:50 -07:00
committed by gsxdsm
parent ef43957d72
commit 49daa3046d
3 changed files with 221 additions and 0 deletions

View File

@@ -2198,6 +2198,9 @@ export interface PrCheckStatus {
name: string;
required: boolean;
state: string;
detailsUrl?: string;
startedAt?: string;
completedAt?: string;
}
export interface PrStatusResponse {
@@ -2215,6 +2218,12 @@ export interface PrRefreshResponse {
automationStatus?: string | null;
}
export interface PrChecksResponse {
checks: PrCheckStatus[];
rollup: "success" | "pending" | "failure" | "unknown";
lastCheckedAt: string;
}
export interface PrMetadataResponse {
title: string;
body: string;
@@ -2314,6 +2323,11 @@ export function refreshPrStatus(id: string, projectId?: string): Promise<PrRefre
});
}
/** Fetch all PR checks for a task */
export function fetchPrChecks(id: string, projectId?: string): Promise<PrChecksResponse> {
return api<PrChecksResponse>(withProjectId(`/tasks/${id}/pr/checks`, projectId));
}
// --- Issue Management API ---
/** Re-export GitHub badge-related types for convenience */