Skip to content

fix: treat ACTION_REQUIRED/STARTUP_FAILURE/ERROR checks as failing in deriveCheckStatus - #4605

Closed
Mubashirrrr wants to merge 1 commit into
stablyai:mainfrom
Mubashirrrr:fix/pr-check-status-missing-failing-conclusions
Closed

Mubashirrrr wants to merge 1 commit into
stablyai:mainfrom
Mubashirrrr:fix/pr-check-status-missing-failing-conclusions

Conversation

@Mubashirrrr

@Mubashirrrr Mubashirrrr commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

deriveCheckStatus (src/main/github/mappers.ts) classifies a PR's statusCheckRollup into the CheckStatus that drives the right-sidebar checks indicator (PRInfo.checksStatus). For a PR whose only non-passing check reported a conclusion of ACTION_REQUIRED, STARTUP_FAILURE, or ERROR, it returned success — rendering a green check indicator even though the check had not passed.

This also makes two surfaces disagree about the same rollup data: deriveWorkItemCheckSummary (src/main/github/client.ts) already counts those conclusions as failures, so the work-item summary shows failure while the PR card shows success.

Root cause

deriveCheckStatus only treated conclusion ∈ {FAILURE, TIMED_OUT, CANCELLED} (or state ∈ {FAILURE, ERROR}) as failing. GitHub check runs also report ACTION_REQUIRED and STARTUP_FAILURE conclusions, and commit statuses can report an ERROR conclusion — all failing/blocking. The repo's own canonical classifier deriveWorkItemCheckSummary already lists ['FAILURE', 'ERROR', 'TIMED_OUT', 'CANCELLED', 'ACTION_REQUIRED', 'STARTUP_FAILURE']; deriveCheckStatus had drifted from it.

Fix

Add the three missing failing conclusions (ERROR, ACTION_REQUIRED, STARTUP_FAILURE) to deriveCheckStatus so it matches deriveWorkItemCheckSummary. The change is limited to the failing-conclusion condition; passing/pending behaviour is unchanged.

Test

Adds src/main/github/mappers.test.ts covering the previously mis-classified conclusions plus passing/pending/empty baselines. Run with the repo runner:

vitest run --config config/vitest.config.ts src/main/github/mappers.test.ts
  • Before the fix: the ACTION_REQUIRED, STARTUP_FAILURE, ERROR, and mixed-conclusion cases fail (expected 'success' to be 'failure').
  • After the fix: all 8 pass. Related check tests (client-pr-checks, client-pr-check-details, client-work-items) — 30 tests — remain green.

Repro

  1. Open a PR whose check rollup contains a single check with conclusion ACTION_REQUIRED (e.g. a GitHub App requesting action) or STARTUP_FAILURE.
  2. Before this change, the right-sidebar checks indicator shows success (green) even though the check is not passing, while the work-item summary reports a failure for the same PR.

ELI5

PR checks with ACTION_REQUIRED, STARTUP_FAILURE, or ERROR could still show a green success indicator. Those conclusions now count as failing.

… deriveCheckStatus

deriveCheckStatus classifies a PR's statusCheckRollup into the CheckStatus
shown by the right-sidebar "checks" indicator (PRInfo.checksStatus). Its
failing-conclusion set was narrower than the repo's own canonical classifier,
deriveWorkItemCheckSummary in client.ts, which counts FAILURE, ERROR,
TIMED_OUT, CANCELLED, ACTION_REQUIRED and STARTUP_FAILURE as failures.

Because deriveCheckStatus omitted ACTION_REQUIRED, STARTUP_FAILURE and the
ERROR conclusion, a PR whose only non-passing check reported one of those
conclusions fell through to "success" and rendered a green check indicator,
even though the check had not passed. The two surfaces disagreed about the
same rollup data.

Add the three missing failing conclusions so deriveCheckStatus matches
deriveWorkItemCheckSummary. Adds mappers.test.ts covering the previously
mis-classified conclusions (these assertions fail before the change and pass
after) plus passing/pending/empty baselines.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@nwparker

Copy link
Copy Markdown
Contributor

Superseded by #11071, which has now merged the fix against the current shared check-status classifier. Mubashir Rahim is credited as a co-author in the merged commit. Thank you for the original diagnosis and implementation.

@nwparker nwparker closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants