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

Query language runtime for options during “pulumi new” #16346

Merged
merged 18 commits into from
Jun 17, 2024

Conversation

julienp
Copy link
Contributor

@julienp julienp commented Jun 7, 2024

Description

Fixes #16309

During pulumi new we query the language runtime using the new RuntimeOptionsPrompts RPC call to get additional prompts to ask the user.

Screenshot 2024-06-07 at 14 28 58

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Jun 7, 2024

Changelog

[uncommitted] (2024-06-17)

Features

  • [cli/new] Allow passing runtime options as args in pulumi new
    #16346
    #16347

  • [cli/new] Query language runtime for options during “pulumi new”
    #16346

  • [sdk/python] Automatically convert requirements.txt to pyproject.toml when using Poetry
    #16346
    #16354

@julienp julienp force-pushed the julienp/pulumi-new-options branch 2 times, most recently from 5b9540f to 10510d9 Compare June 7, 2024 13:04
pkg/cmd/pulumi/new.go Outdated Show resolved Hide resolved
@julienp julienp force-pushed the julienp/pulumi-new-options branch from 10510d9 to a66cb73 Compare June 7, 2024 13:45
@julienp julienp marked this pull request as ready for review June 7, 2024 15:23
@julienp julienp requested a review from a team as a code owner June 7, 2024 15:23
pkg/cmd/pulumi/new.go Show resolved Hide resolved
pkg/cmd/pulumi/new.go Outdated Show resolved Hide resolved
@julienp julienp marked this pull request as draft June 10, 2024 12:48
@julienp julienp force-pushed the julienp/pulumi-new-options branch from a66cb73 to 720bcdc Compare June 10, 2024 12:48
@julienp julienp marked this pull request as ready for review June 10, 2024 12:48
@julienp julienp marked this pull request as draft June 10, 2024 12:53
@julienp julienp marked this pull request as ready for review June 10, 2024 12:53
Copy link
Collaborator

@tgummerer tgummerer 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!

pkg/cmd/pulumi/new.go Outdated Show resolved Hide resolved
pkg/cmd/pulumi/new.go Outdated Show resolved Hide resolved
julienp and others added 2 commits June 17, 2024 12:28
Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
@julienp julienp added this pull request to the merge queue Jun 17, 2024
@julienp julienp removed this pull request from the merge queue due to a manual request Jun 17, 2024
@julienp julienp enabled auto-merge June 17, 2024 16:38
@julienp julienp added this pull request to the merge queue Jun 17, 2024
Merged via the queue into master with commit a59b694 Jun 17, 2024
93 checks passed
@julienp julienp deleted the julienp/pulumi-new-options branch June 17, 2024 18:20
github-merge-queue bot pushed a commit that referenced this pull request Jun 21, 2024
#16346 introduced the capability to
query the language runtime for additional prompts. We use this to let
the user pick a package manager among npm, yarn and pnpm during `pulumi
new` when using the nodejs runtime.

When there is no explicitly configured package manager, we re-use the
previous behaviour for determining the package manager (check
`PULUMI_PREFER_YARN` env variable, look for lock files).

Defaults to `npm` when running `new` in non-interactive mode.
github-merge-queue bot pushed a commit that referenced this pull request Jun 21, 2024
Tentative changelog:

### Features

- [sdk/go] Suggest valid attributes with similar names to unrecognised
ones when validating project definitions
  [#16097](#16097)

- [cli/new] Allow passing runtime options as args in pulumi new
  [#16346](#16346)

- [cli/new] Query language runtime for options during “pulumi new”
  [#16346](#16346)

- [sdk/nodejs] Detect pnpm workspaces when running pulumi install
  [#15525](#15525)

- [sdk/nodejs] Add options to Workspace::removeStack()
  [#16333](#16333)

- [sdk/python] Automatically convert requirements.txt to pyproject.toml
when using Poetry
  [#16346](#16346)

- [sdkgen/python] Generate TypedDict types for inputs
  [#15957](#15957)


### Bug Fixes

- [engine] Fix a panic when ignoring wildcard values with arrays of
different length
  [#16406](#16406)

- [cli/engine] Fix --continue-on-error running indefinitely when a
resource fails to be created or updated
  [#16371](#16371)

- [cli/plugin] Fix plugin install command when plugin type is tool
  [#16407](#16407)

- [sdk/python] Don't incorrectly emit deprecation warnings for
non-deprecated properties
  [#16400](#16400)

- [sdk/python] Handle extra CLI arguments passed policy packs plugins
  [#16402](#16402)

- [sdk/python] Add VIRTUAL_ENV environment variable when running inside
a virtual environment


### Miscellaneous

- [cli/new] Instruct the user to use 'pulumi install' when using
--generate-only
@justinvp justinvp mentioned this pull request Jun 21, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 22, 2024
Waiting on #16441, but there are
also a few other fixes in the queue that I'll opportunistically wait on
as well.

Tentative changelog:

### Features

- [engine] Resolve provider in the engine before passing it to
transforms
  [#16409](#16409)

- [sdk/go] Suggest valid attributes with similar names to unrecognised
ones when validating project definitions
  [#16097](#16097)

- [cli/new] Allow passing runtime options as args in pulumi new
  [#16346](#16346)

- [cli/new] Query language runtime for options during “pulumi new”
  [#16346](#16346)

- [cli/new] Add packagemanager prompt to pulumi new for nodejs
  [#16417](#16417)

- [sdk/nodejs] Detect pnpm workspaces when running pulumi install
  [#15525](#15525)

- [sdk/nodejs] Add options to Workspace::removeStack()
  [#16333](#16333)

- [sdk/python] Automatically convert requirements.txt to pyproject.toml
when using Poetry
  [#16346](#16346)

- [sdkgen/python] Generate TypedDict types for inputs
  [#15957](#15957)


### Bug Fixes

- [engine] Fix a panic when ignoring wildcard values with arrays of
different length
  [#16406](#16406)

- [cli/engine] Fix --continue-on-error running indefinitely when a
resource fails to be created or updated
  [#16371](#16371)

- [sdk/nodejs] Avoid an unhandled error when `dependencies` is missing
from `package.json` during closure serialization
  [#16433](#16433)

- [cli/plugin] Fix plugin install command when plugin type is tool
  [#16407](#16407)

- [sdk/python] Fix Python SDK docs by escaping the trailing underscore
in a docstring
  [#14866](#14866)

- [sdk/python] Don't incorrectly emit deprecation warnings for
non-deprecated properties
  [#16400](#16400)

- [sdk/python] Handle extra CLI arguments passed policy packs plugins
  [#16402](#16402)

- [sdk/python] Add VIRTUAL_ENV environment variable when running inside
a virtual environment
  [#16425](#16425)

- [sdk/python] Don't lift dunder attributes on `Output`s


### Miscellaneous

- [sdk/{go,nodejs,python}] Add register resource transform alias for
register stack transform

- [cli/new] Instruct the user to use 'pulumi install' when using
--generate-only
  [#16411](#16411)
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v3.121.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/test Test CI pipelines on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request additional prompts from language host during pulumi new
5 participants