Skip to content

feat(rust): keep required-feature targets' packages whole instead of blocking the repository - #248

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:rust/131-required-features
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:rust/131-required-features

Conversation

@FredApps

@FredApps FredApps commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #131 (external dependency inputs / workspace scope).

One Cargo target with required-features anywhere in the workspace used to block the whole repository ("Cargo targets requiring features…"). That alone kept many real workspaces FULL. This PR drops that repo-wide blocker and handles these targets where they matter:

  • The adapter records requiredFeatures on each test target (rustTestTargets).
  • The planner never names a gated target, because --test name makes Cargo fail when the feature is off. Its package always runs whole, as -p pkg, so Cargo skips or runs the target exactly as the full cargo test does. The usual feature-coverage check still applies to that command.
  • A malformed requiredFeatures value (empty, not an array, not strings) is refused, so a bad cache fails closed.

Tests: the updated adapter test, a real-Cargo workspace test with a gated crate and an enabler crate, and a planner test. The docs reason table is updated.

Local checks on this head: npm ci, npm run typecheck, npm test with DIFFCI_REQUIRE_CARGO=1 (1169 pass), npm run build, npm run 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.

…blocking the repository

Part of DiffCI#131. A Cargo target with required-features no longer makes every change
fall back. The adapter records the target's required features, and the planner
keeps that package whole (cargo test -p name, never --test name), so Cargo runs or
skips the target exactly as the full cargo test does. The existing feature check
gives the package the full run's features, so the gate evaluates the same way.

Signed-off-by: FredApps <[email protected]>
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