fix: don't report CI as failing for merged/closed PRs

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 <noreply@anthropic.com>
This commit is contained in:
Prateek 2026-02-14 20:13:20 +05:30
parent 77c9411f9c
commit 95dfaa4a7d
1 changed files with 11 additions and 2 deletions

View File

@ -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";