Skip to content

chore(vdev): add --features flag and FEATURES env var support to build/check/test commands#25688

Open
pront wants to merge 11 commits into
masterfrom
pront/vdev-features-flag
Open

chore(vdev): add --features flag and FEATURES env var support to build/check/test commands#25688
pront wants to merge 11 commits into
masterfrom
pront/vdev-features-flag

Conversation

@pront

@pront pront commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

All vdev commands that shell out to cargo with a feature set (check rust, build, test, crate_versions) previously accepted features as positional arguments or used an inconsistent --feature (singular) flag. This makes them non-obvious and inconsistent with cargo's own interface.

This PR:

  • Replaces the positional features argument in check rust with a named --features flag (short: -F, comma-separated)
  • Renames --feature--features in build vector and crate_versions
  • Adds an explicit --features flag to test (replacing the implicit passthrough hack)
  • Adds --no-default-features to check rust and test
  • Wires env = "FEATURES" on all --features flags so FEATURES=x,y make check-clippy now works

Before:

cargo vdev check rust default rdkafka-dynamic   # positional, non-obvious
FEATURES=x,y make check-clippy                  # silently ignored

After:

cargo vdev check rust --features default,rdkafka-dynamic
FEATURES=default,rdkafka-dynamic make check-clippy  # works

Vector configuration

N/A — vdev tooling change only.

How did you test this PR?

  • Verified cargo build -p vdev compiles cleanly
  • Pre-push hook ran cargo vdev check rust --all-features successfully
  • Manually verified --help output on check rust, build, test

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

cargo vdev check rust <feature> <feature> (positional) no longer works. Replacement: cargo vdev check rust --features feat1,feat2.

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@github-actions github-actions Bot added the domain: vdev Anything related to the vdev tooling label Jun 26, 2026
@datadog-vectordotdev

This comment has been minimized.

@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jun 26, 2026
@pront pront marked this pull request as ready for review June 26, 2026 21:38
@pront pront requested a review from a team as a code owner June 26, 2026 21:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d0febc2b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vdev/src/commands/check/rust.rs Outdated
Comment thread vdev/src/commands/test.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94bf42ceea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

clippy: bool,

#[arg(value_name = "FEATURE")]
#[arg(short = 'F', long, value_delimiter = ',')]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor FEATURES in check rust

For direct cargo vdev check rust invocations, setting FEATURES=... is still ignored because this new --features field is the only one in the changed commands without env = "FEATURES" (checked check rust --help: it prints -F, --features <FEATURES> with no env marker, while build/test/crate-versions show [env: FEATURES=]). In that scenario FEATURES=component-validation-tests cargo vdev check rust falls through to the --all-features path instead of linting the requested feature set, so the advertised env-var support for check/clippy only works when callers happen to go through the Makefile.

Useful? React with 👍 / 👎.

Comment thread Makefile Outdated
.PHONY: check-clippy
check-clippy: ## Check code with Clippy
$(VDEV) check rust
$(VDEV) check rust $(if $(filter-out default default-msvc,$(FEATURES)),--features $(FEATURES))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Quote forwarded FEATURES in Makefile

When a developer uses the existing space-separated feature style, e.g. make check-clippy FEATURES="default rdkafka-dynamic", this recipe expands to vdev check rust --features default rdkafka-dynamic; I checked the new vdev check rust --help/parser behavior and --features accepts a single <FEATURES> value, so the second feature is treated as an unexpected argument and clippy never runs. The test target already quotes ${FEATURES}, and doing the same here would still let Cargo parse the space-separated feature list.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: vdev Anything related to the vdev tooling no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(vdev): add --features flag to all vdev commands that invoke cargo

1 participant