Skip to content

fix(cli): validate transform VRL with --no-environment#25161

Draft
pront wants to merge 3 commits intomasterfrom
codex/fix-validate-no-environment-vrl
Draft

fix(cli): validate transform VRL with --no-environment#25161
pront wants to merge 3 commits intomasterfrom
codex/fix-validate-no-environment-vrl

Conversation

@pront
Copy link
Copy Markdown
Member

@pront pront commented Apr 10, 2026

Summary

This fixes vector validate --no-environment so it still reports transform VRL and condition compilation errors.

The root cause was that --no-environment skipped the normal transform build path where these transform-local checks happen. This PR now validates transforms through their normal build() path during --no-environment, while explicitly skipping aws_ec2_metadata because its build() currently performs environment-dependent work.

Vector configuration

data_dir: "${VECTOR_DATA_DIR}"

sources:
  in:
    type: demo_logs
    format: shuffle
    lines:
      - log

transforms:
  broken:
    inputs:
      - in
    type: remap
    source: |
      .foo = to_int(.bar)

sinks:
  out:
    inputs:
      - broken
    type: blackhole

How did you test this PR?

  • Added CLI regression coverage for vector validate --no-environment with an invalid remap program.
  • Added CLI coverage showing a condition-based transform is validated through its normal build() path.
  • Added CLI coverage showing aws_ec2_metadata is skipped during --no-environment validation.
  • Ran cargo test --test integration --features cli-tests validate_no_environment_ -- --nocapture
  • Ran make fmt
  • Ran make check-clippy
  • Ran ./scripts/check_changelog_fragments.sh

Change Type

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

Is this a breaking change?

  • Yes
  • No

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

Notes

  • aws_ec2_metadata remains a targeted exception because its build() currently performs network initialization.
  • This PR adds changelog.d/15037_validate_no_environment_vrl.fix.md.

@github-actions github-actions bot added the domain: transforms Anything related to Vector's transform components label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: transforms Anything related to Vector's transform components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate no-environment should perform transform/filter VRL checks

1 participant