Skip to content

feat(rust): accept rustup chains, deny-warnings flags and whole-workspace cargo test as CI evidence - #252

Closed
FredApps wants to merge 2 commits into
DiffCI:mainfrom
FredApps:rust/131-ci-evidence
Closed

FredApps wants to merge 2 commits into
DiffCI:mainfrom
FredApps:rust/131-ci-evidence

Conversation

@FredApps

@FredApps FredApps commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #131 (CI invocation evidence). It stays inside the Rust adapter's rust-invocation.ts, plus one line in graph.ts that passes the new option; src/ci-inference is untouched.

Real Rust workflows often failed to count as plain cargo test evidence for small, harmless reasons. This PR accepts four more shapes and still refuses everything else:

  • rustup chains: rustup … && rustup … setup steps. Only rustup subcommands are allowed in the chain, so it can't hide a test run. A ${{ matrix.X }} argument is allowed only when every value of X, in the matrix and in each include entry, is a plain toolchain-like word.
  • Deny-warnings flags: RUSTFLAGS / RUSTDOCFLAGS set to only -Dwarnings (or -D warnings, --deny warnings). Any other flag (cfg, codegen, target features, sanitizers) still makes the evidence advisory.
    Why this is safe: -Dwarnings only turns warnings into errors. It doesn't change what is compiled, which features are on, or which tests run, and it applies the same way to the selected and the full command. A changed crate and every crate that depends on it are always selected, so a warning the change causes (say, a new deprecation used downstream) fails the selected run too. A warning in an unselected crate isn't caused by the change, so it would already fail the full baseline on main.
  • CARGO_TERM_VERBOSE is treated as output-only, like CARGO_TERM_COLOR.
  • cargo test --workspace / --all counts only when plain cargo test already tests every member: a single crate, or a workspace whose default members are all members. The adapter sets rustAllMembersTested from Cargo metadata.

Tests: integration cases for each accepted shape and for the near misses that must stay advisory (other flags, matrix values that aren't plain words, unknown matrix keys, ; or $(…) in the chain, a cargo test with flags inside the chain, and --workspace without allMembersTested). One docs sentence is added.

Note: the branch has a follow-up commit that removes a node_modules symlink I committed by mistake in the first commit; the final tree doesn't have it.

Local checks on this head: typecheck, npm test with DIFFCI_REQUIRE_CARGO=1 (1168 pass), build, audit:boundary. Hosted CI passed on this head.

Merge order (#131 series: #232, #234, #248, #250, #252, #254, #256, #277, #258). These all edit the one-line Rust paragraph in docs/using-diffci.md, and some also touch rust.ts/types.ts, so they conflict textually with each other. #258 already includes #232, #248, #250 and #254 with those conflicts resolved. The simplest path: merge #258 (GitHub marks those four as merged), then #234, #252, #256 and #277. After each one lands I merge main into the next and resolve the docs line. Merging them one at a time in number order works too, with the same main merge after each.

Part of DiffCI#131 (CI invocation evidence). On top of the toolchain and cache actions
already accepted:

- rustup commands chained with && (rustup default stable && rustup update),
  with toolchain arguments from a matrix whose values are plain words in the
  matrix and every include entry;
- RUSTFLAGS / RUSTDOCFLAGS set only to -Dwarnings (or -D warnings), and
  CARGO_TERM_VERBOSE;
- cargo test --workspace / --all, only when Cargo's default members are every
  workspace member, so it runs exactly what plain cargo test runs. The adapter
  reports that as rustAllMembersTested.

Every other flag, chained non-rustup command, expression or environment stays
advisory.

Signed-off-by: FredApps <[email protected]>
@adityankale190895

Copy link
Copy Markdown
Member

#258 is merged (it brought in #232, #248, #250 and #254), along with #228-#231 and #233, so this branch now conflicts with main in docs/using-diffci.md and src/repo/adapters/types.ts, as you expected in #258.

Could you merge main into it? Once it's green I'll check it alongside the other Rust PRs and merge it. Thanks for keeping the Rust series moving.

adityankale190895 pushed a commit that referenced this pull request Nov 18, 2026
…pace cargo test as CI evidence (#252)

rustup steps chained with && (toolchain names from a matrix of plain
words), RUSTFLAGS/RUSTDOCFLAGS set only to -Dwarnings, and
cargo test --workspace/--all when plain cargo test already tests every
member now count as ordinary Rust CI. Anything else stays advisory.

Signed-off-by: FredApps <[email protected]>
@adityankale190895

Copy link
Copy Markdown
Member

Merged to main as 1734480 (squashed, authorship kept). The conflicts in types.ts and the Rust docs paragraph were resolved on main by keeping both sides. Thanks!

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.

2 participants