Repository navigation
Cache mobile typechecks and overlap CI setup - #28192
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
58710c0e-6d5a-4c23-af7f-5e163ed68339
📒 Files selected for processing (5)
.github/workflows/mobile.ymlconfig/scripts/ci-dependency-download-cache.test.mjsconfig/scripts/mobile-test-change-scope.test.mjsconfig/scripts/run-mobile-ci-tests.mjsconfig/scripts/run-mobile-ci-tests.test.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| - name: Check formatting | ||
| run: pnpm format:check | ||
|
|
||
| test-shard: |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
set -eu
printf '%s\n' '--- workflow header and relevant jobs ---'
nl -ba .github/workflows/mobile.yml | sed -n '1,45p;175,265p'
printf '%s\n' '--- exact PR diff for mobile workflow ---'
git diff --no-ext-diff --unified=30 ef890ae2bd547206868cbec3a506d85fd8b274b6 a016b9f226151a46962203f7cec991cc741304dd -- .github/workflows/mobile.ymlRepository: stablyai/orca
Length of output: 17177
🏁 Script executed:
set -eu
printf '%s\n' '--- permissions declarations and jobs boundary ---'
rg -n -F -- 'permissions:' .github/workflows/mobile.yml || test "$?" -eq 1
nl -ba .github/workflows/mobile.yml | sed -n '40,75p'Repository: stablyai/orca
Length of output: 1985
Restrict the token in the new test job.
test-shard runs pnpm install after checkout. Disable checkout credential persistence and grant the job only contents: read. Dependency code can otherwise access the persisted GITHUB_TOKEN; its write permissions depend on repository settings.
🐛 Suggested fix
test-shard:
name: Mobile Node and Bun tests
if: github.event_name == 'pull_request'
+ permissions:
+ contents: read
runs-on: ubuntu-24.04-arm
@@
uses: actions/checkout@v6
with:
fetch-depth: 2
+ persist-credentials: false🧰 Tools
🪛 zizmor (1.30.1)
[warning] 1-309: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 211-258: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
Sources: Learnings, Linters/SAST tools
4149a02 to
aa5461b
Compare
aa5461b to
f0fbe0d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
611d6d69-a9b2-4c22-baee-2af167b6f7c0
📥 Commits
Reviewing files that changed from the base of the PR and between aa5461b92f8bfb29f1d123168d44ea039e548966 and f0fbe0d.
📒 Files selected for processing (1)
src/main/daemon/serialize-grid-transcript-replay.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| 'codex-fullscreen-multiline-early-input': 10, | ||
| 'codex-fullscreen-startup': 14, | ||
| // Capacity capture: identical attribute leaks with the pre-capture 4559c250b3e serializer. | ||
| 'codex-model-capacity-fullscreen': 12, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -euo pipefail
nl -ba src/main/daemon/serialize-grid-transcript-replay.test.ts | sed -n '1,310p'Repository: stablyai/orca
Length of output: 14975
Pin the failure signatures for codex-model-capacity-fullscreen.
With SEEDS === 2 and no OLD_ADDON_PATH, this transcript checks only that counts['new-fail'] equals 12. No assertion checks its failureSignatures, so a different set of 12 diffs can pass. Add an expected-signature assertion for this transcript.
) #28192 and #28286 both recorded 'codex-model-capacity-fullscreen' with the same count, and the duplicate object key fails typecheck (TS1117) on main. Co-authored-by: m4air <[email protected]>
ELI5
Mobile checks repeatedly typecheck thousands of unchanged files. Save TypeScript's small incremental state so subsequent runs spend less CPU on those files, leaving more CPU for the tests.
What Changed
Mobile Checks / verifyjob and every Node/Bun test. Cache separate production and test compiler state, keyed by platform, lockfiles, compiler configurations and commit. Both checks always run; TypeScript rechecks changed source and imports.@orca/process-hostfor portable process handling.4559c250b3econfirms identical output and no regression; serializer code stays unchanged.Why
The referenced job took 3m20s after #28127. Runner sharding reduced execution to 2m11s, but an extra result job's queue made the measured total 5m52s; a repeat also delayed the companion runner. This version keeps one runner and reduces repeated compiler work instead. The two compiler-state files total about 3.4 MB locally, compared with a 131 MB persistent Vitest cache that saved only about 3s in an experiment.
Linked Issue
Maintainer follow-up to #28127 and the 3m20s run.
Visual Proof
N/A — CI and recording-test infrastructure only.
Testing
macOS: all 496 Node tests and 9,972 Bun tests pass. Production/test typechecks, mobile lint/format and changed-code quality checks pass. The 133 focused workflow/cache-policy tests pass. A real-compiler integration test proves cached checks detect changed imported types, retain unchanged diagnostics, update test-file membership and preserve the
@ts-nocheckguard.A local cold/warm comparison retained the same 122 diagnostic files and complete test census: production 11.9s → 2.1s; tests 16.2s → 3.0s. Hosted Linux ARM measurements (complete job execution, including setup and cleanup; initial runner queue excluded):
All six new runs passed all 10,468 mobile tests. The cache hit restored the expected 416 KB archive. The latest merge candidate saved 25s (12.5%) against the baseline. Cached runs ranged from 2m38s to 2m55s, saving 12.5%–21%; the two cold runs saved 10s–23s. Initial runner queues ranged from about five to twelve minutes and are separate from these job durations. The final rebase changed the root lockfile, correctly missing the earlier compiler cache; it saved a new 416 KB archive. Main now does additional compiler work to seed shared state; a miss falls back to full checking.
Final hosted validation: PR Checks passed all five desktop test shards, relay integration, static analysis/typechecking, the mobile bundle and test-assignment evidence. Mobile Checks, Headless Node server and PR test LoC passed on the merge candidate.
Review
Reviewed cache separation and invalidation, failure collection, compiler process handling, recording-cache bounds and cleanup. Local commands retain their existing behavior unless the cache directory is set. No UI, SSH or remote protocol changes. Rebased onto the upstream CI fix #28265; no duplicate UI correction is included. All 114 transcript replay tests pass, and a comparison against the serializer built from
4559c250b3epasses the newly added capacity capture without byte differences or behavioral regressions.Agent skill upstream boundary
Checklist
N/Awith reason