Summary
buildTemplateVars strips the inputsID. prefix from all input keys, collapsing every Inputs block into a single flat inputs map. If two Inputs blocks define the same variable name (e.g., both clone-config and overrides define branch), one clobbers the other nondeterministically due to Go map iteration order.
The frontend handles this correctly by scoping variables per inputsId. The test framework should do the same — when a block has inputsId="clone-config", its {{ .inputs.branch }} should resolve from clone-config only, not from a global merge of all Inputs blocks.
Current workaround
In testdata/feature-demos/inputs-and-outputs/runbook_test.yml, we explicitly set overrides.branch: main in the test inputs to prevent the overrides Inputs block's branch default (feature/new-syntax) from clobbering clone-config's branch default (main). Once this bug is fixed, that workaround can be removed.
Reproduction
Remove the overrides.branch: main input from the test YAML and run:
go run main.go test testdata/feature-demos/inputs-and-outputs
The clone-from-inputs block will nondeterministically fail because it may pick up feature/new-syntax instead of main for {{ .inputs.branch }}.
Summary
buildTemplateVarsstrips theinputsID.prefix from all input keys, collapsing every Inputs block into a single flatinputsmap. If two Inputs blocks define the same variable name (e.g., bothclone-configandoverridesdefinebranch), one clobbers the other nondeterministically due to Go map iteration order.The frontend handles this correctly by scoping variables per
inputsId. The test framework should do the same — when a block hasinputsId="clone-config", its{{ .inputs.branch }}should resolve fromclone-configonly, not from a global merge of all Inputs blocks.Current workaround
In
testdata/feature-demos/inputs-and-outputs/runbook_test.yml, we explicitly setoverrides.branch: mainin the test inputs to prevent theoverridesInputs block'sbranchdefault (feature/new-syntax) from clobberingclone-config'sbranchdefault (main). Once this bug is fixed, that workaround can be removed.Reproduction
Remove the
overrides.branch: maininput from the test YAML and run:The
clone-from-inputsblock will nondeterministically fail because it may pick upfeature/new-syntaxinstead ofmainfor{{ .inputs.branch }}.