ci: route pull-request macOS jobs to Blacksmith, keep overflow for the rest

Merged
TE
2mo ago
+6-6

What

Routes the pull_request event to Blacksmith for the macOS 15 jobs that carry the overflow spend. Every other event keeps following the repository variable exactly as today.

runs-on: ${{ github.event_name == 'pull_request'
             && (vars.MACOS_RUNNER_PR || 'blacksmith-6vcpu-macos-15')
             || vars.MACOS_RUNNER_15 || 'blacksmith-6vcpu-macos-15' }}

Jobs moved: macos-compile-admission, app-host-unit-tests, tests-build-and-lag, cli-pipe-regressions, and both terminal-hang-diagnostics jobs.

Untouched: merge group, push, schedule, release, manual dispatch — the overflow provider stays available for the fan-out case it is kept for.

Why this lane

From a 24h measurement (618 runs → 1,973 jobs, weighted to full run volume; method in #13652), overflow macOS minutes by triggering event:

Eventmin/dayShare
pull_request6,53556.5%
workflow_dispatch2,78224.0%
push1,92216.6%
schedule3302.8%

This PR covers roughly 5,900 min/day, about 51% of all paid macOS minutes, without touching a repository variable.

Pull requests are the right lane to move first for three reasons:

  1. It is where the spend is — more than half of it.
  2. It is the least latency-critical. PR runs are cancelled on supersession by design; ~25% of all macOS minutes in the window were spent on runs that were cancelled mid-flight.
  3. It is the burst-prone lane, and bursts are why overflow exists. Expected concurrent macOS jobs run at ~11.6 mean but spike to ~61 at peak (p95 ~31). Moving the burstiest lane onto sponsored capacity is what reduces the need to reach for paid fan-out in the first place.

Rollback is a variable edit, not a revert

MACOS_RUNNER_PR is new and unset. Unset gives Blacksmith. Setting it to an overflow label restores the previous behaviour for pull requests without reverting this commit:

gh variable set MACOS_RUNNER_PR --repo manaflow-ai/cmux --body '<overflow-label>'

That is deliberate: if PR queue depth on Blacksmith turns out to be worse than expected, the fix is one command and takes effect on the next run, with no code change and no CI restart.

Scope notes

swift-package-tests is deliberately excluded. Its runs-on line is pinned by an exact-string assertion in tests/test_ci_self_hosted_guard.sh because of the dual-SDK sequence (build the Release Ghostty helper under SDK 15, then select Xcode 26 for package tests). Loosening a safety guard for ~574 min/day was not a good trade, and docs/ci-runners.md already documents MACOS_RUNNER_DUAL_XCODE as a Blacksmith label — the variable fix in #13652 covers it.

Fork PRs are unchanged in behaviour. Repository variables are not exposed to fork pull requests, so vars.MACOS_RUNNER_PR is empty for them and they land on the same Blacksmith fallback they already use.

release-build is untouched — it is macOS 26 and gated on full_suite, so it is not part of the compile-only PR lane.

Test

All pass locally:

  • tests/test_ci_self_hosted_guard.sh (includes no workflow falls back to a Warp runner)
  • tests/test_ci_workload_profiles.py
  • tests/test_ci_persistent_mac_compile.py
  • tests/test_ci_app_host_guard_structure.py
  • tests/test_ci_release_guard_structure.py
  • tests/test_ci_merge_queue_required_checks.py
  • tests/test_ci_reusable_workflow_permissions.py
  • tests/test_ci_release_sdk_lane.sh

Because a pull request's CI runs from its own head ref, this PR's own macOS jobs are the first test of the change — they should land on blacksmith-6vcpu-macos-15.

Related

  • #13652 — the measurement, and the repository-variable changes that cover the remaining 49%
  • #13650 — removes the last hardcoded overflow label from .github/workflows

🤖 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

Routes pull-request macOS jobs to Blacksmith to cut paid overflow usage, covering roughly 51% of overflow minutes. All other events keep following the repository variable exactly as before.

Rollback

  • New unset MACOS_RUNNER_PR variable: unset means Blacksmith; set to an overflow label restores previous behavior without reverting.
  • Reverts to old behavior with one command and applies on the next run.

Scope

  • Moved jobs: macos-compile-admission, app-host-unit-tests, tests-build-and-lag, cli-pipe-regressions, and both terminal-hang-diagnostics jobs.
  • Excluded swift-package-tests (pinned runner-line guard) and release-build (macOS 26, gate).
  • Fork pull requests are unaffected; repository variables aren't exposed, so they still use the Blacksmith fallback.