Skip to content

ci: replace per-crate matrices while preserving feature and MSRV coverage #11199

Description

@alchemydc

Priority: P0
Depends on: #11127 (PR #11128)
Related: #9509

Motivation

The current workflow dynamically creates a 12-package matrix, then runs four stable clippy/build modes and a separate MSRV build for each package. It creates up to 24 large Rust caches and executes through four-job waves. PR #11128 already consolidates these matrix cache keys via a shared key; this issue removes most of the cells themselves.

Cargo-hack's workspace mode invokes Cargo separately for each package, so it preserves the matrix's important feature-unification isolation. The initial analysis's replacement proposal (gist) did not preserve the full command surface:

  • current stable coverage has four modes, not three;
  • clippy runs in every mode;
  • no-default and all-feature checks use all targets;
  • the MSRV matrix uses all features and all targets;
  • cargo build provides final code generation and linking that check/clippy do not;
  • a workspace unit-test build does not replace isolated no-default/all-feature package builds.

The latency-oriented compromise is to keep isolated type/lint coverage on PRs and move isolated final-link coverage to an alerted weekly lane.

Proposed change

Stable PR job

Replace the dynamic stable matrix with one warm-target-directory job that runs these commands sequentially:

cargo hack clippy --workspace -- -D warnings
cargo hack clippy --workspace --no-default-features --all-targets -- -D warnings
cargo hack clippy --workspace --all-targets -- -D warnings
cargo hack clippy --workspace --all-features --all-targets -- -D warnings

Do not add --each-feature or feature powersets; those are stricter than existing policy and belong in a separate proposal.

MSRV PR jobs

Use two jobs because the workspace libraries and binary intentionally have different MSRVs:

# Rust 1.88
cargo hack check --workspace --exclude zebrad --all-features --all-targets

# Rust 1.91
cargo hack check --package zebrad --all-features --all-targets

Disable MSRV cache writes on PRs under #11127 (PR #11128). If measurement shows the separate MSRV caches are too large for their benefit, use cache: false rather than evicting the stable/main cache.

Weekly final-link lane

Run the equivalent four cargo hack build modes weekly, plus the two all-feature/all-target MSRV builds, with failure issue open/update/close-on-recovery behavior. This preserves the link/codegen coverage removed from PRs without keeping it on the merge path.

Remove overlap deliberately

Produce an old-to-new coverage table for:

  • test-crates.yml stable matrix;
  • test-crates.yml MSRV matrix;
  • lint.yml crate-checks;
  • lint.yml workspace clippy jobs;
  • lint.yml check-cargo-lock;
  • the new weekly link lane.

Delete lint.yml's existing cargo hack check --workspace job only after the table shows its guarantee is present in the new stable job. Do not conflate workspace-wide default-release clippy with per-package default-feature clippy.

Acceptance criteria

  • The dynamic package matrix and its per-package cache keys are removed.
  • Stable PR checks retain all four current feature/target/clippy modes with per-package isolation.
  • Rust 1.88 covers every library package and Rust 1.91 covers zebrad, both with all features and all targets.
  • Weekly final-link jobs cover the codegen modes removed from PRs and have recovery-aware alerting.
  • An intentionally introduced default, no-default, all-target, all-feature, and MSRV compile error is caught by the mapped replacement job.
  • The old-to-new coverage table is included in the PR description.
  • p50/p90 critical path and total runner-minute changes are measured over the standard window.

Part of the Improve CI program (#11196)

Drafted with Claude Code from the comparative analysis and the reviewed plan; independently reviewed and corrected with OpenAI Codex. Maintainers remain responsible for validating measurements and approving coverage tradeoffs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-devopsArea: Pipelines, CI/CD and DockerfilesC-enhancementCategory: This is an improvement

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions