Skip to content

[P2] fix(mobile): put the PR sidebar and branch chip on the shared check classifier - #11815

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-mobile-check-classification-parity
Jul 31, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-mobile-check-classification-parity

Conversation

@nwparker

@nwparker nwparker commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-on to #11700, found by the v1.4.163-rc.1..v1.4.163-rc.3 production release scan (independently corroborated by an external scan, then verified against the source at the target ref).

#11700 moved every desktop check surface onto one shared classifier and left mobile behind. Mobile kept a second copy of the rules, so the same PR reads differently depending on which mobile surface you look at — and one mobile surface contradicts another.

Three concrete defects

1. skipped counts as unresolved on mobile, passed on desktop. pr-checks-presentation.ts had its own SUCCESS_CONCLUSIONS = new Set(['success']), while the shared classifier is new Set(['success', 'skipped']). A PR with 2 successes and 1 skipped check renders 2/3 on the mobile branch chip and 3/3 in the desktop header and the mobile tasks grid.

2. A PR whose checks all resolved to nothing renders as "No checks". buildChipRollup fell through to { text: 'No checks' } whenever passed, pending and failed were all zero — which is also true when there are checks and they all came back neutral. That is a different fact being reported as the same fact. With the shared classifier a 2-skipped PR now reads 2/2, and a genuinely all-neutral PR reads "Unresolved checks".

3. action_required is dropped at the parsing boundary. readCheckRunConclusion in github-pr-value-readers.ts did not list action_required among the accepted values, so it returned null. PRCheckDetail['conclusion'] allows it (src/shared/types.ts:1400), the host emits it (src/main/github/mappers.ts:26), and the host synthesizes suites carrying it (src/main/github/client.ts:3425, :3551). The shared classifier treats it as a failure, because it blocks merge.

Defect 3 is the sharpest: a merge-blocking approval gate arrived as a null conclusion, was read as "still pending", and — with a passing check alongside it — the chip rendered green 1/2 for a PR that desktop correctly showed as failing.

Fix

  • pr-checks-presentation.ts:2-37 — deleted the local SUCCESS_CONCLUSIONS / FAILURE_CONCLUSIONS sets; checkOutcome now delegates to classifyCheckOutcome through a passed|failed|pending|neutral → success|failure|pending|neutral name map. Mobile's own outcome vocabulary is preserved; only the rules move.
  • pr-checks-presentation.ts:66-102 — summarizePRChecks takes its counts and its worst-case rollup from summarizeProviderChecks. Only the label wording stays mobile's.
  • pr-checks-presentation.ts:119 — added case 'action_required': return 'Action required' to checkStatusLabel, so the per-check row has a name for it.
  • mobile-pr-chip-summary.ts:94 — the branch chip reads summarizeProviderChecks directly, and distinguishes "no checks" from "checks that resolved to nothing actionable".
  • github-pr-value-readers.ts:85 — action_required accepted.

ELI5

Your PR has a list of automated checks, and Orca shows you a little summary badge. Desktop and mobile were reading that list with two different rulebooks, so they gave different answers about the same PR:

  • Desktop counts a skipped check as fine — skipping is a deliberate "not needed here". Mobile counted it as not-fine, so a perfectly green PR showed 2/3 on your phone and 3/3 on your laptop. Worse, mobile disagreed with itself: the tasks grid said 2/2 passed while the branch card said "No checks", for one PR.
  • If every check came back inconclusive, mobile said "No checks" — but there were checks; they just didn't decide anything. Those are two different situations and you should be able to tell them apart.
  • Worst one: GitHub has a check type that means "a human has to approve this before it can merge". Mobile's reader didn't recognise it, threw it away, and treated it as "still running". So a PR that was actually blocked showed a green badge on your phone.

This PR deletes mobile's private rulebook and points it at the shared one, so both devices describe the same PR the same way.

Screenshots

Not captured. These surfaces are React Native (mobile/), not the Electron renderer, so the /electron CDP screenshot workflow does not reach them and the desktop dev build cannot render them. Rather than substitute a recreated or mocked image, the visible change is stated exactly and pinned by assertions on the rendered chip objects:

Scenario Before After
2 success + 1 skipped { kind: 'passed', text: '2/3' } { kind: 'passed', text: '3/3' }
1 success + 1 action_required { kind: 'passed', text: '1/2' } green { kind: 'failing', … } red
2 checks, both neutral { kind: 'none', text: 'No checks' } { kind: 'none', text: 'Unresolved checks' }

