Skip to content

refactor(codecs): use a validated ASCII character type - #26632

Merged
thomasqueirozb merged 1 commit into
masterfrom
pront-ascii-char-config
Oct 9, 2026
Merged

thomasqueirozb merged 1 commit into
masterfrom
pront-ascii-char-config

Conversation

@pront

@pront pront commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

ASCII configuration fields currently use u8 with per-field Serde adapters. Configs accept a single ASCII character, but schema generation sees an integer. Introduce AsciiChar so the Rust type, serialization, and generated schema describe the same contract.

  • Use the validated type for character-delimited framing and CSV delimiter, escape, and quote options. Runtime encoders and decoders still use u8.
  • Replace the old adapter tests with one shared contract test covering every ASCII character, invalid inputs, defaults, round-tripping, and schema generation.
  • Teach the docs generator to preserve string defaults and bump vdev to 0.3.30. Regenerated CUE files and configuration examples are unchanged.

Accepted user configurations and runtime output are unchanged. Rust callers constructing these configuration fields now use AsciiChar; byte-oriented runtime constructors are unchanged.

This is an independent prerequisite for the parse-first work, based on master, with no configuration-loader changes.

References

Related: #26475

Vector configuration

Used to compare custom framing and CSV output against the released binary:

sources:
  input:
    type: stdin
    framing:
      method: character_delimited
      character_delimited:
        delimiter: "|"
    decoding:
      codec: json
sinks:
  output:
    type: console
    inputs: [input]
    target: stdout
    encoding:
      codec: csv
      csv:
        fields: [message]
        delimiter: ","
        escape: "\\"
        quote: "$"
        double_quote: false

How did you test this PR?

  • make fmt and full-workspace make check-clippy (all targets and all features).
  • Scoped make test for all vector-core, codecs, and vdev tests, plus Vector HTTP/framing tests: 947 passed, no retries (2,752 outside the scope or ignored).
  • Regenerated docs using the local vdev, then ran the generated-docs and component-example checks: no generated-file changes; 248 examples passed, 4 skipped.
  • Built the default/vendored Vector binary on macOS arm64 and compared it with released Vector 0.58.0: five ASCII config cases matched, and the custom framing/CSV pipeline above produced byte-for-byte identical output.

Ad-hoc comparison fixtures and reports are local-only and are not included in this 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.

Contributor Guidelines

@pront
pront requested a review from a team as a code owner October 9, 2026 20:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T20:42:09.825466Z f3d6a44 PR opened
🔒 Security Review ✅ Completed 2026-10-09T20:42:06.773260Z f3d6a44 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources domain: sinks Anything related to the Vector's sinks domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: vdev Anything related to the vdev tooling labels Oct 9, 2026
@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Oct 9, 2026

@datadoghq-integration datadoghq-integration 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.

Bits Code Review: PASS

More details

The shared type preserves single-ASCII-character deserialization and runtime byte conversions while making generated schemas describe string fields and retaining documentation defaults.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit f3d6a44

@pront
pront enabled auto-merge October 9, 2026 20:48
@pront
pront added this pull request to the merge queue Oct 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 9, 2026
@thomasqueirozb
thomasqueirozb added this pull request to the merge queue Oct 9, 2026
Merged via the queue into master with commit be6be60 Oct 9, 2026
109 of 110 checks passed
@thomasqueirozb
thomasqueirozb deleted the pront-ascii-char-config branch October 9, 2026 22:25
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: sinks Anything related to the Vector's sinks domain: sources Anything related to the Vector's sources 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.

2 participants