Skip to content

[CI] Speed up composer decision tests by reusing their narrow module - #26179

Merged
nwparker merged 1 commit into
mainfrom
nwparker/composer-decision-import-reuse
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/composer-decision-import-reuse

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Tests of workspace naming and host selection now load those decisions directly, instead of loading the entire composer hook and renderer store first. The composer uses and exports the same functions.

What Changed

Move eight existing decisions and their private naming function into the existing composer decision module, unchanged. Three existing test files import that module. The original hook re-exports the same bindings and retains its initial workspace-module evaluation edge. The source-selection dependency uses the existing narrow provider export. One integration case verifies all eight public bindings.

Why

The decisions need no hook state. Reusing their existing module removes unnecessary test imports while retaining file isolation, every assertion, real hook integration coverage, and protected Node contracts. This avoids changing global isolation or mocking the application store.

Linked Issue

Maintainer performance work; no new issue.

Visual Proof

N/A — no rendered behavior or UI change; existing decision bodies and actual hook composition are preserved.

Testing

Three matched pairs on macOS arm64, Bun1.4.2/Node24.20.0/Vitest5.0.3, four workers, filesystem module cache disabled. Times include the whole pnpm test command from launch through normal close. Same 13 original cases across three physical suites, ordered setup modules, isolation and runtime routing. The extra binding case is outside this timed workload. All six samples passed the source/config/case/status/process-contention guards; every qualified sample is included.

Pair Before After Time reduction
1 4.628651s 1.846717s 60.10%
2 4.478436s 1.793450s 59.95%
3 5.094506s 1.800765s 64.65%
Mean 4.733865s 1.813644s 61.69%

This is 2.61× for these three suites. It does not establish the whole-suite 2× goal. Timing source: 6d90d51802ddacbbcddaf4af6eeee85972b23789; incoming main's later API removals are preserved when aligning this change.

  • Local automated checks: original 64 cases and candidate 65 cases pass both Bun and stock Node with identical original case/status maps and project/routing settings; shuffled seeds104729/130363. Typecheck:web and changed-code quality passed. Formatting uses the repository's oxfmt.
  • Added one check that all eight public exports reference the canonical functions.
  • Rebased onto main b8c96719, including merged deterministic SSH fixture fix [CI] Make SSH permission probe fixture independent of real PID reuse #26190. All seven candidate files are byte-for-byte identical to the reviewed prior head. Fresh control64/candidate65 qualifications pass Bun and stock Node with exact original identities, public binding check, routes, settings, normal exits and source guards; candidate maps also match the previous reviewed65-case reports. Web typecheck, changed-code quality, oxfmt and whitespace checks pass. The timings above retain their original frozen source.
  • Fresh full PR CI passes all five Linux ARM shards and all applicable checks at rebased head 49245fae. Tested source dc2ada89 has parents main b8c96719 plus this head. Canonical discovery and all five assignments cover all11,678 physical files exactly once:11,538 passing files,140 existing skipped files;112,609 passing cases,one expected failure,1,052 existing skipped cases;zero unhandled errors. All11,669 previous-source files remain, with nine incoming-main additions and no removals. Routes remain10,552 Bun files,1,125 actual Node runtime files and one Node measurement file; six setups/runtime configuration/lock guards match main. All four changed composer test modules pass their15 cases. Stock artifacts establish enrollment/routes and raw case counts; focused local reports separately establish complete named-case parity.
  • The previous full run retained every enrolled file but failed an incoming-main SSH fixture (29/30 cases passed); [CI] Make SSH permission probe fixture independent of real PID reuse #26190 corrected its invented-PID observation. The fresh run passes all30 SSH cases. The failed raw run is retained; the composer never changed that fixture.

Review

Independent source review confirms unchanged function blocks, real hook composition and public binding identities. Fresh rebase/source/controller review confirms all seven candidate files and all28 source guards, exact permitted changes and preserved incoming-main code. Final exact head has green applicable checks and a clean merge state. Review API reports zero reviews and zero threads; no bot review completion is claimed.

Agent skill upstream boundary

  • Not applicable; no agent-skill source changed.

Notes

No runtime routing, platform paths, native SQLite/PTy contracts, SSH/folder host selection behavior, deadlines, isolation or test selection changes. The helper keeps the original host-qualified decision logic. The static dependency graph motivates the experiment; the measured command times above are the performance evidence.

Checklist

  • Small and focused; behavior/mechanism/alternatives explained.
  • N/A visual proof explained.
  • Local and independent source/correctness/performance evidence reviews complete.
  • Cross-platform, SSH and folder behavior considered.
  • Full PR CI passes; full source-bound test enrollment checked.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3aa66bb-7a0a-47e0-a4e8-2ace0fe99b43
📥 Commits

Reviewing files that changed from the base of the PR and between 5cafefe and 1bfbdb6.

📒 Files selected for processing (7)
  • src/renderer/src/hooks/composer-state/composer-decisions.ts
  • src/renderer/src/hooks/composer-state/source-selection-decisions.ts
  • src/renderer/src/hooks/useComposerState-decisions.test.ts
  • src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts
  • src/renderer/src/hooks/useComposerState-host-retarget.test.ts
  • src/renderer/src/hooks/useComposerState.integration.test.ts
  • src/renderer/src/hooks/useComposerState.ts

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


📝 Walkthrough

Walkthrough

Composer decision helpers now reside in a dedicated module. The composer state module imports and re-exports the helpers and their input type. Existing tests now import helpers from the dedicated module, and an integration test checks that eight public exports match their canonical implementations.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1bfbd

The composer decisions retain their existing behavior, with no actionable merge risk identified beyond normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 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 describes the main change: reusing the narrow composer decision module to speed up decision tests.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, gives testing and performance evidence, and marks visual proof as not applicable with a reason. The maintainer-specific…
  • 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.

@nwparker
nwparker force-pushed the nwparker/composer-decision-import-reuse branch from 1bfbdb6 to 49245fa Compare October 7, 2026 11:17
@nwparker
nwparker merged commit 2dc98c9 into main Oct 7, 2026
30 checks passed
@nwparker nwparker changed the title Speed up composer decision tests by reusing their narrow module [CI] Speed up composer decision tests by reusing their narrow module 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