From bc84b09274aba17cd7636e322ed9986ed1474cbd Mon Sep 17 00:00:00 2001 From: Prateek Date: Sat, 14 Feb 2026 15:10:36 +0530 Subject: [PATCH] fix: map CANCELLED and ACTION_REQUIRED CI conclusions to failed Terminal check conclusions (CANCELLED, ACTION_REQUIRED) were falling through to "pending", causing the lifecycle manager to wait forever. Also changed the default else branch to "failed" (fail-closed). Co-Authored-By: Claude Opus 4.6 --- packages/plugins/scm-github/src/index.ts | 10 ++++++++-- packages/plugins/scm-github/test/index.test.ts | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/plugins/scm-github/src/index.ts b/packages/plugins/scm-github/src/index.ts index 3284ee59d..66170f31d 100644 --- a/packages/plugins/scm-github/src/index.ts +++ b/packages/plugins/scm-github/src/index.ts @@ -205,12 +205,18 @@ function createGitHubSCM(): SCM { status = "running"; } else if (conclusion === "SUCCESS") { status = "passed"; - } else if (conclusion === "FAILURE" || conclusion === "TIMED_OUT") { + } else if ( + conclusion === "FAILURE" || + conclusion === "TIMED_OUT" || + conclusion === "CANCELLED" || + conclusion === "ACTION_REQUIRED" + ) { status = "failed"; } else if (conclusion === "SKIPPED" || conclusion === "NEUTRAL") { status = "skipped"; } else { - status = "pending"; + // Unknown conclusion on a completed check — fail closed + status = "failed"; } return { diff --git a/packages/plugins/scm-github/test/index.test.ts b/packages/plugins/scm-github/test/index.test.ts index defe1fd17..e44842b68 100644 --- a/packages/plugins/scm-github/test/index.test.ts +++ b/packages/plugins/scm-github/test/index.test.ts @@ -249,10 +249,12 @@ describe("scm-github plugin", () => { { name: "neutral", state: "COMPLETED", conclusion: "NEUTRAL", detailsUrl: "", startedAt: "", completedAt: "" }, { name: "timeout", state: "COMPLETED", conclusion: "TIMED_OUT", detailsUrl: "", startedAt: "", completedAt: "" }, { name: "queued", state: "QUEUED", conclusion: "", detailsUrl: "", startedAt: "", completedAt: "" }, + { name: "cancelled", state: "COMPLETED", conclusion: "CANCELLED", detailsUrl: "", startedAt: "", completedAt: "" }, + { name: "action_req", state: "COMPLETED", conclusion: "ACTION_REQUIRED", detailsUrl: "", startedAt: "", completedAt: "" }, ]); const checks = await scm.getCIChecks(pr); - expect(checks).toHaveLength(8); + expect(checks).toHaveLength(10); expect(checks[0].status).toBe("passed"); expect(checks[0].url).toBe("https://ci/1"); expect(checks[1].status).toBe("failed"); @@ -262,6 +264,8 @@ describe("scm-github plugin", () => { expect(checks[5].status).toBe("skipped"); expect(checks[6].status).toBe("failed"); expect(checks[7].status).toBe("pending"); + expect(checks[8].status).toBe("failed"); // CANCELLED + expect(checks[9].status).toBe("failed"); // ACTION_REQUIRED }); it("throws on error (fail-closed)", async () => {