Skip to content

[CI] Reduce repeated CI setup and overlap mobile typechecks - #25359

Merged
nwparker merged 8 commits into
mainfrom
nwparker/ci-pressure-followup-20261005
Oct 5, 2026
Merged

nwparker merged 8 commits into
mainfrom
nwparker/ci-pressure-followup-20261005

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

CI runners spend time loading unused code and waiting for checks that can run together. This change removes that work while keeping the actual failure checks.

What Changed

  • Tests with explicit RPC method lists reject accidental use of the default method catalog instead of importing its unrelated handlers. Tests of the real catalog still use it.
  • Incumbent-process cases run concurrently with separate sockets, directories and process groups; their real five-second deadlines remain.
  • The commentable-line lifecycle tests reject use of an unrelated saved-note menu without importing it.
  • The reporting-only agent-status benchmark moves out of ordinary test discovery and remains available through its dedicated Vitest config. All 15 semantic cases remain.
  • Mobile production and test typechecks overlap after installation, and both must succeed before tests start.
  • Windows SSH jobs check out the complete build/test/resource trees they need, with all four host lanes retained.

Why

These changes reduce occupied runner time without skipping product failure checks or relying on persisted transform caches. Alternating hosted comparisons and actual injected faults provide evidence for each change. The report in docs/reference/ci-runner-efficiency.md records timings, source versions and measurement limits. Scoped timings cannot be added together or treated as a measured improvement to PR percentiles.

Linked Issue

N/A — internal CI efficiency work.

Visual Proof

N/A — workflow and test setup changes only; no application UI changes.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Hosted comparison runs:

Local qualification includes original case ledgers, actual handler/catalog/lifecycle faults, source restoration, owned-process cleanup, Node typecheck, all 20 existing workflow assertions, the full anti-slop scan, max-lines ratchet and changed-code quality gate. The reusable test guard has the same narrow test-only lint exception as the existing process-sweep fixture. Normal CI passed: PR Checks and Verify, Mobile Checks, and all four Windows SSH lanes. The five unit artifacts account for all 10,916 ordinary unit files with zero unhandled errors. All 12 Windows cell receipts passed, including both pinned-shell routes and the opt-out; the four provider receipts also qualified private service, owned SSH process, account and key cleanup. All 12 profiles remain loaded; profile/global bootstrap cleanup relies on disposable VM destruction.

Review

Independent native Codex agents audited source equivalence, fault sensitivity, hosted receipts and measurement boundaries. The final source is rebased on current main. Temporary trial workflows, archives and helpers are absent from the final diff.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Production RPC behavior and SSH execution boundaries are unchanged. Windows retains separate inbox/preview and x64/ARM jobs. Mobile uses installed no-emit compilers; its sampled combined peak was 5.137 GiB on the 16 GiB runner. Its test-typecheck ratchet now also runs when the concurrent production compiler later fails.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (covered by normal CI)

@pullfrog pullfrog 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.

ℹ️ No critical issues. All substantive edits are CI-layout / test-scoping; one stale baseline entry was left behind by the benchmark rename.

Reviewed changes

  • Mobile typecheck overlap — wait: production-types moved from before the foreground "Typecheck tests (ratchet)" step to after it and before "Test", so the background production compiler and the test-typecheck ratchet overlap. config/scripts/mobile-typecheck-workflow.test.mjs was updated to pin production < ratchet < wait < test, no if on the wait, and continue-on-error false on both compilers.
  • RPC registry fixture — new unused-default-rpc-methods.test-fixture.ts mocks ./methods with an array whose Symbol.iterator increments a plain counter and throws, and an afterEach asserts the count stayed 0 (reset in finally, so clearAllMocks cannot mask it). Imported as a first-line side-effect by 153 dispatcher test files; the real-catalog subjects do not import it.
  • Agent-status benchmark — renamed .test.ts → .ts so it drops out of ordinary discovery, with a dedicated config/vitest.agent-status-benchmark.config.ts; counter classes refactored and the as unknown as casts removed.
  • Windows SSH checkout — sparse-checkout added to all four host lanes (.github config native resources tests src/main src/shared src/relay src/types); the relay/orcad build entries all resolve within included trees.
  • Incumbent probe — describe.skipIf(win32).concurrent(...) so the nine owned-socket cases overlap their real lsof deadlines.
  • Commentable-line test — throwing NotesSendMenu facade plus an afterEach never-called guard.
  • Docs — new ci-runner-efficiency.md sections recording scoped timings and their measurement limits.

ℹ️ Nitpicks

  • config/scripts/ci-shard-timings.json:11 still lists config/scripts/agent-status-hot-path-benchmark.test.ts, which this PR renames to ...benchmark.ts and removes from unit discovery. The key is dead (ignored by balanceFiles's fallback) and will be dropped on the next ci-unit-timing-import run, but it can be removed now.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

The delta since the prior pullfrog review (452130a6b6) is a single commit, 50330e31cf, adding the lint-policy exemption the earlier commits needed.

  • Anti-slop exemption for the RPC test fixture — added a file-scoped override in config/oxlint-anti-slop.json that turns anti-slop/no-module-mocking off for unused-default-rpc-methods.test-fixture.ts. The fixture is named *.test-fixture.ts, so it falls outside the existing **/*.test.{ts,tsx} override even though its whole body is one vi.mock. The override mirrors the existing **/mock-descendant-sweep.ts exemption and is narrowly scoped to the one file.

Verified the exemption is both necessary and effective: with it removed, oxlint --config config/oxlint-anti-slop.json reports exactly one anti-slop/no-module-mocking error on the fixture's vi.mock (line 14); with it in place the file lints clean. The glob matches the file path and the config parses correctly.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

The mobile workflow now runs the ratchet typecheck before waiting for the production typecheck. The Windows SSH workflow adds sparse-checkout paths. The agent-status benchmark updates fixture setup, allocation counting, and output handling, and adds a dedicated Vitest configuration. A shared fixture checks for use of the default RPC method catalog, and many test modules import it. Other changes add CI-efficiency documentation, an SSH test concurrency setting, and a renderer assertion.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 57c9c

The concurrent SSH tests have a narrow cleanup race that could terminate another process if a PID is reused. This is a bounded test-only risk; correct the cleanup before relying on the concurrent probes.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 57c9c

The inspected changes preserve existing permissions and keep both mobile typechecks ahead of tests. No introduced security issue was established. Remaining uncertainty concerns background-process cleanup when the foreground check fails before the explicit join.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected changes affect execution and verification within existing CI jobs, including Windows host provisioning tests. They do not establish expanded access to production services, tenants, data stores or deployment credentials.

Trust Boundaries and Controls

  • observed — Pull-request inputs continue to execute under the existing workflow contexts. The mobile checks retain failure-producing commands without continue-on-error, and the unconditional production join remains ahead of the test consumer. Repository documentation reports that separate production and test type faults prevented tests from starting.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 51 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 summarizes the CI-efficiency changes and the mobile typecheck overlap, which are central goals of the pull request.
Description check ✅ Passed The description includes the main template sections and explains the changes, rationale, testing, visual-proof status, review, and compatibility considerations. It marks the linked issue as not applic…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

The delta since the prior pullfrog review (50330e31cf) is a single commit, 57c9cb47c1, correcting one mobile-barrier contract test.

  • Mobile barrier contract realigned — config/scripts/ci-background-step-barriers.test.mjs renamed the case to joins independent mobile typechecks before allocating test workers and flipped expect(ratchet).toBeGreaterThan(join) to toBeLessThan(join). That resolves a contradiction with the sibling mobile-typecheck-workflow.test.mjs (ratchetIndex < waitIndex): the previous assertion placed the ratchet after the join, which cannot hold against mobile.yml (production background step at 118, ratchet at 127, wait: production-types at 130, Test at 149). Test-only; no product behavior change. Both contract files pass locally (12 tests, ~280ms).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Clean up through the case-owned process group. · ssh-relay-incumbent-process.test.ts:68-69

src/main/ssh/ssh-relay-incumbent-process.test.ts:68-69
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Clean up through the case-owned process group.

The fixture PID can exit during runProcess cleanup. If the PID is reused before finally runs, the current process.kill(pid, 'SIGKILL') can kill another concurrent case. Record the detached process group ID and signal that group instead.

Suggested fix
   const socket = join(dir, 'socket with spaces.sock')
   const server = createServer((s) => s.end())
   const pidFile = join(dir, 'probe.pid')
+  const groupFile = join(dir, 'probe.pgid')
...
-      env: { ...process.env, PATH: `${dir}:${process.env.PATH}`, FIXTURE_PID: pidFile },
+      env: {
+        ...process.env,
+        PATH: `${dir}:${process.env.PATH}`,
+        FIXTURE_PID: pidFile,
+        FIXTURE_PGID: groupFile
+      },
...
-      const pid = Number(readFileSync(pidFile, 'utf8'))
-      if (Number.isInteger(pid) && pid > 0) {
-        process.kill(pid, 'SIGKILL')
+      const pgid = Number(readFileSync(groupFile, 'utf8'))
+      if (Number.isInteger(pgid) && pgid > 0) {
+        process.kill(-pgid, 'SIGKILL')
       }
...
-    const p = await probe('echo $$ > "$FIXTURE_PID"\nexec sleep 60\n', true)
+    const p = await probe(
+      'echo $$ > "$FIXTURE_PID"\nps -o pgid= -p $$ > "$FIXTURE_PGID"\nexec sleep 60\n',
+      true
+    )
...
-    const p = await probe('sleep 60 &\necho $! > "$FIXTURE_PID"\nwait\n', true)
+    const p = await probe(
+      'sleep 60 &\necho $! > "$FIXTURE_PID"\nps -o pgid= -p $! > "$FIXTURE_PGID"\nwait\n',
+      true
+    )

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 255e0bef-0e40-4f4a-afc6-10b76a20fda8
📥 Commits

Reviewing files that changed from the base of the PR and between 50330e3 and 57c9cb4.

📒 Files selected for processing (1)
  • config/scripts/ci-background-step-barriers.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@nwparker
nwparker merged commit 1bec53c into main Oct 5, 2026
37 checks passed
OrcaWin pushed a commit that referenced this pull request Oct 5, 2026
… e2e build

Main's #25359 narrowed this workflow's checkout to the server and test trees. Phase 3's
orcad-convert cell builds the full e2e app with electron-vite, which also needs src/preload
and src/renderer, so the x64 inbox cell failed with UNRESOLVED_ENTRY.
@nwparker nwparker changed the title Reduce repeated CI setup and overlap mobile typechecks [CI] Reduce repeated CI setup and overlap mobile typechecks Oct 9, 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