Repository navigation
ci: match the composed producer job name so compile reuse can find a producer - #13676
Merged
Merged
Conversation
…producer
Both compile-reuse lookups identify the producing job by exact GitHub job name:
scripts/ci/find_admitted_build.py:66 job["name"] == ADMISSION_JOB
scripts/ci/reuse_app_host_products.py:306 job.get("name") == "macOS compile admission"
On 2026-09-21 #13405 extracted the macOS jobs from `ci.yml` into the reusable
`ci-macos.yml`, called from the `macos` job. GitHub reports a reusable
workflow's jobs as "<caller job> / <job name>", so the producer is now
"macos / macOS compile admission". Neither constant moved with it, so both
comparisons stopped matching anything.
Verified against the live API rather than inferred. Three runs created within
the last few minutes:
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15
and a before/after split across the refactor: 25 of 30 pre-refactor runs
carried a job named exactly "macOS compile admission"; 2 of 207 post-refactor
runs did, both on stale branches whose merge commit still had the inline
`ci.yml`.
Consequence: `find_admitted_build.py` returns `None` unconditionally and
`reuse_app_host_products.py` records `producer_compile_unsuccessful` for every
candidate, so both reuse mechanisms are dead. Sampled
`macos-compile-admission-metrics-*` artifacts agree: every successful admission
reports a real ~1,015s compile and `classification: "hosted fallback"`, with a
measured reuse hit rate of zero.
Match the final path segment instead, so the lookup survives the job being
reached directly or through any caller.
This is fail-open in both call sites already (the `admitted` step is
`continue-on-error`, and the reuse path records a miss reason and compiles), and
reuse still revalidates product identity against GitHub's immutable Git objects,
so a wrongly matched producer cannot smuggle in a foreign product.
Neither edited file is in `PRODUCT_CI_INPUTS`, and `reaches_product()` returns
False for `scripts/ci/*` outside that set, so no cached product is invalidated
and no open pull request is forced to recompile.
`tests/test_ci_change_areas.py` fabricated the bare job name, so it passed
against production code that could never match. The fixture now uses the
composed name, and a new test derives that name from the workflows themselves --
the `ci.yml` job whose `uses:` targets `ci-macos.yml`, plus the
`macos-compile-admission` job's `name` -- and asserts both lookups accept it.
Reverting either fix makes that test fail, which is the signal #13405 should
have tripped.
Tests: test_reuse_app_host_products.py, test_app_host_test_products.py,
test_ci_persistent_mac_compile.py, test_ci_workload_profiles.py,
test_ci_guard_workflow_structure.py, test_ci_self_hosted_guard.sh pass, and
149 test_ci_change_areas.py cases pass (its shallow-clone cases need HEAD^1 and
fail identically on main).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 22 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
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 |
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Both compile-reuse lookups identify the producing job by exact GitHub job name. They stopped matching anything on 2026-09-21 and have been dead since.
#13405 extracted the macOS jobs from
ci.ymlinto the reusableci-macos.yml, called from themacosjob. GitHub reports a reusable workflow's jobs as<caller job> / <job name>, so the producer is nowmacos / macOS compile admission. Neither constant moved with it.This matches the final path segment instead, so the lookup survives the job being reached directly or through any caller.
Verified, not inferred
Three CI runs created minutes before this PR:
Before/after the refactor:
macOS compile admissionThe two survivors are stale branches whose merge commit still carried the inline
ci.yml.Consequence:
find_admitted_build.pyreturnsNoneunconditionally, andreuse_app_host_products.pyrecordsproducer_compile_unsuccessfulfor every candidate. Both reuse mechanisms are structurally dead, 100% of the time. Sampledmacos-compile-admission-metrics-*artifacts agree — every successful admission reports a real ~1,015s compile withclassification: "hosted fallback", and the measured reuse hit rate across ~110 successful admissions is zero.Why this is low risk
admittedstep iscontinue-on-error: true; the reuse path records a miss reason and compiles normally.reuse_app_host_products.py:291), so a wrongly matched producer is rejected downstream.PRODUCT_CI_INPUTS, andreaches_product()returnsFalseforscripts/ci/*outside that set. No open PR is forced to recompile. (Deliberately not factored into a shared helper inproduct_input_identity.py— that file hashes itself into every product identity, so touching it would invalidate every cached product repo-wide.)The test that should have caught this
tests/test_ci_change_areas.pyfabricated the bare job name in itsadmission_job()fixture, so it passed against production code that could never match in reality.The fixture now uses the composed name, and a new test derives that name from the workflows themselves — the
ci.ymljob whoseuses:targetsci-macos.yml, plus themacos-compile-admissionjob'sname— then asserts both lookups accept it. I confirmed it fails when either fix is reverted:That is the signal #13405 should have tripped.
Expected saving
Near zero today, by itself. In a push burst the producer arrives last: of 49 sampled runs that republished a fingerprint an earlier same-branch run had already published, zero had a predecessor whose admission concluded
success, so there was nothing to reuse even with a working lookup.What makes it pay is #13644, the macOS admission debounce, which merged today at 14:00Z and collapses those bursts into one surviving run. This PR is the prerequisite: with the debounce collapsing bursts and the lookup repaired, the ~23.7% duplicate-fingerprint pool becomes harvestable. Landing this without that measurement would be pointless; landing the debounce without this leaves the reuse path dead.
Test
test_reuse_app_host_products.py,test_app_host_test_products.py,test_ci_persistent_mac_compile.py,test_ci_workload_profiles.py,test_ci_guard_workflow_structure.pyandtest_ci_self_hosted_guard.shall pass. 149test_ci_change_areas.pycases pass; its shallow-clone cases requireHEAD^1and fail identically onmain.Related
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the macOS compile producer lookup so compile reuse works again after the macOS jobs moved into a reusable workflow.
GitHub reports reusable workflow jobs as
<caller job> / <job name>, so the producer is nowmacos / macOS compile admission; both reuse lookups compared the exactmacOS compile admissionname and have silently matched nothing since, leaving both reuse paths dead. They now match the final segment of the job name, which works whether the job is reached directly or through any caller.Both call sites already fail open, so a miss just records a reason and compiles normally, and reuse still revalidates product identity downstream. The test fixture used the bare job name, which masked the regression; it now uses the composed name, and a new test derives it from the workflows themselves so a future move breaks the test instead of reuse.
Written for commit 025883e. Summary will update on new commits.