ci: light-classify inert scripts and stop allocating macOS/Windows runners for light PRs#4025
ci: light-classify inert scripts and stop allocating macOS/Windows runners for light PRs#4025Hmbown wants to merge 1 commit into
Conversation
Light PRs (docs / inert scripts) were allocating macOS/Windows Test legs just to echo a skip step, and shell-script-only PRs like #4024 were misclassified heavy and ran the full cargo-test matrix (8-14 min) for a change that cannot affect any Rust build/test outcome. - test + npm-wrapper-smoke: runs-on now collapses every matrix leg onto ubuntu-latest for light changes and uses the real matrix.os only for heavy changes. The six ruleset-required contexts (Lint, Test (ubuntu/macos/windows-latest), Version drift, npm wrapper smoke (ubuntu-latest)) derive from job name + matrix.os and are preserved because they are independent of runs-on. - change detection: light-classify four provably-inert or always-covered paths (scripts/v0867-setup-qa.sh, scripts/release/check-versions.sh, scripts/release/check-ohos-deps.sh, scripts/check-coauthor-trailers.py); an ordered first case arm hard-forces heavy for the must-stay-heavy triggers (scripts/mobile-smoke.sh, scripts/release/npm-wrapper-smoke.js, scripts/check-provider-registry.py). The fail-safe default-heavy arm is retained for anything unknown. - add a read-only `sccache --show-stats` observability step (continue-on-error) to each sccache-enabled job; no new cache system and no cache-key changes. Signed-off-by: Hunter B <hmbown@gmail.com>
|
Claude finished @Hmbown's task in 2m 36s —— View job Reviewing PR #4025
SummaryThis is a well-reasoned, self-consistent CI-only change. I independently verified the key factual claims in the PR body rather than taking them on faith:
No correctness bugs, and no provider/model-prefix inference concerns apply here (this diff touches only Minor, non-blocking nit: the Nice attention to detail on the fail-safe ordering (must-stay-heavy matched before the light allowlist) and on proving each newly-light path is either provably inert or covered by an always-on job. |
Problem
PR #4024 changed only
scripts/v0867-setup-qa.sh(a headless developer QA probe wired into no CI job), yet change-detection emittedheavy=true. That forcedTest (macos-latest)to run a fullcargo test --workspacefor 8m53s,Test (windows-latest)for 13m59s, andMobile runtime smokefor 6m22s. A bash QA probe cannot affect any Rust build/test outcome, so all of that was wasted, and even for genuinely light PRs the macOS/WindowsTestlegs still allocated scarce macOS/Windows runners just to run an echo.Fix
testandnpm-wrapper-smokejobs now useruns-on: ${{ needs.changes.outputs.heavy == 'true' && matrix.os || 'ubuntu-latest' }}. Light changes run every matrix leg onubuntu-latest(the legs only echo their skip step); heavy changes still allocate real macOS/Windows/Linux runners exactly as before.scripts/v0867-setup-qa.sh,scripts/release/check-versions.sh,scripts/release/check-ohos-deps.sh,scripts/check-coauthor-trailers.py. A new firstcasearm hard-forces heavy for the must-stay-heavy triggers (npm-wrapper-smoke.js,mobile-smoke.sh,check-provider-registry.py).sccache --show-statsstep (continue-on-error: true) was added to each sccache-enabled job. No new cache system, no key changes.Why safe
Context preservation. All six ruleset-required contexts are byte-identical:
Lint,Test (ubuntu-latest),Test (macos-latest),Test (windows-latest),Version drift,npm wrapper smoke (ubuntu-latest). Matrix check-context names derive from jobname:+matrix.osand are independent ofruns-on, so redirecting a leg to ubuntu keeps its required name.Coverage. Each newly-light path is proven covered or inert:
v0867-setup-qa.shis referenced by no Rust test, nobuild.rs, and no workflow (verified by grep), so no job ever runs it;check-versions.sh/check-ohos-deps.shrun in the always-onVersion driftjob (noneeds/if);check-coauthor-trailers.pyruns in the always-on non-schedule lint step. The three heavy-gated triggers are matched first and stay heavy, and the fail-safe default-heavy*)arm is retained for anything unknown. The heavy path is behaviorally unchanged.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"parses cleanly and all eight jobs load.scripts/v0867-setup-qa.shreportsheavy=false, all six required contexts go green, and no macOS/Windows runner is allocated.crates/**or any.rsstill reportsheavy=trueand runs the full heavy suite on real macOS/Windows.scripts/mobile-smoke.sh,scripts/release/npm-wrapper-smoke.js, orscripts/check-provider-registry.pystill reportsheavy=true.🤖 Generated with Claude Code
https://claude.ai/code/session_01PKHUCQqvi6MVgJhnQrFZ1H