-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Populate pulumi:template tag also for interactively selected templates #16308
Conversation
Changelog[uncommitted] (2024-06-03)Bug Fixes
|
@@ -201,7 +204,7 @@ func runNew(ctx context.Context, args newArgs) error { | |||
} else if len(templates) == 1 { | |||
template = templates[0] | |||
} else { | |||
if template, err = chooseTemplate(templates, opts); err != nil { | |||
if template, err = args.chooseTemplate(templates, opts); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a slightly terrifying change in terms of a potential nil reference panic. I think I checked and it should be fine - but may I ask the reviewer to double-check that we'll never pass nil
here from the CLI binary (not tests)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can't find any instances other than newNewCmd
.
Planning to include #16322. Other than that, tentative changelog: ### Features - [auto/{go,nodejs,python}] Add support for `--all` parameter of the `stack ls` command to the Automation API [#16266](#16266) ### Bug Fixes - [cli/new] Populate pulumi:template tag also for interactively selected templates [#16308](#16308) - [backend/service] Improve error reporting when policy pack download fails [#16306](#16306) ### Miscellaneous - [sdk/python] Move dependency installation and python command invocation to Toolchain interface [#16243](#16243)
To be merged after #16322 and #16323 Tentative changelog: ### Features - [auto/{go,nodejs,python}] Add support for `--all` parameter of the `stack ls` command to the Automation API [#16266](#16266) ### Bug Fixes - [cli/new] Populate pulumi:template tag also for interactively selected templates [#16308](#16308) - [backend/service] Improve error reporting when policy pack download fails [#16306](#16306) ### Miscellaneous - [sdk/python] Move dependency installation and python command invocation to Toolchain interface [#16243](#16243)
Description
The following lines are added to
Pulumi.yaml
after apulumi new
command:where
pulumi:template
points to a name or a URL of the template that was used for project instantiation.The problem is that this currently works only if the template name is specified as a CLI argument, not selected interactively. This PR fixes the field population for the interactive case by using
template.Name
for the tag value, not just the input argument.Fixes #16037
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change