Repository navigation
ci: stop routing-policy PRs that add a guard test from compiling macOS - #13722
Conversation
When a PR edits CI routing policy, ci.yml classifies its product files with the trusted base router. That router read test references only from the base workflows, which never name a guard test the PR adds, so the new tests/ file counted as macOS-relevant and the PR paid for a full app compile and Release build (e.g. #13703: 34 min cold compile for one guard test + one iOS script). Merge the PR head's test references in: a path either side names in a macOS job stays macOS-relevant. Also give the trusted router the base Xcode project and Package.swift manifests, whose absence logged 'Could not derive macOS local-package dependency closure' and kept every iOS package edit macOS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
All contributors have signed the CLA ✍️ ✅ |
|
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 configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughChangesCI reference routing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant CIWorkflow
participant TrustedRouter
participant detect_ci_change_areas
participant BaseRoot
participant HeadRoot
CIWorkflow->>TrustedRouter: copy base Xcode project and Package.swift files
CIWorkflow->>TrustedRouter: set CMUX_CI_HEAD_TEST_REFERENCE_ROOT
TrustedRouter->>detect_ci_change_areas: classify product inputs
detect_ci_change_areas->>BaseRoot: load base workflow references
detect_ci_change_areas->>HeadRoot: load head workflow references
detect_ci_change_areas-->>TrustedRouter: merge references and return classification
Merge Risk: ⚪ Minimal · up to This change refines CI routing so guard-only and package-specific changes avoid unnecessary macOS work; no merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Problem
When a PR edits CI routing policy,
ci.ymlclassifies the PR's product files with the trusted base router, which copies a handful of files from the base commit. Two gaps made those PRs compile the macOS app for nothing:tests/file counts as macOS-neutral only when a workflow names it in Linux jobs alone. A guard test the PR adds is named only by the PR's ownci-guards.yml, so the base router treated it as macOS-relevant. That scheduled compile admission and a Release build.Could not derive macOS local-package dependency closure; keeping Packages/iOS macOS-relevant: … trusted-ci-router/cmux.xcodeproj/project.pbxproj.Observed on #13703 (run 35753992765): the product files were one iOS script and one new guard test.
changesresolvedmacos=true release_build=true, and compile admission spent 34+ min in "Compile app-host test product". That run also missed every cache because it is a fork PR, which #13717 addresses separately.Resulting behavior
load_macos_job_test_referencesnow merges the PR head's references whenCMUX_CI_HEAD_TEST_REFERENCE_ROOTis set. ci.yml sets it to the workspace for the trusted-router invocation. A path that either the base or the head names in a macOS job stays macOS-relevant, and if the head can't be read, only the base is used.cmux.xcodeproj/project.pbxprojand everyPackages/*/*/Package.swift.macos=true release_build=truebecomesmacos=false release_build=false. That used the new detector, base workflows as the trusted root, and the PR's checkout as head.Validation and remaining gap
test_trusted_router_reads_new_guard_tests_from_the_pr_headcovers three cases: the base alone keeps the new test macOS-relevant; merging head Linux references makes it guard-only; and a head macOS job naming it keeps it macOS-relevant.tests/test_ci_change_areas.pypasses locally (withRUNNER_TEMPset, as CI does), along withtest_ci_linux_guard_routing.py,test_ci_release_guard_structure.pyandtest_ci_self_hosted_guard.sh.Part of #13095.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Stops routing-policy PRs that add a guard test from compiling the macOS app for nothing, since the trusted base router previously treated the new
tests/file as macOS-relevant and lacked the Xcode project and package manifests needed to derive the local-package closure.CMUX_CI_HEAD_TEST_REFERENCE_ROOTis set; a path named in a macOS job by either side stays macOS-relevant.cmux.xcodeproj/project.pbxprojand allPackages/*/*/Package.swiftinto the trusted router's workspace.Part of #13095.
Written for commit 3dd4b60. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests