Skip to content

fix: give template-valued inputs their declared type before rendering - #482

Draft
ZachGoldberg wants to merge 1 commit into
mainfrom
list-output-defaults
Draft

ZachGoldberg wants to merge 1 commit into
mainfrom
list-output-defaults

Conversation

@ZachGoldberg

Copy link
Copy Markdown
Collaborator

A Template variable whose value is an output reference, such as {{ .outputs.query_existing_config.AllowedLocations }}, renders to text. So a list variable reached the template as the string ["eastus","eastus2"], and a template that ranges over it failed:

common.hcl:10:49: at <.AllowedLocations>: range can't iterate over ["eastus","eastus2"]

int, float, bool and map variables had the same problem. Found running the Azure landing zone upgrade-landing-zone runbook, whose Generate form takes every value from an earlier step's outputs.

The render path now reads each variable's declared type from the template's boilerplate.yml and, after resolving references, converts a string that parses as that type (coerceToDeclaredTypes in flattenInputs.ts). Strings that don't parse are left for boilerplate's own validation.

Not covered here: the form still shows list and number fields with an output-reference default as empty, though they render correctly now. That display bug is separate.

Tests: new unit tests in flattenInputs.test.ts; just check, backend and integration tests pass (2 backend tests fail on this machine's Git 2.34 with or without this change).

A Template variable whose value is a reference such as {{ .outputs.query.AllowedLocations }}
renders to text, so a list variable arrived as the string ["eastus","eastus2"] and a template
that ranges over it failed: range can't iterate over ["eastus","eastus2"]. Ints, floats, bools
and maps had the same problem. The render path now reads each variable's type from the template's
boilerplate.yml and converts a resolved string that parses as that type.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
runbooks Ready Ready Preview Nov 20, 2026 11:17pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch was successfully deployed

1 active deployment
Preview — 6c81051b Deployed Nov 20, 2026 by vercel[bot]
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