Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(template): parse template strings in varfiles #6844

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

vvagaytsev
Copy link
Collaborator

@vvagaytsev vvagaytsev commented Feb 12, 2025

What this PR does / why we need it:

A follow-up fix for #6745

Which issue(s) this PR fixes:

Fixes #6843

Special notes for your reviewer:

@vvagaytsev vvagaytsev force-pushed the fix/parse-vars-in-varfiles branch from 705e517 to f96c3dd Compare February 12, 2025 12:37
Copy link
Collaborator

@thsig thsig left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@vvagaytsev vvagaytsev added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit f855d91 Feb 12, 2025
40 checks passed
@vvagaytsev vvagaytsev deleted the fix/parse-vars-in-varfiles branch February 12, 2025 18:17
configRoot: projectConfig.path,
path: environmentConfig.varfile,
defaultPath: defaultEnvVarfilePath(environment),
})
const envVarfileVars = parseTemplateCollection({
value: rawEnvVarfileVars,
source: { path: ["varfile"], yamlDoc: projectConfig.internal.yamlDoc },
Copy link
Member

Choose a reason for hiding this comment

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

@thsig @vvagaytsev the source path and yamlDoc are incorrect; This will lead to confusing error messages when varfiles contain invalid template strings.

The minimum correct value here is source: { path: [] } if it's not yaml; to get correct source mapping for yaml varfiles we need to call parseTemplateCollection in loadVarfile, so we can pass the yaml document.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Thanks for fixing this in the follow-up PR.

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.

[Bug]: Templating in sync.paths[].mode not working since 0.13.53
3 participants