Repository navigation
fix(github): classify blocking check conclusions - #11071
Conversation
📝 WalkthroughWalkthroughUpdated 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Co-authored-by: Mubashir Rahim <[email protected]>
b97f1f7 to
34f1ef6
Compare
Greptile SummaryThis PR fixes a gap in the GitHub GraphQL rollup mapper where
Confidence Score: 5/5Safe 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.
|
| 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'"]
Reviews (1): Last reviewed commit: "fix(github): classify all blocking check..." | Re-trigger Greptile
Co-authored-by: Mubashir Rahim <[email protected]>
Summary
Supersedes stale PR #4605: raw GraphQL
ERRORandSTARTUP_FAILUREcheck conclusions now produce a failing PR status in the provider-neutral classifier used by currentmain.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 passedpnpm typecheck— passedpnpm exec oxlint src/shared/pr-check-status.ts src/shared/pr-check-status.test.ts— passedgit diff origin/main...HEAD --check— passedPerformance
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.