Skip to content

ops(001,027,031): runner disk freed for acceptance; PR runs skip unaffected bindings and release checks - #461

Merged
bartekus merged 1 commit into
mainfrom
ops/ci-pr-scope
Nov 3, 2026
Merged

bartekus merged 1 commit into
mainfrom
ops/ci-pr-scope

Conversation

@bartekus

@bartekus bartekus commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Two changes to CI throughput from the 2026-11-02 audit. Both are workflow edits, so this PR needs the owner's statecraft-review-exception approval once.

1. Runner disk (spec 001, verify.yml). On 2026-11-02, "Disk quota exceeded" failed merge-queue entries in the acceptance groups: rustc writing output in evaluation, and the seed workers' target copy in cli-backends, twice. Each failure also rebuilt every queue entry behind it. Each acceptance group now starts by removing preinstalled toolchains that no group uses (dotnet, Android, GHC, CodeQL) and prints df before and after, so the next measurement has data. #460 is the matching fix inside seeds.py.

2. PR runs skip jobs whose inputs they don't change (specs 027 and 031).

  • New script scripts/acceptance/affected.py, with unit tests that run in verify / plan. It answers whether a pull request changes any of a job's inputs:

    • the named workspace packages and their path dependencies, read with cargo metadata --no-deps (no registry access);
    • any path prefixes given;
    • the workspace-wide files (Cargo.toml, Cargo.lock, rust-toolchain.toml, Makefile, .cargo/).

    Any doubt answers "affected": no base, a failed diff, or unreadable metadata.

  • bindings.yml: the scope job asks about rustev-node, rustev-wasm, rustev-fp-corpus, tools/rustev-conformance/, the workflow and the script. On main from 10-20 to 11-02, 131 of 312 merged commits touched none of these, about 42%. Those PRs skip 10 jobs, three of them on macOS or Windows runners.

  • release-checks.yml: a new scope job asks about every workspace package, tools/rustev-conformance/js/, the workflow and the script. That skips the 10 release-check jobs for spec-only and docs-only PRs.

  • Each workflow gets a final bindings or release-checks job, following verify.yml's verify job. The caller's result is that job's, and it accepts a skipped job only when scope chose to skip it. So ci-gate still sees success or a real failure.

  • Merge-queue entries, pushes to main, and PRs labelled statecraft:stacked-ci run every job, as before. Nothing reaches main with less testing.

Spec records: 001, 027 and 031 each get one dated "CI only" line. No spec claim changes.

Verification

  • make gate and scripts/check-authored-content.sh pass.
  • python3 -m unittest discover -s scripts/acceptance -p 'test_*.py': 10 tests pass.
  • actionlint on the three workflows reports one pre-existing SC2016 info only.
  • Locally, affected.py --base origin/main~5 with the bindings inputs answers true (11 of 34 changed files are inputs).
  • This PR's own run changes bindings.yml, release-checks.yml and affected.py, so it runs everything. The skip path gets checked on the first spec-only PR after this lands; I'll confirm it there.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (no-findings)

I reviewed the PR, which adds scope-based CI skipping to bindings.yml and release-checks.yml using a new scripts/acceptance/affected.py Python script, adds a disk-cleanup step to verify.yml, and documents these changes in specs 001, 027, and 031.

Workflow logic

The gate jobs (bindings, release-checks) both follow the pattern established by verify.yml: if: always(), needs all leaf jobs plus scope, then shell that fails unless scope is success and every leaf job is success (or all are skipped when scope chose to skip). If scope itself fails, its output run is empty, the if: needs.scope.outputs.run == 'true' conditions evaluate false (leaf jobs become skipped), $SCOPE is not success, and the gate fails — the correct direction. No false pass path.

affected.py correctness

  • The cargo metadata --no-deps call returns workspace members only; registry deps have no path field, so dep.get("path") returns None and they are correctly skipped. Path deps carry their absolute directory path, matching by_dir keys (parent of manifest_path). Consistent with the unit test mock.
  • The git diff --name-only BASE...HEAD (three-dot) correctly computes the symmetric diff from the merge base to HEAD for PR events. fetch-depth: 0 ensures the full history is available for the merge-base lookup.
  • The broad except Exception catch-all returns "true" (affected) on any failure — correct fail-safe direction.
  • The affected() predicate (f == p.rstrip("/") or f.startswith(p)) correctly distinguishes crates/a/ from crates/ab/. The WORKSPACE_FILES tuple correctly catches root-level files (Cargo.toml, Cargo.lock, rust-toolchain.toml, Makefile) and the .cargo/ directory.

Security

GitHub context values (BASE_SHA, STACKED_CI, EVENT) are passed via env: and double-quoted in the shell scripts — no injection path. The Python subprocess.run calls use list form, not shell strings.

Spec compliance

All three spec changelog entries accurately describe the CI-only changes. The qualifying note "CI only, no claim of this spec changes" appropriately signals no normative update.

No concrete defects found.

{"head": "edaba0a23c7e0215973888914f02f6079ff9ba41", "verdict": "no-findings", "findings": []}

Subject: 9fca258...edaba0a, diff digest 11e84ad3bb82f3ab0052f3292f1f853443c530aa1a739ace229c467355cc93b5, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 2, 2026 23:55 — with GitHub Actions Inactive
@bartekus
bartekus enabled auto-merge November 3, 2026 01:29
…fected bindings and release checks

verify.yml's acceptance groups remove unused preinstalled toolchains and
record df. scripts/acceptance/affected.py answers whether a pull request
changes a job's inputs; bindings.yml and release-checks.yml leave their jobs
out of a pull request's own run when it does not. The merge queue and every
push to main still run every job.
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff: a new affected.py skip-early heuristic for bindings.yml and release-checks.yml, a disk-free step in verify.yml, and matching spec changelog entries.

scripts/acceptance/affected.py

  • closure() builds by_dir keyed by resolved parent of each manifest_path, then looks up dep["path"] via Path(path).resolve(). Since cargo metadata emits absolute paths for path dependencies, this resolves correctly; the tests use absolute paths consistently.
  • affected() strips trailing slashes for exact-file matching and uses startswith for directory prefixes. The edge case "crates/ab/...".startswith("crates/a/") is handled correctly (the test confirms it). WORKSPACE_FILES entries without slashes (e.g., "Cargo.toml") are matched exactly at the workspace root, not inside subdirectories. No issue.
  • Failure paths (no base, failed subprocess, unreadable metadata) all fall into the except Exception block and print true, satisfying the "any doubt runs the job" contract.
  • git diff --name-only BASE...HEAD (three-dot) is the correct comparison for a PR with fetch-depth: 0. ✓

bindings.yml / release-checks.yml guard jobs

Guard jobs use if: always() and inspect needs.scope.outputs.run:

want=success; [ "$RUN" = false ] && want=skipped
for r in $RESULTS; do test "$r" = "$want" || { echo "..."; exit 1; }; done
  • When scope fails: SCOPE=failure, test "failure" = success exits 1. ✓
  • When run=true: want=success; any skipped or failed job is caught. ✓
  • When run=false: want=skipped; any unexpectedly-run or failed job is caught. ✓
  • Matrix jobs (adoption, native): GitHub aggregates all matrix results into one (skipped when all skip, failure if any fail). Guard handles this correctly. ✓

verify.yml disk-free step: paths are hardcoded system paths, || true silently ignores missing paths, sudo rm -rf operates outside the workspace. No injection risk; correct.

Spec entries in 001, 027, and 031 are changelog-only additions, consistent with the governance rule that spec-first development records operational changes in the owning spec's history section.

No concrete defects found.

{"head": "25c284c0582e6886e7b8abb8aba07e1157e79ac5", "verdict": "no-findings", "findings": []}

Subject: 41b490d...25c284c, diff digest 75b8937d76cde458f7ddf0780b4f9e7feb3c45759edf112b377323a5631c792e, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 3, 2026 01:57 — with GitHub Actions Inactive
@bartekus
bartekus added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit b1f3d3b Nov 3, 2026
33 checks passed
@bartekus
bartekus deleted the ops/ci-pr-scope branch November 3, 2026 03:50

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 25c284c0 Deployed Nov 3, 2026 by bartekus via review-exception #3061
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