From 95dfaa4a7d8720b704f9bf41600c0099f3d1fdcc Mon Sep 17 00:00:00 2001 From: Prateek Date: Sat, 14 Feb 2026 20:13:20 +0530 Subject: [PATCH] fix: don't report CI as failing for merged/closed PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getCISummary() was returning "failing" whenever getCIChecks() threw an error, even for merged PRs where GitHub may not return check data. This caused the dashboard to show "CI failing" for merged PRs. Now checks PR state before fail-closing — merged/closed PRs return "none" instead of "failing". Co-Authored-By: Claude Sonnet 4.5 --- packages/plugins/scm-github/src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/plugins/scm-github/src/index.ts b/packages/plugins/scm-github/src/index.ts index a09d9ca6b..75b4480d7 100644 --- a/packages/plugins/scm-github/src/index.ts +++ b/packages/plugins/scm-github/src/index.ts @@ -267,8 +267,17 @@ function createGitHubSCM(): SCM { try { checks = await this.getCIChecks(pr); } catch { - // Fail closed: if we can't fetch CI status, report as failing - // rather than "none" (which getMergeability treats as passing). + // Before fail-closing, check if the PR is merged/closed — + // GitHub may not return check data for those, and reporting + // "failing" for a merged PR is wrong. + try { + const state = await this.getPRState(pr); + if (state === "merged" || state === "closed") return "none"; + } catch { + // Can't determine state either; fall through to fail-closed. + } + // Fail closed for open PRs: report as failing rather than + // "none" (which getMergeability treats as passing). return "failing"; } if (checks.length === 0) return "none";