Skip to content

tools: wire-app-sources wires any target; guard cmuxUITests wiring - #15057

Merged
teamleaderleo merged 1 commit into
mainfrom
tools/wire-any-target
Sep 27, 2026
Merged

teamleaderleo merged 1 commit into
mainfrom
tools/wire-any-target

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

cmuxUITests/SettingsComputersBehaviorUITests.swift has no entries in project.pbxproj, so it has never been built or run. Nothing in CI checks cmuxUITests wiring: the guard lints cmuxTests, cmuxCLITests and the app sources, not UI tests.

The same gap hit #14838: a merge that took main's project.pbxproj dropped its UI test's entries. The PR's ui-tests job then failed with "selected test filter ... matched zero tests", which points at the filter rather than the project.

  • scripts/wire-app-sources.py (from tools: ui-lab renders view code in seconds; wire-app-sources.py #15049) takes --target and --dir, so it wires UI tests too: scripts/wire-app-sources.py --target cmuxUITests --dir cmuxUITests. The defaults (cmux, Sources) are unchanged.
  • SettingsComputersBehaviorUITests.swift is wired into cmuxUITests with it.
  • The CI guard runs lint-pbxproj-test-wiring.sh --target cmuxUITests --tests-dir cmuxUITests, next to the cmuxCLITests lines.
  • For every target except cmuxTests, which keeps sync-test-wiring, the lint's failure message now names the script instead of "add the four entries by hand".

Testing

  • lint-pbxproj-test-wiring.sh --target cmuxUITests --tests-dir cmuxUITests failed on main with this file and passes after wiring. The default lint, check-pbxproj.sh and tests/test_ci_pbxproj_app_sources_wiring.sh pass.
  • tests/test_wire_app_sources.py adds a case: a file wired for another target lands in that target's Sources phase only. All 10 cases pass.
  • SettingsComputersBehaviorUITests has never compiled. This PR's macOS compile builds the UI test target, and I'm running the class once with dispatch-focused-test.py; results will be added here.

Changelog

none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes UI test files dropping out of the Xcode project so they never build or run, which previously surfaced in CI as a misleading "selected test filter matched zero tests" failure instead of revealing the missing project wiring.

  • wire-app-sources.py now wires any target directory via --target/--dir; the defaults remain cmux/Sources.
  • Wires SettingsComputersBehaviorUITests.swift into cmuxUITests; it had no project entries, so it was never built or run.
  • CI now lints cmuxUITests wiring, and the lint failure message points non-cmuxTests targets at the script.

Written for commit ac668e6. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Improved automated checks and setup for UI tests, helping ensure the test suite is wired into the project consistently.
    • Expanded source-wiring support to cover additional test targets and directories, with clearer guidance when setup is incomplete.
  • Tests
    • Added coverage to verify that files are associated with the intended test target and not inadvertently included in the app target.

cmuxUITests/SettingsComputersBehaviorUITests.swift (#4141fb41eaf lineage)
has no project entries, so it has never been built or run; nothing checks
cmuxUITests wiring in CI. #14838 lost its UI test the same way after a
merge took main's project.pbxproj, and its PR run failed with "matched
zero tests".

- wire-app-sources.py takes --target and --dir (UI tests: cmuxUITests).
- Wire SettingsComputersBehaviorUITests into cmuxUITests.
- The CI guard lints cmuxUITests wiring like cmuxCLITests; the lint
  points every non-cmuxTests target at the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Sep 27, 2026
The merge that took main's project.pbxproj also dropped
SidebarCompactAgentStatusUITests from cmuxUITests, so the PR's ui-tests
job matched zero tests. Carries #15057 (wire-app-sources --target, the
cmuxUITests wiring guard) unchanged, which also wires main's orphaned
SettingsComputersBehaviorUITests with the same ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b98e8677-6eb4-45e5-9536-52e41b37acb0

📥 Commits

Reviewing files that changed from the base of the PR and between bee385d and ac668e6.

📒 Files selected for processing (6)
  • cmux.xcodeproj/project.pbxproj
  • scripts/ci/workloads/ci-guard.sh
  • scripts/lint-pbxproj-test-wiring.sh
  • scripts/wire-app-sources.py
  • skills/cmux-testing/SKILL.md
  • tests/test_wire_app_sources.py

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


📝 Walkthrough

Walkthrough

The source-wiring script now supports selecting a project directory and target. The project registers SettingsComputersBehaviorUITests.swift, and CI runs the wiring lint for the UI-test target and directory.

Changes

Test source wiring

Layer / File(s) Summary
Target-aware source wiring
scripts/wire-app-sources.py, scripts/lint-pbxproj-test-wiring.sh, tests/test_wire_app_sources.py, skills/cmux-testing/SKILL.md
The script accepts a target and directory for discovery, validation, checking, and wiring. The test covers target-specific wiring, and lint guidance and testing instructions describe selected target and directory options.
UI-test source registration and CI check
cmux.xcodeproj/project.pbxproj, scripts/ci/workloads/ci-guard.sh
The project registers SettingsComputersBehaviorUITests.swift in the cmuxUITests target. CI runs the wiring lint for that target and the cmuxUITests directory.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to ac668

The UI-test source is registered and its wiring is checked in CI. No identified issue prevents merging after normal checks.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Algorithmic Complexity ❌ Error The new generic batch path retains per-file full-project rescans in scripts/wire-app-sources.py:299-303. For every rel, line 300 recomputes parse(...).wired_paths, and line 303 calls wire; `wi… Add a batch wiring path that parses and indexes the project once, keeps a Set of wired paths and an ID/reference index, and applies all file and phase insertions from that single model. At minimum, remove the per-item `parse(...).wired_pa…
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 4 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (23 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: extending wire-app-sources to support any target and adding cmuxUITests wiring checks.
Description check ✅ Passed The description includes the required Summary, Testing, and Changelog sections. It explains the problem, implementation, reported test results, and remaining verification. The Demo Video and Checklist…
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.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS: The pull request changes Xcode test wiring, CI wiring lint invocation, and the wire-app-sources.py project-editing utility. The authoritative diff contains no Cloud terminal creation, cmux-tui…
Cmux Swift Actor Isolation ✅ Passed PASS: The authoritative PR diff contains no production Swift source changes. It only adds an existing SettingsComputersBehaviorUITests.swift file to project.pbxproj; the other changes are Python, …
Cmux Swift Blocking Runtime ✅ Passed The pull request changes no Swift source files. Its only Swift-related change adds project wiring for SettingsComputersBehaviorUITests.swift in the cmuxUITests test target. The remaining changes a…
Cmux Browser Automation Off-Main ✅ Passed PASS: The PR changes only project wiring, CI/scripts, documentation, and a Python test. It changes no Swift browser automation files and introduces no browser socket command, WebKit/AppKit worker rout…
Cmux Expensive Synchronous Load ✅ Passed PASS: The PR changes no Swift source files. It only adds project wiring for the pre-existing cmuxUITests/SettingsComputersBehaviorUITests.swift file, whose blob is identical at the base and head ref…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only Xcode project wiring, Python and shell tooling, documentation, and Python tests. It does not change production Swift, TypeScript, or JavaScript, and it introduces n…
Cmux No Hacky Sleeps ✅ Passed PASS: The pull request changes a Python wiring script, shell CI/lint commands, project metadata, documentation, and a unit test. The changed lines add no sleep, timer, polling loop, fixed delay, retry…
Cmux Swift Concurrency ✅ Passed PASS. The pull request changes no Swift source. cmuxUITests/SettingsComputersBehaviorUITests.swift exists in both reviewed revisions with the same object ID and unchanged content. The Xcode project …
Cmux Swift @Concurrent ✅ Passed PASS: The pull request changes no .swift files. The only Swift-related change adds the existing SettingsComputersBehaviorUITests.swift file to the cmuxUITests Xcode target; its base and head con…
Cmux Swift Package Boundaries ✅ Passed The pull request changes no .swift files. It only adds existing cmuxUITests/SettingsComputersBehaviorUITests.swift to the Xcode project and updates wiring scripts, tests, and documentation. The Sw…
Cmux Swiftpm Lockfiles ✅ Passed PASS: The PR changes only test-source wiring and CI scripts. It changes no Package.swift, Package.resolved, or .gitignore file. The cmux.xcodeproj patch adds SettingsComputersBehaviorUITests.swift ent…
Cmux Swift Logging ✅ Passed PASS: The PR changes no Swift source files. Its only Swift-related diff adds SettingsComputersBehaviorUITests.swift to the Xcode project, including the test group and cmuxUITests Sources phase. Th…
Cmux User-Facing Error Privacy ✅ Passed PASS. The diff changes Xcode project wiring, CI guards, developer scripts, tests, and testing guidance. The added diagnostics name targets, directories, paths, and project phases, but they are emitted…
Cmux Full Internationalization ✅ Passed The PR changes only Xcode project wiring, CI/lint scripts, a developer skill document, and a test. The authoritative diff contains no changed Swift source, string catalog, plist, web UI, message, or l…
Cmux Swiftui State Layout ✅ Passed PASS: The reviewed range changes no Swift source files. It only adds project wiring for an existing UI-test file and updates scripts, documentation, and tests. The added and removed lines introduce no…
Cmux Architecture Rethink ✅ Passed PASS: The PR does not introduce a Swift architecture change. It adds the existing SettingsComputersBehaviorUITests.swift file to the cmuxUITests Xcode target through the standard file reference, g…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The pull-request diff contains no changed Swift files. It only adds project wiring for the pre-existing cmuxUITests/SettingsComputersBehaviorUITests.swift test fixture and changes wiring scrip…
Cmux Source Artifacts ✅ Passed All six changed paths are intentional source, configuration, documentation, or test files. The project.pbxproj changes add required Xcode UI-test wiring. No changed path or added content is a local lo…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull request changes no Swift files. Its only Swift-related change adds an existing cmuxUITests/SettingsComputersBehaviorUITests.swift file to Xcode project wiring; the remaining changes are scr…
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 4 files. (2 skipped: 2 unsupported.)

Full details: Cmux Algorithmic Complexity

Explanation

The new generic batch path retains per-file full-project rescans in scripts/wire-app-sources.py:299-303. For every rel, line 300 recomputes parse(...).wired_paths, and line 303 calls wire; wire reparses at line 217, while Project.wired_paths scans all build-file entries at lines 94-98. This is O(k·P) for k files and project size P, with the project text growing during wiring. The PR expands this behavior to --target cmuxUITests --dir cmuxUITests; that directory currently contains 65 Swift files, and Sources contains 2,388 files. No benchmark or bound supports the slower batch algorithm. The default behavior was existing, but the PR exposes and uses the same unoptimized batch operation for another scalable file collection.

Resolution

Add a batch wiring path that parses and indexes the project once, keeps a Set of wired paths and an ID/reference index, and applies all file and phase insertions from that single model. At minimum, remove the per-item parse(...).wired_paths call and maintain the wired set, but avoid reparsing inside wire for each file as well. Add a test or benchmark with the current-scale file counts to verify linear behavior.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@teamleaderleo
teamleaderleo merged commit 2207bc8 into main Sep 27, 2026
65 of 66 checks passed
@teamleaderleo
teamleaderleo deleted the tools/wire-any-target branch September 27, 2026 20:40
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for ac668e65e5: every check was green at merge (15 verified; 16 skipped by policy). Full suite runs on main after merge.

teamleaderleo added a commit that referenced this pull request Sep 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 27, 2026
c5024fa tools: wire-app-sources finds --dir among the main group's children (manaflow-ai#15059)
2207bc8 tools: wire-app-sources wires any target; guard cmuxUITests wiring (manaflow-ai#15057)
dc56eb7 ci: swift-package-tests through one lane script, opt-in build-fleet step (hq#794) (manaflow-ai#15042)
bee385d Add an Accent Color setting and use one accent for cmux chrome (manaflow-ai#14988)

# Conflicts:
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
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