These are the literal expected/actual values from the test run below, not a description of them.

Proof of fix

With the three production files reverted to origin/main and the tests kept — npx vitest run --config mobile/vitest.config.ts:

 × counts skipped as passed so the sidebar matches desktop and the tasks grid
 × rolls up passed checks as passed/total, counting skipped as passed
 × treats a merge-blocking action_required gate as failing, not passing
 × maps a merge-blocking action_required gate to failure
 × maps skipped to success and neutral to neutral (desktop parity)
 × distinguishes checks that resolved to nothing actionable from having no checks
 × treats a completed null-conclusion check as neutral, not failure
 × keeps action_required so it still classifies as a failure

AssertionError: expected { kind: 'passed', text: '2/3', …(1) } to deeply equal { kind: 'passed', text: '3/3', …(1) }
AssertionError: expected { kind: 'passed', text: '1/2', …(1) } to deeply equal { kind: 'failing', …(2) }
AssertionError: expected { kind: 'none', …(2) } to deeply equal { kind: 'none', …(2) }
AssertionError: expected null to be 'action_required' // Object.is equality
AssertionError: expected 'pending' to be 'neutral' // Object.is equality
AssertionError: expected 'neutral' to be 'failure' // Object.is equality
AssertionError: expected 'neutral' to be 'success' // Object.is equality
AssertionError: expected { total: 3, passed: 2, …(4) } to match object { total: 3, passed: 3, …(1) }

 Test Files  3 failed (3)
      Tests  8 failed | 33 passed (41)

Every one of the three defects reproduces as a distinct assertion. With the fix restored: 3 files / 41 tests passed.

Proof of no regression

  • Targeted mobile suite at branch tip: 3 files / 41 tests passed.
  • Full desktop suite on the merged tree containing all eight scan fixes: 359 files / 3830 tests passed (this PR touches no desktop production file, but it imports src/shared/provider-check-summary.ts, so the desktop consumers of that module were re-run).
  • npx oxfmt --check and npx oxlint clean.
  • No max-lines disable or mobile/.oxlintrc.json bump added; pr-checks-presentation.ts gets shorter (−34 net), since the local classifier is deleted rather than added to.
  • No persisted state, schema, migration, or wire contract is touched — this is presentation logic over data the client already receives, so there is no mobile back-compat or rollback exposure.

Visible mobile behaviour changes beyond the reported bug — disclosed

Delegating to the shared classifier necessarily changes three more things, all of which are the shared rulebook's existing, deliberate answers:

  1. A completed check with a null conclusion now reads neutral (grey) instead of pending (amber). Mobile previously called it pending; it is finished, so it is not pending.
  2. skipped sorts to the bottom of the checks list with the other non-blocking outcomes, rather than among successes.
  3. An all-neutral PR reads "Unresolved checks" rather than "No checks" (defect 2 above).

Testing

  • pnpm lint — clean (oxlint, type-aware audit, reliability gates, max-lines ratchet, localization catalog/extraction/coverage); oxfmt --check clean via lint-staged
  • pnpm typecheck (desktop) — clean (tsc: node + cli + web); covers src/shared/provider-check-summary.ts, the module this PR newly depends on
  • mobile/ tsc --noEmit — not run. mobile/node_modules is empty in this worktree, so the mobile TypeScript program cannot resolve expo, react-native, or its other types. Needs CI or a pnpm install in mobile/ to be meaningful; saying it passed would be a fabrication
  • pnpm test — mobile targeted files, plus the full desktop suite for shared-module consumers
  • pnpm build — not run; no build-graph, packaging, or dependency change
  • Added or updated high-quality tests that would catch regressions

Mobile test environment caveat, stated plainly: mobile/node_modules is empty in this worktree, so mobile/vitest.config.ts cannot resolve expo/tsconfig.base.json. The three files above were run by temporarily stubbing that single file and removing the stub afterwards; the worktree was left exactly as found. A full mobile/ suite run in this worktree produces 82 file-level failures, all Cannot find module for uninstalled packages, plus one genuine test failure in mobile/src/mock-server-key-pair.test.ts ("makes concurrent creators converge on the persisted winner"). That failure was proven pre-existing and unrelated by stashing mobile/src and re-running: it still fails. Neither is caused by this PR, and both should be confirmed against CI's installed environment.

AI Review Report

