Skip to content

chore(codecs): replace native encoding fixture patch files with cfg-gated code#24971

Open
thomasqueirozb wants to merge 9 commits intomasterfrom
refactor/native-encoding-fixtures-cfg
Open

chore(codecs): replace native encoding fixture patch files with cfg-gated code#24971
thomasqueirozb wants to merge 9 commits intomasterfrom
refactor/native-encoding-fixtures-cfg

Conversation

@thomasqueirozb
Copy link
Contributor

@thomasqueirozb thomasqueirozb commented Mar 20, 2026

Summary

Replaces the loose patch files (vector_generate_fixtures.patch, vrl_generate_fixtures.patch) used to regenerate native encoding test fixtures with proper generate-fixtures feature flags in both this repo and the VRL repo, plus a standalone binary that writes fixtures directly to their committed location.

Key changes:

  • generate-fixtures feature in vector-core activates fixture-stable Arbitrary impls (NaN-safe f64, non-empty names, no timestamps) and pulls in vrl/generate-fixtures automatically
  • Arbitrary impls moved from test/common.rs to event/arbitrary_impl.rs, compiled under any(test, feature = "generate-fixtures")
  • Sub-generators derived from parent via u64::arbitrary(g) instead of Gen::new() (which called from_entropy()) to ensure full determinism
  • AgentDDSketch::set_sum_avg method gated on the feature instead of making fields pub
  • Fixture generation binary (cargo run -p vector-core --features generate-fixtures --bin generate-fixtures) writes directly to lib/codecs/tests/data/native_encoding/

Vector configuration

NA

How did you test this PR?

Ran the binary twice and confirmed identical checksums. Ran cargo test -p vector-core to confirm existing tests pass.

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

@github-actions github-actions bot added the domain: core Anything related to core crates i.e. vector-core, core-common, etc label Mar 20, 2026
@thomasqueirozb thomasqueirozb added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Mar 20, 2026
@thomasqueirozb thomasqueirozb changed the title chore: replace native encoding fixture patch files with cfg-gated generation binary chore(codecs): replace native encoding fixture patch files with cfg-gated code Mar 20, 2026
@thomasqueirozb thomasqueirozb marked this pull request as ready for review March 20, 2026 19:16
@thomasqueirozb thomasqueirozb requested a review from a team as a code owner March 20, 2026 19:16
@pront
Copy link
Member

pront commented Mar 20, 2026

@codex review

Copy link

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

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: 8eaf3cc3b5

ℹ️ 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".

vector-vrl-category = { path = "lib/vector-vrl/category" }
vector-vrl-functions = { path = "lib/vector-vrl/functions", default-features = false }
vrl = { git = "https://github.com/vectordotdev/vrl.git", branch = "main", default-features = false, features = ["arbitrary", "cli", "test", "test_framework", "stdlib-base"] }
vrl = { git = "https://github.com/vectordotdev/vrl.git", branch = "generate-fixtures", default-features = false, features = ["arbitrary", "cli", "test", "test_framework", "stdlib-base"] }

Choose a reason for hiding this comment

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

P1 Badge Keep VRL dependency on stable upstream branch

Switching the workspace vrl dependency from main to the topic branch generate-fixtures makes every normal Vector build depend on an integration branch that is only needed for fixture generation. Because this is declared in the shared workspace dependency, all packages pull from that branch even when generate-fixtures is not enabled; if the branch is force-pushed or removed, dependency resolution breaks for CI and developer builds. Please keep the default dependency on a stable upstream ref (or pin an immutable rev) and scope fixture-only wiring behind the feature path instead.

Useful? React with 👍 / 👎.

Copy link
Member

Choose a reason for hiding this comment

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

@codex @thomasqueirozb will revert the above to main but after this vectordotdev/vrl#1711 is merged first. So you can ignore this finding.

Choose a reason for hiding this comment

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

Understood — thanks for the clarification.

Given your note that this will be reverted to main after vectordotdev/vrl#1711 merges, I’m treating that review finding on Cargo.toml (line 220) as resolved/no action needed for this PR and will not make any follow-up code changes for it.

View task →

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

Labels

domain: core Anything related to core crates i.e. vector-core, core-common, etc 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.

2 participants