Add variable composition templates#118
Open
petyosi wants to merge 2 commits into
Open
Conversation
Port the Python SDK variable composition work into the JS SDK: managed variable references can compose with @{...}@ syntax, template variables render runtime Handlebars inputs, and validation/push paths understand template input schemas.
Also adds focused composition/template validation tests, docs, the Node example, and a changeset so the public API change is tracked.
The composed_from span attribute is the only piece of composition metadata that crosses the SDK boundary into trace exporters. Python emits a flat, snake_cased projection per top-level reference; the JS SDK was stringifying the full ComposedReference tree, which both duplicated potentially large `value` payloads onto every resolution span and used a camelCase nested key, so any consumer walking the chain across SDKs would see a different shape. Project the same five fields (name, version, label, reason, error) Python emits, and drop the recursive nesting so the wire format matches across SDKs.
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
@{variable}@references, dotted field reads, block-helper control flow, nested composition metadata, and cycle/depth protection.ResolvedVariable.render()andtemplateVar()for one-step composition, runtime input rendering, and parsing.template_inputs_schemain local config, validation, sync/write bodies, docs, examples, and release notes.Why
This ports the Python SDK variable composition/template behavior into the JavaScript SDK so managed variables can share reusable fragments, preserve runtime
{{...}}placeholders, and validate template inputs before pushing remote configs.Validation
pnpm run check