Reviewed by Claude Opus 5 as part of a 45-agent release scan with adversarial refutation. Two independent verifiers initially split on the severity of the action_required defect and an adjudicator settled it. Risks checked:

  • Provider neutrality: GitLab reaches these surfaces through the same PRCheckDetail shape, and GitLab manual gates map to neutral. Delegating to the shared classifier means the mobile chip now agrees with desktop on blocked GitLab pipelines as well.
  • Mobile back-compat: applied mobile-backcompat-review. No persisted state, cached schema, settings key, or relay wire contract is touched; a rollback to a prior mobile build simply restores the old presentation of the same server data. No migration needed.
  • Cross-platform: iOS and Android share this TypeScript; no native module, platform branch, or path handling involved.
  • Blast radius of the deleted local classifier: all callers of checkOutcome and summarizePRChecks were traced. mobile-pr-chip-summary.ts was the one that needed a corresponding change (it now calls summarizeProviderChecks directly rather than going through summarizePRChecks, since it only needs the counts); the checks-list rows and the sort order follow from checkOutcome and were re-asserted.
  • Merge affordances are unaffected. buildChipRollup feeds a label and a colour token only; mobile merge gating lives in pr-auto-merge-availability.ts, which does not read it. That is why these are P2 and not P1 — the wrong badge misinforms, it does not enable a bad merge.

Security Audit

  • No new dependencies, no lockfile change, no install hooks.
  • No shell execution, no eval, no path handling, no auth, no secrets.
  • The one input-handling change is a widening, so it was checked directly: readCheckRunConclusion now accepts one additional literal, 'action_required'. It remains an exact-match allowlist against a closed set of string literals with a null fallback for everything else — the parser is not loosened structurally, and no untrusted value can now reach a wider code path than before. The value is only ever compared against sets and used to pick a label and a colour token.
  • Data flows from the GitHub/GitLab API through the relay to the mobile client; this PR does not change what is fetched, stored, or transmitted.

Notes

  • This is presentation-only. It changes what the user is told about a PR, not what Orca will let them do to it.
  • Scope grew beyond the reported symptom: the external scan reported the 2/3 arithmetic and the dropped action_required. Both turned out to be instances of the same root cause — a duplicated classifier — so the fix removes the duplicate rather than patching the two symptoms, which also resolved the "No checks" mislabel that neither scan had flagged.

Made with Orca 🐋

@nwparker
nwparker merged commit a51248e into main Jul 31, 2026
43 checks passed
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR unifies mobile's PR-check classifier with the shared desktop classifier, eliminating three concrete display inconsistencies: skipped checks counted as unresolved on mobile, action_required conclusions silently dropped at the parsing boundary, and all-neutral checks misreported as "No checks".

  • pr-checks-presentation.ts: Removes the local SUCCESS_CONCLUSIONS/FAILURE_CONCLUSIONS sets; checkOutcome and summarizePRChecks now delegate to classifyCheckOutcome/summarizeProviderChecks from the shared module, keeping only the mobile label wording.
  • mobile-pr-chip-summary.ts: buildChipRollup calls summarizeProviderChecks directly, and the fallback text now distinguishes total === 0 ("No checks") from total > 0 ("Unresolved checks").
  • github-pr-value-readers.ts: readCheckRunConclusion now accepts action_required, preventing it from silently collapsing to null and masking a merge-blocking gate as pending.

Confidence Score: 5/5

Safe to merge — all changes are presentation-only, touch no persisted state, and fix real display bugs that caused mobile to contradict desktop and itself.

The three defects are well-characterized and the fixes are targeted: a two-entry allowlist addition in the parser, a deletion of a duplicate classifier, and a one-line text disambiguation. The OUTCOME_BY_SHARED and OUTCOME_BY_STATE mapping tables are typed as exhaustive Record<…> so any future addition to the shared CheckOutcome union will surface as a type error rather than a silent fallthrough. Tests cover all three production failure scenarios with before/after assertions. No schema, wire contract, or persisted state is touched.

Files Needing Attention: No files require special attention. The shared module src/shared/provider-check-summary.ts is read-only from this PR's perspective and is well-tested by the existing desktop suite.

Important Files Changed

Filename Overview
mobile/src/components/pr-sidebar/pr-checks-presentation.ts Removes the local classifier sets and delegates to the shared module; mapping tables are exhaustive (typed as Record<…>) and the label-building logic is unchanged.
mobile/src/source-control/mobile-pr-chip-summary.ts Switches buildChipRollup to use summarizeProviderChecks directly and correctly distinguishes empty-check-list from all-neutral-check-list in the fallback text.
mobile/src/session/github-pr-value-readers.ts Adds action_required to the conclusion allowlist so merge-blocking gates survive the parsing boundary and reach the shared classifier as failures.
mobile/src/components/pr-sidebar/pr-checks-presentation.test.ts Tests updated and new cases added covering all three defects; the neutral-only set test correctly removes skipped (which now counts as passed).
mobile/src/source-control/mobile-pr-chip-summary.test.ts Three new tests verify the three defect scenarios (skipped counting, action_required failing, neutral-only label), complementing the existing coverage well.
mobile/src/session/github-pr-value-readers.test.ts New readCheckRunConclusion test block validates that action_required survives parsing and reaches the shared classifier as a failure; round-trip verified.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GitHub API\ncheck run data] --> B[readCheckRunConclusion\ngithub-pr-value-readers.ts]
    B -->|action_required now preserved\nwas: dropped → null| C[PRCheckDetail\nconclusion field]
    C --> D{Surface}
    D -->|Mobile chip\nbuildChipRollup| E[summarizeProviderChecks\nshared module]
    D -->|Mobile sidebar\nsummarizePRChecks| F[summarizeProviderChecks\nshared module]
    D -->|Desktop| G[summarizeProviderChecks\nshared module]
    E --> H[classifyCheckOutcome\nskipped→passed\naction_required→failed]
    F --> H
    G --> H
    H --> I[Single consistent\ncheck result]
    I -->|Before fix: mobile used\nlocal sets — skipped→neutral\naction_required→pending| J[❌ Inconsistent\nbetween surfaces]
    I -->|After fix: all surfaces\nuse shared classifier| K[✅ Consistent\nacross desktop & mobile]
Loading

Reviews (1): Last reviewed commit: "[P2] fix(mobile): put the PR sidebar and..." | Re-trigger Greptile

@nwparker
nwparker deleted the nwparker/fix-mobile-check-classification-parity branch July 31, 2026 21:05
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Mobile check handling now uses shared classification and summary logic. The reader preserves action_required conclusions. Sidebar presentation treats skipped checks as passed, null conclusions as neutral, and action-required checks as failed. Sidebar labels include Action required. Chip rollups use shared summaries and distinguish empty checks from unresolved checks. Tests cover these outcomes and summary labels.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: moving mobile PR check surfaces to the shared classifier.
Description check ✅ Passed The description covers the required sections, user-visible changes, testing, review, security, platform considerations, and known limitations.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4171375e-7f87-4fbf-bf8b-553ff28688e3

📥 Commits

Reviewing files that changed from the base of the PR and between e698241 and 09ff3e1.

📒 Files selected for processing (6)
  • mobile/src/components/pr-sidebar/pr-checks-presentation.test.ts
  • mobile/src/components/pr-sidebar/pr-checks-presentation.ts
  • mobile/src/session/github-pr-value-readers.test.ts
  • mobile/src/session/github-pr-value-readers.ts
  • mobile/src/source-control/mobile-pr-chip-summary.test.ts
  • mobile/src/source-control/mobile-pr-chip-summary.ts

Comment on lines +37 to +42
describe('readCheckRunConclusion', () => {
it('keeps every conclusion the shared classifier can act on', () => {
for (const conclusion of ['success', 'failure', 'cancelled', 'timed_out', 'skipped']) {
expect(readCheckRunConclusion(conclusion)).toBe(conclusion)
}
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover neutral and pending conclusions.

The test claims to cover every supported conclusion, but it omits neutral and pending. Both values are accepted by readCheckRunConclusion and classified by the shared summary logic.

Proposed fix
-    for (const conclusion of ['success', 'failure', 'cancelled', 'timed_out', 'skipped']) {
+    for (const conclusion of ['success', 'failure', 'cancelled', 'timed_out', 'skipped', 'neutral', 'pending']) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
describe('readCheckRunConclusion', () => {
it('keeps every conclusion the shared classifier can act on', () => {
for (const conclusion of ['success', 'failure', 'cancelled', 'timed_out', 'skipped']) {
expect(readCheckRunConclusion(conclusion)).toBe(conclusion)
}
})
describe('readCheckRunConclusion', () => {
it('keeps every conclusion the shared classifier can act on', () => {
for (const conclusion of ['success', 'failure', 'cancelled', 'timed_out', 'skipped', 'neutral', 'pending']) {
expect(readCheckRunConclusion(conclusion)).toBe(conclusion)
}
})

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