Skip to content

ci: verify only changed crates and their dependents on pull requests - #24

Draft
atiernan wants to merge 3 commits into
mainfrom
ci/pr-changed-crates
Draft

atiernan wants to merge 3 commits into
mainfrom
ci/pr-changed-crates

Conversation

@atiernan

Copy link
Copy Markdown
Member

On a pull request, CI now verifies only the crates the PR changes and the crates that depend on them, instead of all 22. Pushes to main, and manual runs, still verify every crate.

What runs on a pull request

  • Selection: cargo xtask crates --changed origin/main uses the existing changed::select, against the merge base with main. A stacked PR's selection also includes the lower PRs' crates. That over-selects, which is safe.
  • What still selects every crate:
    • anything shared, as before: Cargo.lock, the workspace manifest, toolchain pins, scripts/ and xtask/;
    • now also .github/workflows/ci.yml;
    • now also any crate's tier or target-tier, compared line by line with the merge base. A tier raise therefore still gets a full verification, as CLAUDE.md rule 7 requires.
  • base, base-macos, miri: fmt, clippy and the static checks still cover the whole workspace. Tests and Miri are narrowed to the selected crates.
  • crate matrix: only the selected groups run. The job is skipped when nothing is selected.
  • Full verification (assemble): the name is unchanged.
    • It fails unless every job it needs succeeded. A skipped crate job is accepted only when nothing was selected.
    • On a PR it requires only the selected crates' measurements, from this commit, and ends in CHANGED CRATES PASSED (n of m …), never ALL CHECKS PASSED.
    • A partial run skips the README-table comparison and still runs the host-shell size check.
  • table: unchanged. It runs only on main, and xtask refuses --write together with --only, so the table is only ever written from a full run.

Docs

CLAUDE.md (rule 7's first bullet and the Workflow "done" sentence), docs/VERIFICATION.md, the ci.yml header and one README sentence now describe partial PR runs. Done still requires the PR's CI to be green and main's full run after the merge to be green.

Checks done

  • cargo test -p xtask: 65 passed, including new tests for the ci.yml and tier rules.
  • clippy and fmt are clean, and cargo xtask check passes.
  • The workflow YAML parses.
  • Local dry runs:
    • a clazel-percent source change selects 11 of 22 crates;
    • a tier edit selects all 22;
    • a ci.yml change selects all 22;
    • a docs-only change selects none.

Not tested yet

The GitHub expressions have not run anywhere: the empty-matrix skip, toJSON(needs) with jq, and fetch-depth: 0 on the merge ref. This PR touches xtask/ and ci.yml, so it selects every crate and won't exercise the partial path. The first crate-only PR after it will.

Branch protection: if it requires individual Verify <crate> checks, those won't appear on PRs that don't select those crates, and the PR will be blocked. Requiring only Full verification avoids this.

🤖 Generated with Claude Code

atiernan and others added 3 commits October 27, 2026 12:38
…ts to a selection

A change to a crate's tier or target-tier, or to .github/workflows/ci.yml,
now selects every crate (rule 7 wants a full verification for a tier raise).
'crates --changed', 'verify --part base|miri --changed' and
'verify --part assemble --only' let a pull request verify only the selected
crates; assemble then ends in CHANGED CRATES PASSED, never ALL CHECKS PASSED.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pushes to main and manual runs still verify every crate. The job named
Full verification keeps its name and reports a partial run as such.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…table comparison

README.md's table can lack rows for crates a pull request did not measure
(and lags main until the table job commits), so comparing it there would fail
spuriously. Main's full run compares and writes it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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