Skip to content

chore(dev): add generate-fixtures feature#1711

Open
thomasqueirozb wants to merge 10 commits intomainfrom
generate-fixtures
Open

chore(dev): add generate-fixtures feature#1711
thomasqueirozb wants to merge 10 commits intomainfrom
generate-fixtures

Conversation

@thomasqueirozb
Copy link
Copy Markdown
Contributor

@thomasqueirozb thomasqueirozb commented Mar 20, 2026

Summary

This cfg-gates the following patch: https://github.com/vectordotdev/vector/blob/v0.54.0/lib/codecs/tests/data/native_encoding/vrl_generate_fixtures.patch

Change Type

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

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

See the counterpart Vector PR

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.

Checklist

References

@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 disabled auto-merge March 20, 2026 19:19
@pront pront changed the title chore: add generate-fixtures feature chore(dev): add generate-fixtures feature Mar 20, 2026
@pront
Copy link
Copy Markdown
Member

pront commented Mar 20, 2026

@codex review

Copy link
Copy Markdown

@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: 440297abba

ℹ️ 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 on lines +29 to +32
while value.is_nan() || value == -0.0 {
value = f64::arbitrary(g) % MAX_F64_SIZE;
}
(value * 10_000.0).round() / 10_000.0
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 Recheck rounded float before returning

In generate-fixtures mode, the pre-filter only rejects NaN/zero before rounding, but (value * 10_000.0).round() / 10_000.0 can still produce signed zero from small negative inputs (for example -0.00001 rounds to -0.0). That means this path can emit the exact -0.0 representation the feature is intended to avoid for stable JSON/protobuf fixtures, so the result should be normalized or validated again after rounding.

Useful? React with 👍 / 👎.

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

Labels

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