Repository navigation
[P2] fix(checks): give the PR page and work-item dialog the shared check-count labels - #11813
Conversation
…eck-count labels Co-authored-by: Orca <[email protected]>
Greptile SummaryThis PR consolidates check-count derivation for the PR page (
Confidence Score: 5/5Safe to merge — the change is purely label/classification consolidation with no new dependencies, no side-effects beyond UI text, and a parity test suite that would catch any future drift. The rewrite of getCheckCounts is mathematically sound: failing = summary.failed − needsAction cannot underflow because action_required is always routed to failed by the shared classifier before the subtraction. All five existing getCheckCounts tests pass unmodified against the new implementation (traced manually), the 14-row parity table now covers both surfaces, and the neutral chip wording is pinned by a literal-string assertion. The i18n consolidation removes exactly the ten per-surface keys that had no remaining referents and adds five correctly-placed replacements in all five locale files. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/pr-check-counts.ts | Replaces the local reduce-based classifier with a delegation to summarizeProviderChecks; adds getCheckCountChips for shared chip rendering. Logic is correct: failing = summary.failed − needsAction cannot go negative because action_required is always in FAILED_CONCLUSIONS. |
| src/renderer/src/components/provider-check-classification-parity.test.ts | Adds getCheckCounts / getCheckCountChips assertions for 14 parity cases, pinning bucket numbers and the literal neutral-chip label string. |
| src/renderer/src/components/PullRequestPage.tsx | Removes the ~45-line inline chip builder and delegates to getCheckCountChips; switches React.Fragment key from chip.label to the stable chip.tone. |
| src/renderer/src/components/GitHubItemDialog.tsx | Identical structural change to PullRequestPage.tsx — inline chip block removed, getCheckCountChips called, React.Fragment key updated. |
| src/renderer/src/i18n/locales/en.json | Removes 10 orphaned per-surface keys and adds 5 consolidated keys under auto.components.pr-check-counts. Consolidation is correct and complete. |
Reviews (1): Last reviewed commit: "[P2] fix(checks): give the PR page and w..." | Re-trigger Greptile
📝 WalkthroughWalkthroughThe change centralizes pull-request check count calculation and chip generation. Both check views now render chips from the shared helper and map colors from chip tones. Provider parity tests cover failed, action-required, and unresolved counts. Locale files add shared translations for all check-count categories and remove duplicated status entries. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f5fdf0e1-089c-40e6-a7e7-c8f261104032
📒 Files selected for processing (9)
src/renderer/src/components/GitHubItemDialog.tsxsrc/renderer/src/components/PullRequestPage.tsxsrc/renderer/src/components/pr-check-counts.tssrc/renderer/src/components/provider-check-classification-parity.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
| "pr-check-counts": { | ||
| "passingChip": "{{value0}} pasando", | ||
| "failingChip": "{{value0}} fallando", | ||
| "pendingChip": "{{value0}} pendiente", | ||
| "needsActionChip": "{{value0}} requiere acción", | ||
| "unresolvedChip": "{{value0}} sin resolver" |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Make the Spanish chip labels count-safe.
{{value0}} pendiente and {{value0}} requiere acción use singular forms when the count is greater than one. {{value0}} pasando and {{value0}} fallando are also not idiomatic status labels in this context. Use the repository’s pluralization convention or count-neutral category labels.
This review uses the PR objective that these strings render check-count chips.
…eck-count labels (stablyai#11813) Co-authored-by: Orca <[email protected]>
Summary
Follow-on to #11700, found by the
v1.4.163-rc.1..v1.4.163-rc.3production release scan. #11700 gave every check surface one shared classifier for the passed bucket, but the PR page and the work-item dialog kept re-deriving the other four buckets locally, and then labelled one of them with a word that is now provably wrong.The mislabel
On
origin/main,PullRequestPage.tsx:5299andGitHubItemDialog.tsxrender the neutral bucket as:But
getCheckCountsalready routesskippedintopassing, because the shared classifier buckets it there:So no skipped check is ever in the bucket labelled "skipped". What is actually in it is
neutralconclusions and GitLabmanualgates. Meanwhile the checks pill on the sidebar, via the sharedgetProviderChecksLabel, calls that same set "Unresolved checks". Same PR, same data, two panes, two different words — one of which is factually incorrect.This is exactly the drift class #11700 set out to remove.
The second classifier
Beyond the label,
getCheckCountsstill hand-rolled the failing / pending / neutral split:That is a third rulebook living next to the shared one, and it is what let the label drift in the first place. It also disagrees with the shared summarizer on inputs the shared one has explicit handling for — an unrecognized conclusion falls into
pendinghere but is classified deliberately there.Fix
pr-check-counts.ts:24—getCheckCountsnow reads every bucket offsummarizeProviderChecks. Onlyaction_requiredis split back out offailed, because it blocks merge like a failure but is rendered amber rather than red.pr-check-counts.ts:41— newgetCheckCountChips(counts)returning{ tone, label }[]. Both panes had a ~45-line copy of the identical chip-building block; both now call this.tonekeys the caller's ownCHECK_COLOR/CHECK_ICONmaps, so styling stays with each surface.{n} unresolved, matchinggetProviderChecksLabel.provider-check-classification-parity.test.ts— both surfaces added to the existing parity assertion list, so a future divergence fails the build.auto.components.pr-check-counts.*keys acrossen/es/ja/ko/zh; the ten now-orphaned per-surface keys deleted.ELI5
A pull request has a list of automated checks. Some pass, some fail, some are still running, some are "skipped — not needed for this change", and a few end in a state that is neither pass nor fail.
Orca counts "skipped" as passed, on purpose: skipping a check is a deliberate "not applicable", not a problem. That decision was made once and put in a shared rulebook.
But the PR page had a leftover summary line that said "3 skipped" — pointing at a group that, because of that very rule, can never contain a skipped check. It was really showing the leftover checks that ended in nothing conclusive. And the sidebar, three inches away, called the exact same group "Unresolved checks".
So: one PR, two panes, two different words, and the more prominent one was describing something that wasn't there. This PR makes both panes say "unresolved", and makes them get their numbers from the same rulebook as everything else instead of a private copy.
Screenshots
The only rendered difference on the PR page and the work-item dialog is the chip's wording:
3 skipped→3 unresolved.The colour is unchanged and this is verifiable from the diff rather than by eye: the old code hardcoded
className: 'text-muted-foreground'for that chip, and the new code resolvesCHECK_COLOR[chip.tone]whereCHECK_COLOR.neutral === 'text-muted-foreground'(right-sidebar/checks-panel-content.tsx:132). Identical string. The other four chips already usedCHECK_COLOR.*and pass through unchanged.Here is the surface, rendered from this branch against a real PR (#11809) in the Electron dev build:
Read this shot honestly: it shows the chip row now produced by the shared
getCheckCountChips—1 passing · 4 action required— and confirms the other four chips render unchanged. It does not show the fix, because this PR has no neutral checks, so the renamed bucket is absent and the before/after would be identical. Reproducing the renamed chip needs a PR with aneutralconclusion or a blocked GitLabmanualgate, which is not something I can conjure on demand against a live repo. Rather than mock one up and present it as a real capture, the wording change is pinned by the 14-row parity table below, which asserts the literal strings both panes emit.Proof of fix
1. The mislabel, straight from
origin/main:skippedis in the passed set, so the chip labelled "skipped" cannot contain one. And the shared label function for the same bucket:2. The parity test fails without the fix. With
pr-check-counts.tsreverted toorigin/mainand the tests kept:All 14 parity rows now cover these two panes; previously none did. The failure is
getCheckCountChips is not a function, i.e. the surfaces were literally not in the parity net before.With the fix restored: 2 files / 20 tests passed.
Proof of no regression
src/renderer/src/components/pr-check-counts.test.tsis the pre-existing suite forgetCheckCountsand is unmodified by this PR. It still passes against the rewritten implementation — the bucket numbers are unchanged for every case it covers; only the source of truth and the neutral chip's wording changed.npx oxfmt --checkandnpx oxlintclean.Behaviour change disclosed
getCheckCountsnow derivesfailingandpendingfromsummarizeProviderChecksrather than its own['failure','cancelled','timed_out']list. For every conclusion the old list named, the result is identical. For conclusions it did not name — unrecognized/unknown values, which the old code silently swept intopending— the shared classifier's deliberate handling now applies instead. That is the intended consequence of removing the third rulebook, and the parity table pins it ('GitLab success alongside an unrecognised conclusion','GitLab canceled job').Testing
pnpm lint— clean (oxlint, type-aware audit, reliability gates, max-lines ratchet, localization catalog/extraction/coverage);oxfmt --checkclean via lint-stagedpnpm typecheck— clean (tsc: node + cli + web)pnpm test(targeted at tip + full desktop suite on the combined tree)pnpm build— not run; no build-graph, packaging, or dependency changeAI Review Report
Reviewed by Claude Opus 5 as part of a 45-agent release scan with adversarial refutation. Risks checked:
manualmaps toneutraland therefore lands in the newly-renamed chip — the wording fix matters more for GitLab than GitHub, since a blocked GitLab pipeline is the most common way to populate that bucket.grepfor each hash acrosssrc/). Non-English locales carry the new keys with translated wording, not English fallbacks.React.Fragment keychanged fromchip.labeltochip.tone.toneis unique per chip by construction (each bucket pushes at most one chip), and it is more stable than the label, which changes with locale and count.Security Audit
eval, no path handling, no IPC, no auth, no secrets.Array.length/filter, and reach the DOM as React text children, so there is no injection surface.Notes
src/shared/pr-check-severity-order.ts; ordering is a separate concern from classification, and [P1] fix(checks): stop skipped and manual checks reporting as failures #11700 already settled it.GitHubItemDialog.tsx(same duplicated block) into the change.Made with Orca 🐋