feat(FN-4761): sync PR reviews and surface review threads

Fusion-Task-Id: FN-4761
Fusion-Task-Lineage: b6b1ed73-c396-4dd2-b97f-366272d05c7f
This commit is contained in:
Fusion (runfusion.ai)
2026-05-17 10:45:52 -07:00
committed by gsxdsm
parent cfadcf3835
commit 5bde911bdb
8 changed files with 420 additions and 11 deletions

View File

@@ -2224,6 +2224,31 @@ export interface PrChecksResponse {
lastCheckedAt: string;
}
export interface PrReviewThreadItem {
id: string;
author: string;
text: string;
source?: "github-review" | "github-review-comment";
externalId?: string;
reviewState?: "APPROVED" | "CHANGES_REQUESTED" | "COMMENTED";
createdAt: string;
}
export interface PrReviewsResponse {
snapshot: {
decision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | null;
items: Array<{
id: string;
author: { login: string };
body: string;
state?: string;
htmlUrl?: string;
createdAt: string;
}>;
};
comments: PrReviewThreadItem[];
}
export interface PrMetadataResponse {
title: string;
body: string;
@@ -2328,6 +2353,10 @@ export function fetchPrChecks(id: string, projectId?: string): Promise<PrChecksR
return api<PrChecksResponse>(withProjectId(`/tasks/${id}/pr/checks`, projectId));
}
export function fetchPrReviews(id: string, projectId?: string): Promise<PrReviewsResponse> {
return api<PrReviewsResponse>(withProjectId(`/tasks/${id}/pr/reviews`, projectId));
}
// --- Issue Management API ---
/** Re-export GitHub badge-related types for convenience */