Skip to content

fix(github): classify blocking check conclusions - #11071

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-check-rollup-failure-conclusions
Jul 31, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-check-rollup-failure-conclusions

Conversation

@nwparker

@nwparker nwparker commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Supersedes stale PR #4605: raw GraphQL ERROR and STARTUP_FAILURE check conclusions now produce a failing PR status in the provider-neutral classifier used by current main.

ELI5

If GitHub says a check errored or could not start, Orca now shows it as failed instead of neutral/green.

Fix proof

Shared classifier tests cover both raw conclusions and return failure.

0 regressions / risk

YES — two constant-time comparisons in existing rollup normalization only. No IPC, SSH, folder-workspace, provider-routing, path, Git command, or platform-specific behavior changed.

Attribution

Co-authored-by: Mubashir Rahim [email protected], original author of #4605.

Tests

  • pnpm exec vitest run src/shared/pr-check-status.test.ts --reporter=dot — 5 passed
  • pnpm typecheck — passed
  • pnpm exec oxlint src/shared/pr-check-status.ts src/shared/pr-check-status.test.ts — passed
  • git diff origin/main...HEAD --check — passed

Performance

Existing O(n) normalization gains two constant-time comparisons per check; no allocation, I/O, or network work was added.

Linked issue(s)

None supplied; supersedes standalone bug PR #4605.

Evidence

Data mapping only; no visual surface or screenshot applies.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated deriveCheckStatus so completed checks with ERROR or STARTUP_FAILURE conclusions return failure, alongside existing failure conclusions. Added parameterized tests covering both new conclusion values.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fix and tests, but omits the required AI Review Report and Security Audit sections and does not complete the testing checklist. Add the required AI Review Report, Security Audit, and Notes sections, and complete each applicable testing checklist item.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the change to classify blocking GitHub check conclusions.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the nwparker/fix-check-rollup-failure-conclusions branch from b97f1f7 to 34f1ef6 Compare July 31, 2026 01:16
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a gap in the GitHub GraphQL rollup mapper where ERROR and STARTUP_FAILURE check conclusions were silently passed through as unknown strings, causing them to render as neutral/green instead of blocking the PR.

  • pr-check-status.ts: normalizeRollupCheck now short-circuits on lowercased 'error' or 'startup_failure' conclusions before the existing passthrough, returning 'failure'. The rest of the chain — isPending detection, derivePRCheckStatus — is unchanged.
  • pr-check-status.test.ts: An it.each test exercises both raw uppercase strings ('ERROR', 'STARTUP_FAILURE') through derivePRCheckStatusFromRollup, confirming 'failure' is returned end-to-end.

Confidence Score: 5/5

Safe to merge — the change is a two-condition early-exit that corrects a gap in conclusion normalization, with no effect on other code paths.

The fix is minimal and self-contained: two string comparisons added before the existing passthrough logic in normalizeRollupCheck. All surrounding logic (isPending detection, the state fallback, derivePRCheckStatus itself) is untouched. The new it.each test exercises both uppercase raw values through the full derivePRCheckStatusFromRollup chain and confirms failure is returned. The mapCheckConclusion path and conclusionMap for the REST path already handle startup_failure, so this fills the last gap in the GraphQL rollup path consistently.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/shared/pr-check-status.ts Adds early-exit mapping of lowercased 'error' and 'startup_failure' conclusions to 'failure' in normalizeRollupCheck, before the existing passthrough/state-fallback logic. Change is correct and minimal.
src/shared/pr-check-status.test.ts Adds parameterized it.each test covering both ERROR and STARTUP_FAILURE raw conclusions via derivePRCheckStatusFromRollup; correctly exercises the new mapping path end-to-end.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Raw GraphQL rollup entry\n{status, conclusion, state}"] --> B["normalizeRollupCheck\n(toLowerCase all fields)"]
    B --> C{conclusion === 'error'\nor 'startup_failure'?}
    C -- YES --> D["normalizedConclusion = 'failure'"]
    C -- NO --> E{conclusion truthy?}
    E -- YES --> F["normalizedConclusion = conclusion\n(passthrough)"]
    E -- NO --> G{state === 'failure'\nor 'error'?}
    G -- YES --> H["normalizedConclusion = 'failure'"]
    G -- NO --> I{state === 'success'?}
    I -- YES --> J["normalizedConclusion = 'success'"]
    I -- NO --> K["normalizedConclusion = ''"]
    D --> L["derivePRCheckStatus(checks)"]
    F --> L
    H --> L
    J --> L
    K --> L
    L --> M{any conclusion\n=== 'failure'?}
    M -- YES --> N["return 'failure'"]
    M -- NO --> O["return 'pending'/'success'/'neutral'"]
Loading

Reviews (1): Last reviewed commit: "fix(github): classify all blocking check..." | Re-trigger Greptile

@nwparker
nwparker merged commit 554892b into main Jul 31, 2026
41 checks passed
@nwparker
nwparker deleted the nwparker/fix-check-rollup-failure-conclusions branch July 31, 2026 01:19
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant