Do not resolve params of irrelevant stages - #425
Open
mnapoli wants to merge 2 commits into
Open
Conversation
Deferring params of irrelevant stages also deferred sections configured
with a single variable (e.g. `params.prod: ${file(./prod-params.yml)}`).
Such a section was then left as a raw string in the configuration, and
failed validation with `Configuration error at 'params.prod': must be
object`.
Also skip deferral entirely while the effective stage is not known yet
(`provider.stage` configured behind a variable which did not resolve).
Deferring against a stage which is about to change could otherwise leave
params of the effective stage never scheduled for resolution.
Claude-Session: https://claude.ai/code/session_01KjRVxH8vbJpzfQMsMD2nTg
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.
Variables in
params.<stage>sections are now only resolved for the effective stage (anddefault). Params of other stages are left untouched: their sources are not invoked (no wasted SSM/remote calls) and their errors (unknown sources, missing env vars, etc.) no longer fail the command.Explicit references like
${self:params.prod.domain}still resolve the targeted property on demand, exactly as before. Variable syntax errors are still reported for all stages.Known limitation: when the whole
paramsobject comes from a single variable (e.g.params: ${file(./params.yml)}), its content is discovered mid-pass and resolved eagerly as before.