Skip to content

Add variable composition templates#118

Open
petyosi wants to merge 2 commits into
mainfrom
petyosi/variable-composition-templates
Open

Add variable composition templates#118
petyosi wants to merge 2 commits into
mainfrom
petyosi/variable-composition-templates

Conversation

@petyosi
Copy link
Copy Markdown
Member

@petyosi petyosi commented May 8, 2026

Summary

  • Add managed variable composition with @{variable}@ references, dotted field reads, block-helper control flow, nested composition metadata, and cycle/depth protection.
  • Add template rendering APIs for managed variables, including ResolvedVariable.render() and templateVar() for one-step composition, runtime input rendering, and parsing.
  • Include template_inputs_schema in 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
  • Pre-push hook: package build and package tests

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.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant