Skip to content

Commit 8ec3ac7

Browse files
committed
fix: let reviewed fork PRs enter merge queue
1 parent ad05c1c commit 8ec3ac7

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

‎.github/workflows/label-pr-review-state.yml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ jobs:
289289
'coderabbit-changes': 'Address CodeRabbit findings and push an update. Review restarts after CI passes.',
290290
coderabbit: 'Required CI passed. Wait for CodeRabbit to approve the latest commit.',
291291
'draft-approved': 'CodeRabbit approved the latest commit. Mark the draft ready.',
292-
'fork-approved': 'Fork review completed. Native GitHub review protections remain authoritative.',
293292
'maintainer-changes': 'Address the maintainer feedback, push an update, and request another review.',
294293
maintainer: 'Ready for human maintainer review and approval.',
295294
approved: 'The required review sequence passed. Remaining merge requirements apply.',
@@ -676,11 +675,7 @@ jobs:
676675
}
677676
await reconcileLabels(pr, desiredLabel);
678677
if (readyForMaintainer) {
679-
if (isForkPR(pr)) {
680-
await updateReviewGate(pr, 'fork-approved', false);
681-
} else {
682-
await updateReviewGate(pr, phase, true);
683-
}
678+
await updateReviewGate(pr, phase, true);
684679
}
685680
} catch (error) {
686681
let invalidationError = null;

‎src/services/__tests__/pr-review-state-workflow.test.ts‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,29 +1386,22 @@ describe("PR review-state workflow", () => {
13861386
expect(result.addLabels).toHaveBeenCalledWith(expect.objectContaining({ labels: ["coderabbit-review-active"] }))
13871387
})
13881388

1389-
it("keeps fork review gates pending after approval", async () => {
1389+
it("passes fork review gates at the maintainer handoff", async () => {
13901390
const result = await runWorkflow({
13911391
eventName: "schedule",
13921392
fork: true,
1393-
permissions: { maintainer: "write" },
13941393
reviews: [
13951394
{
13961395
login: "coderabbitai[bot]",
13971396
type: "Bot",
13981397
state: "APPROVED",
13991398
submittedAt: REVIEWED_AT,
14001399
},
1401-
{
1402-
login: "maintainer",
1403-
type: "User",
1404-
state: "APPROVED",
1405-
submittedAt: REVIEWED_AT + 1_000,
1406-
},
14071400
],
14081401
})
14091402

1410-
expect(latestGateStatus(result)?.state).toBe("pending")
1411-
expect(latestGateStatus(result)?.description).toContain("Native GitHub review protections")
1403+
expect(latestGateStatus(result)?.state).toBe("success")
1404+
expect(latestGateStatus(result)?.description).toContain("Ready for human maintainer")
14121405
})
14131406

14141407
it("fails closed when branch rules are unavailable", async () => {

0 commit comments

Comments
 (0)