chore(confinement): create UnconfinedTemplate and Confined<> abstractions#25938
Draft
thomasqueirozb wants to merge 1 commit into
Draft
chore(confinement): create UnconfinedTemplate and Confined<> abstractions#25938thomasqueirozb wants to merge 1 commit into
thomasqueirozb wants to merge 1 commit into
Conversation
…s in confined template pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces
UnconfinedTemplateandConfined<T>as first-class types to make the path-confinement contract explicit at the type level across sinks. Sink config structs now storeUnconfinedTemplate; sinks call.confine()inbuild()to obtain aTemplate(Confined<UnconfinedTemplate>) that enforces the confinement invariant at render time.Also fixes a series of
RUST_STYLE.mdviolations and correctness bugs identified during review:usestatements inside function bodies moved to top-level importswarn!calls converted to tracing key/value style{var}syntaxassert!→debug_assert!inConfined::confinepub(crate) inneronConfined<T>narrowed to privateConfined<UnconfinedTemplate>::metadata()delegates toUnconfinedTemplate::metadata()to preservedocs::templateablein generated schemacompute_templated_field_keysextracted as a shared free function insplunk_hec/metricsSelf::NAMEinredis/config.rsVector configuration
NA
How did you test this PR?
make check-clippypasses.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
NA