Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/label-pr-review-state.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ jobs:
'coderabbit-changes': 'Address CodeRabbit findings and push an update. Review restarts after CI passes.',
coderabbit: 'Required CI passed. Wait for CodeRabbit to approve the latest commit.',
'draft-approved': 'CodeRabbit approved the latest commit. Mark the draft ready.',
'fork-approved': 'Fork review completed. Native GitHub review protections remain authoritative.',
'maintainer-changes': 'Address the maintainer feedback, push an update, and request another review.',
maintainer: 'Ready for human maintainer review and approval.',
approved: 'The required review sequence passed. Remaining merge requirements apply.',
Expand Down Expand Up @@ -676,11 +675,7 @@ jobs:
}
await reconcileLabels(pr, desiredLabel);
if (readyForMaintainer) {
if (isForkPR(pr)) {
await updateReviewGate(pr, 'fork-approved', false);
} else {
await updateReviewGate(pr, phase, true);
}
await updateReviewGate(pr, phase, true);
}
} catch (error) {
let invalidationError = null;
Expand Down
13 changes: 3 additions & 10 deletions src/services/__tests__/pr-review-state-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,29 +1386,22 @@ describe("PR review-state workflow", () => {
expect(result.addLabels).toHaveBeenCalledWith(expect.objectContaining({ labels: ["coderabbit-review-active"] }))
})

it("keeps fork review gates pending after approval", async () => {
it("passes fork review gates at the maintainer handoff", async () => {
const result = await runWorkflow({
eventName: "schedule",
fork: true,
permissions: { maintainer: "write" },
reviews: [
{
login: "coderabbitai[bot]",
type: "Bot",
state: "APPROVED",
submittedAt: REVIEWED_AT,
},
{
login: "maintainer",
type: "User",
state: "APPROVED",
submittedAt: REVIEWED_AT + 1_000,
},
],
})

expect(latestGateStatus(result)?.state).toBe("pending")
expect(latestGateStatus(result)?.description).toContain("Native GitHub review protections")
expect(latestGateStatus(result)?.state).toBe("success")
expect(latestGateStatus(result)?.description).toContain("Ready for human maintainer")
})

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