Skip to content

chore(confinement): create UnconfinedTemplate and Confined<> abstractions#25938

Draft
thomasqueirozb wants to merge 1 commit into
masterfrom
chore/confined-template-pattern
Draft

chore(confinement): create UnconfinedTemplate and Confined<> abstractions#25938
thomasqueirozb wants to merge 1 commit into
masterfrom
chore/confined-template-pattern

Conversation

@thomasqueirozb

Copy link
Copy Markdown
Member

Summary

Introduces UnconfinedTemplate and Confined<T> as first-class types to make the path-confinement contract explicit at the type level across sinks. Sink config structs now store UnconfinedTemplate; sinks call .confine() in build() to obtain a Template (Confined<UnconfinedTemplate>) that enforces the confinement invariant at render time.

Also fixes a series of RUST_STYLE.md violations and correctness bugs identified during review:

  • use statements inside function bodies moved to top-level imports
  • warn! calls converted to tracing key/value style
  • Inline format string arguments converted to {var} syntax
  • assert!debug_assert! in Confined::confine
  • pub(crate) inner on Confined<T> narrowed to private
  • Confined<UnconfinedTemplate>::metadata() delegates to UnconfinedTemplate::metadata() to preserve docs::templateable in generated schema
  • compute_templated_field_keys extracted as a shared free function in splunk_hec/metrics
  • Hardcoded component name string replaced with Self::NAME in redis/config.rs

Vector configuration

NA

How did you test this PR?

make check-clippy passes.

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

NA

@thomasqueirozb thomasqueirozb added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jul 23, 2026
@github-actions github-actions Bot added domain: transforms Anything related to Vector's transform components domain: sinks Anything related to the Vector's sinks labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sinks Anything related to the Vector's sinks domain: transforms Anything related to Vector's transform components 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.

1 participant