feat(FN-4762): complete Step 3 — PR merge routes and dashboard controls
Fusion-Task-Id: FN-4762 Fusion-Task-Lineage: 5c7ef3b8-fefc-4cc2-a703-634124d77cde
This commit is contained in:
committed by
gsxdsm
parent
102893cba3
commit
73454fae5c
@@ -2219,6 +2219,11 @@ export interface PrRefreshResponse {
|
||||
automationStatus?: string | null;
|
||||
}
|
||||
|
||||
export interface PrMergeResponse {
|
||||
prInfo: PrInfo;
|
||||
alreadyMerged?: boolean;
|
||||
}
|
||||
|
||||
export interface PrChecksResponse {
|
||||
checks: PrCheckStatus[];
|
||||
rollup: "success" | "pending" | "failure" | "unknown";
|
||||
@@ -2349,6 +2354,25 @@ export function refreshPrStatus(id: string, projectId?: string): Promise<PrRefre
|
||||
});
|
||||
}
|
||||
|
||||
export function mergePr(id: string, method?: "merge" | "squash" | "rebase", projectId?: string): Promise<PrMergeResponse> {
|
||||
return api<PrMergeResponse>(withProjectId(`/tasks/${id}/pr/merge`, projectId), {
|
||||
method: "POST",
|
||||
body: JSON.stringify(method ? { method } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
export function setAutoMergeOnGreen(
|
||||
id: string,
|
||||
enabled: boolean,
|
||||
strategy?: "merge" | "squash" | "rebase",
|
||||
projectId?: string,
|
||||
): Promise<{ prInfo: PrInfo }> {
|
||||
return api<{ prInfo: PrInfo }>(withProjectId(`/tasks/${id}/pr/auto-merge`, projectId), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ enabled, strategy }),
|
||||
});
|
||||
}
|
||||
|
||||
/** 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));
|
||||
|
||||
Reference in New Issue
Block a user