Commit Graph

1014 Commits

Author SHA1 Message Date
Will Jones a0cea65e70
Add conformance tests for remote assets ()
Conformance tests allow us to test functionality regardless of
programming language used, by setting up a test program using PCL and
making assertions about program state before and after various
operations. This commit adds a set of conformance tests for remote
assets (that is, assets that must be retrieved from some URI), which
have until now been untested in this regard.
2024-07-03 09:03:24 +00:00
Pulumi Bot ddbbbd7ac1
Changelog and go.mod updates for v3.122.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 07:54:27 +00:00
Justin Van Patten 730a072a50
Freeze v3.122.0 ()
Tentative changelog:

### Features

- [cli] Set the --continue-on-error flag with PULUMI_CONTINUE_ON_ERROR
environment variable
  [](https://github.com/pulumi/pulumi/pull/16442)

- [sdk/nodejs] Parallelize Construct and Call calls in the Node.js SDK
  [](https://github.com/pulumi/pulumi/pull/16428)

- [sdk/python] Support `--exclude-protected` for `destroy` in the Python
automation SDK
  [](https://github.com/pulumi/pulumi/pull/16457)


### Bug Fixes

- [auto] Protect access to transport.UnsupportedCapabilities inside
repo.FetchContext
  [](https://github.com/pulumi/pulumi/pull/16517)

- [cli] Disable default Cobra completions in the CLI

- [engine] Fix an issue with asset archives not working with paths
outside the working directory.
  [](https://github.com/pulumi/pulumi/pull/16455)

- [engine] Don't re-delete resources that are marked as
`pendingReplacement`
  [](https://github.com/pulumi/pulumi/pull/16510)

- [cli/display] Print a fully qualified stack name on `pulumi stack
--show-name --fully-qualify-stack-names`
  [](https://github.com/pulumi/pulumi/pull/16453)

- [cli/display] Display `[retain]` in all cases of delete retention
  [](https://github.com/pulumi/pulumi/pull/16506)

- [sdkgen/dotnet] Bump the default version range for the referenced
Pulumi package to a version that supports Config.GetDouble
  [](https://github.com/pulumi/pulumi/pull/16483)

- [cli/new] Add not-found markers to missing executables for
packagemanagers
  [](https://github.com/pulumi/pulumi/pull/16488)

- [sdk/go] Fix concurrent map write when registering transform callbacks
  [](https://github.com/pulumi/pulumi/pull/16444)

- [sdk/nodejs] Fix race condition when registering stack transforms
  [](https://github.com/pulumi/pulumi/pull/16443)

- [sdk/nodejs] Fix Construct and Call calls in the Node.js SDK sharing
state
  [](https://github.com/pulumi/pulumi/pull/16487)

- [sdk/nodejs] Fix non-blocking stdout/err with nodejs
  [](https://github.com/pulumi/pulumi/pull/16504)

- [sdk/{nodejs,python}] Display an actionable error message when
dependency installation fails
  [](https://github.com/pulumi/pulumi/pull/16489)

- [sdk/python] Wait for pending tasks before shutting down python
programs.
  [](https://github.com/pulumi/pulumi/pull/16505)

- [sdk/python] Provide installation instructions for the python
typechecker


### Miscellaneous

- [sdk/nodejs] Migrate from Rome to Biome
  [](https://github.com/pulumi/pulumi/pull/16456)
2024-07-02 00:20:23 +00:00
Julien P 531036ac07
Provide installation instructions for the python typechecker ()
When the typechecker option is set, but the selected typechecker is not
installed in the project's virtual environment, the pulumi operation
will fail with an unhelpful message like `mypy failed: exit status 1`.

To make this more actionable, we check if the typechecker is installed,
and if not, we provide installation instructions to remediate the issue.
2024-07-01 15:17:03 +00:00
Justin Van Patten bbadaae257
Prepare for v3.122.0 release ()
Aiming to release early next week.
2024-06-29 11:09:49 +00:00
Fraser Waters 969e0b9735
Conformance test for provider pre-release versions ()
Noticed this issue while doing SDK gen for parameterised providers, but
figured it deserved its own conformance test. Check that if a provider
has a pre-release semver that the _exact_ version can be reported by the
generated SDK. This already just works for NodeJS, but Python needed a
fix to write the version to `_utilities.py` rather than trying to
unconvert the pypi version from the package.

Also needed to make the conformance test checks for
`GetProgramDependencies` even weaker (which is fine, they are just a
very basic sanity check) because the provider reports a version of
"3.0.0-alpha.1.internal" while the python version is "3.0.0a1+internal".
2024-06-29 10:07:14 +00:00
Julien P 1b0b98cfe1
Display an actionable error message when dependency installation fails ()
When the dependency installation fails because we could not find the
packagemanager executable, tell the user how to remedy the error and
finish the dependency installation.

Example:
```
The packagemangager to use for installing dependencies pnpm
Installing dependencies...

error: installing dependencies failed: Could not find `pnpm` executable.
Install pnpm from https://pnpm.io/installation and make sure it is in your PATH.
Run `pulumi install` to complete the installation.
```
2024-06-28 23:22:17 +00:00
Julien P 68d2236bf5
Add not-found markers to missing executables for packagemanagers ()
During the creation of new python and nodejs projects, flag package
manages that can't be found with a `[not found]` suffix. This allows the
user to see all possible options, but also understand why the
installation will fail (Anoter PR will improve the error message for a
failed installation when the executable could not be found).

<img width="443" alt="Screenshot 2024-06-26 at 13 35 13"
src="https://github.com/pulumi/pulumi/assets/387068/f659277d-1963-4e4e-861d-29166eabb190">

<img width="619" alt="Screenshot 2024-06-26 at 13 43 52"
src="https://github.com/pulumi/pulumi/assets/387068/a423c187-9353-4370-82b5-35cab8db91b1">
2024-06-28 23:21:55 +00:00
Will Jones 7309918554
Support `--exclude-protected` for `destroy` in the Python automation SDK ()
This commit rebases @Maradonna90's PR  to add support for
`destroy`'s `--exclude-protected` argument to the Python automation SDK.
This addresses the Python part of .

Closes 

Co-authored-by: Jendryczko, Marco <marco.jendryczko@hermesworld.com>
2024-06-28 23:21:49 +00:00
Fraser Waters 1fe7d7a871
Make sure the aio executor shutsdown before the event loop ()
Fixes https://github.com/pulumi/pulumi/issues/16025.

Looks like shutting down the executor and waiting for it to finish
pending tasks should stop callbacks being triggered after we then close
the event loop.
2024-06-28 23:20:32 +00:00
dependabot[bot] dd7e21c9de
Bump the go_modules group across 2 directories with 1 update ()
Bumps the go_modules group with 1 update in the /pkg directory:
[github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp).
Bumps the go_modules group with 1 update in the /tests directory:
[github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp).

Updates `github.com/hashicorp/go-retryablehttp` from 0.7.5 to 0.7.7
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md">github.com/hashicorp/go-retryablehttp's
changelog</a>.</em></p>
<blockquote>
<h2>0.7.7 (May 30, 2024)</h2>
<p>BUG FIXES:</p>
<ul>
<li>client: avoid potentially leaking URL-embedded basic authentication
credentials in logs (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/158">#158</a>)</li>
</ul>
<h2>0.7.6 (May 9, 2024)</h2>
<p>ENHANCEMENTS:</p>
<ul>
<li>client: support a <code>RetryPrepare</code> function for modifying
the request before retrying (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/216">#216</a>)</li>
<li>client: support HTTP-date values for <code>Retry-After</code> header
value (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/138">#138</a>)</li>
<li>client: avoid reading entire body when the body is a
<code>*bytes.Reader</code> (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/197">#197</a>)</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>client: fix a broken check for invalid server certificate in go
1.20+ (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/210">#210</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1542b31176"><code>1542b31</code></a>
v0.7.7</li>
<li><a
href="defb9f441d"><code>defb9f4</code></a>
v0.7.7</li>
<li><a
href="a99f07beb3"><code>a99f07b</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/158">#158</a>
from dany74q/danny/redacted-url-in-logs</li>
<li><a
href="8a28c574da"><code>8a28c57</code></a>
Merge branch 'main' into danny/redacted-url-in-logs</li>
<li><a
href="86e852df43"><code>86e852d</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/227">#227</a>
from hashicorp/dependabot/github_actions/actions/chec...</li>
<li><a
href="47fe99e646"><code>47fe99e</code></a>
Bump actions/checkout from 4.1.5 to 4.1.6</li>
<li><a
href="490fc06be0"><code>490fc06</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/226">#226</a>
from testwill/ioutil</li>
<li><a
href="f3e9417dbf"><code>f3e9417</code></a>
chore: remove refs to deprecated io/ioutil</li>
<li><a
href="d969eaa9c9"><code>d969eaa</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/225">#225</a>
from hashicorp/manicminer-patch-2</li>
<li><a
href="2ad8ed4a1d"><code>2ad8ed4</code></a>
v0.7.6</li>
<li>Additional commits viewable in <a
href="https://github.com/hashicorp/go-retryablehttp/compare/v0.7.5...v0.7.7">compare
view</a></li>
</ul>
</details>
<br />

Updates `github.com/hashicorp/go-retryablehttp` from 0.7.5 to 0.7.7
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md">github.com/hashicorp/go-retryablehttp's
changelog</a>.</em></p>
<blockquote>
<h2>0.7.7 (May 30, 2024)</h2>
<p>BUG FIXES:</p>
<ul>
<li>client: avoid potentially leaking URL-embedded basic authentication
credentials in logs (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/158">#158</a>)</li>
</ul>
<h2>0.7.6 (May 9, 2024)</h2>
<p>ENHANCEMENTS:</p>
<ul>
<li>client: support a <code>RetryPrepare</code> function for modifying
the request before retrying (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/216">#216</a>)</li>
<li>client: support HTTP-date values for <code>Retry-After</code> header
value (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/138">#138</a>)</li>
<li>client: avoid reading entire body when the body is a
<code>*bytes.Reader</code> (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/197">#197</a>)</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>client: fix a broken check for invalid server certificate in go
1.20+ (<a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/210">#210</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1542b31176"><code>1542b31</code></a>
v0.7.7</li>
<li><a
href="defb9f441d"><code>defb9f4</code></a>
v0.7.7</li>
<li><a
href="a99f07beb3"><code>a99f07b</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/158">#158</a>
from dany74q/danny/redacted-url-in-logs</li>
<li><a
href="8a28c574da"><code>8a28c57</code></a>
Merge branch 'main' into danny/redacted-url-in-logs</li>
<li><a
href="86e852df43"><code>86e852d</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/227">#227</a>
from hashicorp/dependabot/github_actions/actions/chec...</li>
<li><a
href="47fe99e646"><code>47fe99e</code></a>
Bump actions/checkout from 4.1.5 to 4.1.6</li>
<li><a
href="490fc06be0"><code>490fc06</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/226">#226</a>
from testwill/ioutil</li>
<li><a
href="f3e9417dbf"><code>f3e9417</code></a>
chore: remove refs to deprecated io/ioutil</li>
<li><a
href="d969eaa9c9"><code>d969eaa</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/go-retryablehttp/issues/225">#225</a>
from hashicorp/manicminer-patch-2</li>
<li><a
href="2ad8ed4a1d"><code>2ad8ed4</code></a>
v0.7.6</li>
<li>Additional commits viewable in <a
href="https://github.com/hashicorp/go-retryablehttp/compare/v0.7.5...v0.7.7">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/pulumi/pulumi/network/alerts).

</details>

Co-authored-by: Will Jones <will@sacharissa.co.uk>
2024-06-28 22:17:40 +00:00
Fraser Waters 4a12902bde
Keep package refs separate from providers ()
A few weeks ago we added the concept of package references, mostly for
parametrised providers so that we wouldn't have to send the parameter
value over and over for each `RegisterResourceRequest`. This was done by
sending the package reference through the `provider` field.

Nothing yet uses this feature (it hasn't yet been added to any language
SDKs), and thinking over this the last week I realised there was an
issue using this for extension packages.

When using an extension provider it's valid to also specify an explicit
provider, which will be using the `provider` field. At this point
there's no where for the SDK to send extra information to the engine
about the parameterisation.

This is a small reworking of this idea to use a separate `package`
field, so that even for an extension type we can specify the
parameterised package it comes from and an explicit provider for it.
2024-06-24 14:59:18 +00:00
Fraser Waters bf806f5834
Add asset archive test to conformance tests ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

Fixes https://github.com/pulumi/pulumi/issues/16092.

Hopefully the really last part of the fixes started by
https://github.com/pulumi/pulumi/pull/16100 and
https://github.com/pulumi/pulumi/pull/16119. This fixes the working
directory handling for asset archives.
2024-06-24 14:23:18 +00:00
Daniel Bradley c6a01328d2
Set range in python codegen default SDK version ()
If the schema doesn't set any specific dependencies, we should be
defaulting to requiring pulumi within the current major version rather
than completely unconstrained.

Discussion:
https://github.com/pulumi/pulumi-kafka/pull/410/files#r1594324390
2024-06-24 13:57:57 +00:00
Pulumi Bot 0cd3a460c3
Changelog and go.mod updates for v3.121.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-06-22 03:02:16 +00:00
Justin Van Patten 12ee8f259d
Freeze v3.121.0 ()
Waiting on https://github.com/pulumi/pulumi/pull/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
  [](https://github.com/pulumi/pulumi/pull/16409)

- [sdk/go] Suggest valid attributes with similar names to unrecognised
ones when validating project definitions
  [](https://github.com/pulumi/pulumi/pull/16097)

- [cli/new] Allow passing runtime options as args in pulumi new
  [](https://github.com/pulumi/pulumi/pull/16346)

- [cli/new] Query language runtime for options during “pulumi new”
  [](https://github.com/pulumi/pulumi/pull/16346)

- [cli/new] Add packagemanager prompt to pulumi new for nodejs
  [](https://github.com/pulumi/pulumi/pull/16417)

- [sdk/nodejs] Detect pnpm workspaces when running pulumi install
  [](https://github.com/pulumi/pulumi/pull/15525)

- [sdk/nodejs] Add options to Workspace::removeStack()
  [](https://github.com/pulumi/pulumi/pull/16333)

- [sdk/python] Automatically convert requirements.txt to pyproject.toml
when using Poetry
  [](https://github.com/pulumi/pulumi/pull/16346)

- [sdkgen/python] Generate TypedDict types for inputs
  [](https://github.com/pulumi/pulumi/pull/15957)


### Bug Fixes

- [engine] Fix a panic when ignoring wildcard values with arrays of
different length
  [](https://github.com/pulumi/pulumi/pull/16406)

- [cli/engine] Fix --continue-on-error running indefinitely when a
resource fails to be created or updated
  [](https://github.com/pulumi/pulumi/pull/16371)

- [sdk/nodejs] Avoid an unhandled error when `dependencies` is missing
from `package.json` during closure serialization
  [](https://github.com/pulumi/pulumi/pull/16433)

- [cli/plugin] Fix plugin install command when plugin type is tool
  [](https://github.com/pulumi/pulumi/pull/16407)

- [sdk/python] Fix Python SDK docs by escaping the trailing underscore
in a docstring
  [](https://github.com/pulumi/pulumi/pull/14866)

- [sdk/python] Don't incorrectly emit deprecation warnings for
non-deprecated properties
  [](https://github.com/pulumi/pulumi/pull/16400)

- [sdk/python] Handle extra CLI arguments passed policy packs plugins
  [](https://github.com/pulumi/pulumi/pull/16402)

- [sdk/python] Add VIRTUAL_ENV environment variable when running inside
a virtual environment
  [](https://github.com/pulumi/pulumi/pull/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
  [](https://github.com/pulumi/pulumi/pull/16411)
2024-06-22 01:03:59 +00:00
Will Jones 79e814fe0f
Don't lift dunder attributes on Python `Output`s ()
`Output`s are a central part of Pulumi programs. As well as tracking
dependencies between resources (e.g. that `A`'s input `x` comes from
`B`'s output `y`), they allow us to specify that some value will only be
available at a future point (e.g. after a resource has been created or
updated). This is typically done in each language by implementing
`Output`s using some asynchronous or future value, such as NodeJS's
`Promise`. In Python, we use `asyncio` `Task`s.

In order to make `Output`s ergonomic to use, we implement "lifting" of
properties in languages that support it. Suppose for instance we have an
object `c` that is an instance of the following class `C`:

```python
class C:
    x: str
    y: int

    def __init__(self, x: str, y: int) -> None:
        self.x = x
        self.y = y

c = C("x", 42)
```

Because `c: C`, we have that `c.x == "x"` and `c.y == 42` as we might
expect. Consider though some output property of a resource that produces
a `C`. This property will be of type `Output[C]`, since the value of
type `C` won't be available until the resource has been set up by Pulumi
as part of program execution. If we want to pass that output's `x` value
to some other resource, we might have to write:

```python
r1 = ... # r1 has a property c: Output[C]

r2 = R("r", RArgs(x=r1.c.apply(lambda cc: cc.x)))
```

Observe that we have to use `apply` to unwrap the output and access the
property inside. This is tedious and ugly, and exactly the problem
lifting solves. Lifting allows us to write `r1.c.x` and have it be
implemented as `r1.c.apply(lambda cc: cc.x)` under the hood. In Python,
this is achieved using Python's `__getattr__` "dunder" method ("dunder"
being short for "double underscore", the convention adopted for
"special" identifiers in Python). `__getattr__` allows us to perform
dynamic property lookup on an object, which in the case of `Output` we
use to delegate property access to the underlying value using `apply`.

This works really well and contributes significantly to Pulumi programs
being easy to read and write in Python. Unfortunately, it has a flaw:
`__getattr__` is also used to check whether attributes exist on an
object (using `hasattr`), and thus has a contract whereby it is
_synchronously_ expected to raise an `AttributeError` if an attribute
does not exist. In returning an _asynchronous_ task (that may _later_
resolve to an `AttributeError`), `Output` is in violation of this
contract. This means that code which calls e.g. `hasattr(r1.c, "z")`
will yield a future task that if resolved, will blow up with an
`AttributeError`.

Historically, this hasn't really been a problem. With the advent of
https://github.com/pulumi/pulumi/pull/15744 and subsequent
improvements/fixes, however, this is now an issue, since we explicitly
await all outstanding outputs before program termination. In the example
above, for instance, the orphaned task will be forced at the end of
program execution. The `AttributeError` will rear its head and Pulumi
will exit with an error and stack trace.

This commit implements a fix proportional to the cases where this
appears to be a problem. Namely, libraries such as Pydantic that use
dunder attributes in their implementation and check for the presence of
these attributes when executing. When `__getattr__` is called with a
dunder attribute, we synchronously `raise AttributeError` rather than
lifting it. There are (we believe) no cases where this would affect a
Pulumi-generated SDK (since dunder names aren't generally used for
public resource properties) and the dunder properties on the `Output`
itself (e.g. `__dict__`, etc.) will continue to work since their
resolution will succeed normally and a call to `__getattr__` will thus
not be made.

Fixes 
2024-06-22 00:04:34 +00:00
Justin Van Patten 006a95f867
Prepare for v3.121.0 release ()
Tentative changelog:

### Features

- [sdk/go] Suggest valid attributes with similar names to unrecognised
ones when validating project definitions
  [](https://github.com/pulumi/pulumi/pull/16097)

- [cli/new] Allow passing runtime options as args in pulumi new
  [](https://github.com/pulumi/pulumi/pull/16346)

- [cli/new] Query language runtime for options during “pulumi new”
  [](https://github.com/pulumi/pulumi/pull/16346)

- [sdk/nodejs] Detect pnpm workspaces when running pulumi install
  [](https://github.com/pulumi/pulumi/pull/15525)

- [sdk/nodejs] Add options to Workspace::removeStack()
  [](https://github.com/pulumi/pulumi/pull/16333)

- [sdk/python] Automatically convert requirements.txt to pyproject.toml
when using Poetry
  [](https://github.com/pulumi/pulumi/pull/16346)

- [sdkgen/python] Generate TypedDict types for inputs
  [](https://github.com/pulumi/pulumi/pull/15957)


### Bug Fixes

- [engine] Fix a panic when ignoring wildcard values with arrays of
different length
  [](https://github.com/pulumi/pulumi/pull/16406)

- [cli/engine] Fix --continue-on-error running indefinitely when a
resource fails to be created or updated
  [](https://github.com/pulumi/pulumi/pull/16371)

- [cli/plugin] Fix plugin install command when plugin type is tool
  [](https://github.com/pulumi/pulumi/pull/16407)

- [sdk/python] Don't incorrectly emit deprecation warnings for
non-deprecated properties
  [](https://github.com/pulumi/pulumi/pull/16400)

- [sdk/python] Handle extra CLI arguments passed policy packs plugins
  [](https://github.com/pulumi/pulumi/pull/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
2024-06-21 14:47:57 +00:00
Thomas Gummerer 6a48d609d8
add RegisterResourceTransform as alias for RegisterStackTransform ()
In subsequent PRs we're going to introduce transforms for Calls, Invokes
and Reads. Add an alias to the current register stack transforms
functions, and deprecate the old version. This is both for consistency,
and because it's a bit confusing that register stack transforms only
works for register resource calls, and not other types of pulumi
operations.

/xref https://github.com/pulumi/pulumi/issues/16171
2024-06-21 13:48:56 +00:00
Will Jones 271553d462
Generate `@deprecated` decorators in Python SDKs ()
The latest version of the core Pulumi SDK contains a decorator,
`@deprecated`, that is used when generating SDK code in order to signify
deprecated properties in a way that can be recognised by other SDK code.
This is useful when writing generic Python code that e.g. traverses
class properties without triggering deprecation warnings for those not
explicitly mentioned in user code. The [original pull
request](https://github.com/pulumi/pulumi/pull/16400) has more details.

Alas, we can't rely on the fact that a user will upgrade _both_ a
particular (generated) provider SDK and the core Pulumi SDK at the same
time. Thus, it's entirely possible that a user bumps their version of
(say) `pulumi_aws`, whilst leaving their `pulumi` library at the same
(compatible, according to specified bounds) version. In doing so they'd
hit errors when the new SDK tried to import the `@deprecated` decorator,
which doesn't exist in the old core SDK.

This commit thus fixes this by altering code generation so that each SDK
receives its own inlined copy of the `@deprecated` decorator, which it
can reference regardless of the version of the core SDK. This decorator
applies the same `_pulumi_deprecated_callable` tag to functions it
decorates, which a sufficiently modern SDK will recognise to avoid
triggering e.g. https://github.com/pulumi/pulumi/issues/15894. Later on,
we can hopefully find a way to avoid doing this and use only a version
of `@deprecated` specified in the core SDK.

Codegen tests have been updated and the inlined decorator has manually
been tested using the AWS Classic SDK.

Addresses
https://github.com/pulumi/pulumi/pull/16400#discussion_r1646562455
2024-06-21 11:34:29 +00:00
Justin Van Patten 17d252dc30
[sdk/python] Escape trailing underscore in docstring ()
The trailing underscore in this docstring [needs to be
escaped](https://github.com/sphinx-doc/sphinx/issues/519) for it to
render properly with Sphinx.


[Currently](https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.ResourceOptions),
it's rendered as `import` without the trailing underscore:

<img width="560" alt="Screen Shot 2023-12-17 at 6 47 43 PM"
src="https://github.com/pulumi/pulumi/assets/710598/3c520aef-5677-4ae5-bc37-a1d0607a94e8">

It should be rendered as `import_`:

<img width="555" alt="Screen Shot 2023-12-17 at 6 48 13 PM"
src="https://github.com/pulumi/pulumi/assets/710598/f9cd0ed1-6dd3-49b7-9de9-4b9ff8ae7864">

This change should fix that.

This is a follow-up from
https://github.com/pulumi/pulumi-hugo/issues/434
2024-06-21 02:47:25 +00:00
Julien P a1880cbddc
Add VIRTUAL_ENV to env var when running in a venv ()
Activating a virtual environment sets a VIRTUAL_ENV environment
variable. Replicate this behaviour in `ActivateVirtualEnv` function.

https://docs.python.org/3/library/venv.html#how-venvs-work
> When a virtual environment has been activated, the VIRTUAL_ENV
environment variable is set to the path of the environment
2024-06-20 10:26:49 +00:00
Mikhail Shilkov 2f3f9f20e8
Vendor the inflector library ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

The gedex/inflector (singularization/pluralization) library has been
seemingly abandoned: still no go module support, no changes in years,
etc. It was decided that we want to fork it and maintain ourselves to
ensure both a) stability and backwards compatibility b) modernization
and quality.

This PR switches the inflector library. The next step will be TF bridge.

There are no functional changes in behavior - the library code is
exactly the same.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-06-20 09:04:33 +00:00
dependabot[bot] f3994ee023
Bump the go_modules group across 2 directories with 1 update ()
Bumps the go_modules group with 1 update in the /pkg directory:
[github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go).
Bumps the go_modules group with 1 update in the /tests directory:
[github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go).

Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.5.1 to
1.6.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-sdk-for-go/releases">github.com/Azure/azure-sdk-for-go/sdk/azidentity's
releases</a>.</em></p>
<blockquote>
<h2>sdk/internal/v1.6.0</h2>
<h2>1.6.0 (2024-04-16)</h2>
<h3>Features Added</h3>
<ul>
<li>Options types for <code>SetBodilessMatcher</code> and
<code>SetDefaultMatcher</code> now embed
<code>RecordingOptions</code></li>
<li>Added a collection of default sanitizers for test recordings</li>
</ul>
<h2>sdk/azidentity/v1.6.0</h2>
<h2>1.6.0 (2024-06-10)</h2>
<h3>Features Added</h3>
<ul>
<li><code>NewOnBehalfOfCredentialWithClientAssertions</code> creates an
on-behalf-of credential
that authenticates with client assertions such as federated
credentials</li>
</ul>
<h3>Breaking Changes</h3>
<blockquote>
<p>These changes affect only code written against a beta version such as
v1.6.0-beta.4</p>
</blockquote>
<ul>
<li>Removed <code>AzurePipelinesCredential</code> and the persistent
token caching API.
They will return in v1.7.0-beta.1</li>
</ul>
<h3>Bugs Fixed</h3>
<ul>
<li>Managed identity bug fixes</li>
</ul>
<h2>sdk/azidentity/v1.6.0-beta.4</h2>
<h2>1.6.0-beta.4 (2024-05-14)</h2>
<h3>Features Added</h3>
<ul>
<li><code>AzurePipelinesCredential</code> authenticates an Azure
Pipeline service connection with
workload identity federation</li>
</ul>
<h2>sdk/azidentity/v1.6.0-beta.3</h2>
<h2>1.6.0-beta.3 (2024-04-09)</h2>
<h3>Breaking Changes</h3>
<ul>
<li><code>DefaultAzureCredential</code> now sends a probe request with
no retries for IMDS managed identity
environments to avoid excessive retry delays when the IMDS endpoint is
not available. This
should improve credential chain resolution for local development
scenarios.</li>
</ul>
<h3>Bugs Fixed</h3>
<ul>
<li><code>ManagedIdentityCredential</code> now specifies resource IDs
correctly for Azure Container Instances</li>
</ul>
<h2>sdk/azidentity/v1.5.2</h2>
<h2>1.5.2 (2024-04-09)</h2>
<h3>Bugs Fixed</h3>
<ul>
<li><code>ManagedIdentityCredential</code> now specifies resource IDs
correctly for Azure Container Instances</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>Restored v1.4.0 error behavior for empty tenant IDs</li>
<li>Upgraded dependencies</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="36f766d2fe"><code>36f766d</code></a>
add sdk/resourcemanager/cosmos/armcosmos live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20705">#20705</a>)</li>
<li><a
href="c005ed6159"><code>c005ed6</code></a>
sdk/resourcemanager/network/armnetwork live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20331">#20331</a>)</li>
<li><a
href="5fa7df4852"><code>5fa7df4</code></a>
add sdk/resourcemanager/compute/armcompute live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20048">#20048</a>)</li>
<li><a
href="0d22aeddaa"><code>0d22aed</code></a>
add sdk/resourcemanager/eventhub/armeventhub live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20686">#20686</a>)</li>
<li><a
href="2a8d96d355"><code>2a8d96d</code></a>
add sdk/resourcemanager/postgresql/armpostgresql live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20685">#20685</a>)</li>
<li><a
href="b2cddab175"><code>b2cddab</code></a>
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20437">#20437</a>)</li>
<li><a
href="ed7f3c719e"><code>ed7f3c7</code></a>
Fix azidentity troubleshooting guide link (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20736">#20736</a>)</li>
<li><a
href="6dfd0cbd7c"><code>6dfd0cb</code></a>
[azeventhubs] Fixing checkpoint store race condition (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20727">#20727</a>)</li>
<li><a
href="745d967e27"><code>745d967</code></a>
pass along the artifact name so we can override it later (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20732">#20732</a>)</li>
<li><a
href="20b4dd8c3e"><code>20b4dd8</code></a>
Update changelog with latest features (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20730">#20730</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Azure/azure-sdk-for-go/compare/sdk/internal/v1.5.1...sdk/azcore/v1.6.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.5.1 to
1.6.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Azure/azure-sdk-for-go/releases">github.com/Azure/azure-sdk-for-go/sdk/azidentity's
releases</a>.</em></p>
<blockquote>
<h2>sdk/internal/v1.6.0</h2>
<h2>1.6.0 (2024-04-16)</h2>
<h3>Features Added</h3>
<ul>
<li>Options types for <code>SetBodilessMatcher</code> and
<code>SetDefaultMatcher</code> now embed
<code>RecordingOptions</code></li>
<li>Added a collection of default sanitizers for test recordings</li>
</ul>
<h2>sdk/azidentity/v1.6.0</h2>
<h2>1.6.0 (2024-06-10)</h2>
<h3>Features Added</h3>
<ul>
<li><code>NewOnBehalfOfCredentialWithClientAssertions</code> creates an
on-behalf-of credential
that authenticates with client assertions such as federated
credentials</li>
</ul>
<h3>Breaking Changes</h3>
<blockquote>
<p>These changes affect only code written against a beta version such as
v1.6.0-beta.4</p>
</blockquote>
<ul>
<li>Removed <code>AzurePipelinesCredential</code> and the persistent
token caching API.
They will return in v1.7.0-beta.1</li>
</ul>
<h3>Bugs Fixed</h3>
<ul>
<li>Managed identity bug fixes</li>
</ul>
<h2>sdk/azidentity/v1.6.0-beta.4</h2>
<h2>1.6.0-beta.4 (2024-05-14)</h2>
<h3>Features Added</h3>
<ul>
<li><code>AzurePipelinesCredential</code> authenticates an Azure
Pipeline service connection with
workload identity federation</li>
</ul>
<h2>sdk/azidentity/v1.6.0-beta.3</h2>
<h2>1.6.0-beta.3 (2024-04-09)</h2>
<h3>Breaking Changes</h3>
<ul>
<li><code>DefaultAzureCredential</code> now sends a probe request with
no retries for IMDS managed identity
environments to avoid excessive retry delays when the IMDS endpoint is
not available. This
should improve credential chain resolution for local development
scenarios.</li>
</ul>
<h3>Bugs Fixed</h3>
<ul>
<li><code>ManagedIdentityCredential</code> now specifies resource IDs
correctly for Azure Container Instances</li>
</ul>
<h2>sdk/azidentity/v1.5.2</h2>
<h2>1.5.2 (2024-04-09)</h2>
<h3>Bugs Fixed</h3>
<ul>
<li><code>ManagedIdentityCredential</code> now specifies resource IDs
correctly for Azure Container Instances</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>Restored v1.4.0 error behavior for empty tenant IDs</li>
<li>Upgraded dependencies</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="36f766d2fe"><code>36f766d</code></a>
add sdk/resourcemanager/cosmos/armcosmos live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20705">#20705</a>)</li>
<li><a
href="c005ed6159"><code>c005ed6</code></a>
sdk/resourcemanager/network/armnetwork live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20331">#20331</a>)</li>
<li><a
href="5fa7df4852"><code>5fa7df4</code></a>
add sdk/resourcemanager/compute/armcompute live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20048">#20048</a>)</li>
<li><a
href="0d22aeddaa"><code>0d22aed</code></a>
add sdk/resourcemanager/eventhub/armeventhub live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20686">#20686</a>)</li>
<li><a
href="2a8d96d355"><code>2a8d96d</code></a>
add sdk/resourcemanager/postgresql/armpostgresql live test (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20685">#20685</a>)</li>
<li><a
href="b2cddab175"><code>b2cddab</code></a>
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20437">#20437</a>)</li>
<li><a
href="ed7f3c719e"><code>ed7f3c7</code></a>
Fix azidentity troubleshooting guide link (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20736">#20736</a>)</li>
<li><a
href="6dfd0cbd7c"><code>6dfd0cb</code></a>
[azeventhubs] Fixing checkpoint store race condition (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20727">#20727</a>)</li>
<li><a
href="745d967e27"><code>745d967</code></a>
pass along the artifact name so we can override it later (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20732">#20732</a>)</li>
<li><a
href="20b4dd8c3e"><code>20b4dd8</code></a>
Update changelog with latest features (<a
href="https://redirect.github.com/Azure/azure-sdk-for-go/issues/20730">#20730</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Azure/azure-sdk-for-go/compare/sdk/internal/v1.5.1...sdk/azcore/v1.6.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/pulumi/pulumi/network/alerts).

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2024-06-19 18:18:35 +00:00
Julien P a59b694515
Query language runtime for options during “pulumi new” ()
# Description

Fixes https://github.com/pulumi/pulumi/issues/16309

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

<img width="900" alt="Screenshot 2024-06-07 at 14 28 58"
src="https://github.com/pulumi/pulumi/assets/387068/e68ef702-978b-47f7-9d4b-afdf10409ed8">

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"master","parentHead":"","trunk":"master"}
```
-->

---------

Co-authored-by: Will Jones <will@sacharissa.co.uk>
Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-06-17 17:10:55 +00:00
Will Jones e65c2aa368
Don't incorrectly emit deprecated warnings ()
Presently, the Python SDK incorrectly emits deprecation warnings for
properties even if user code does not reference them. This is due to
various pieces of code in the SDK that enumerate properties e.g. for the
purpose of serialisation/RPC calls. In enumerating properties, their
getters are invoked, triggering the deprecation warnings.

There isn't currently a way for us to detect which properties may or may
not be deprecated and handle them appropriately, so this commit
introduces one. Deprecation messages are moved into a new decorator,
`@pulumi.deprecated`. This decorator accepts a `Callable` and wraps it,
making two changes:

* Before the decorated `Callable`'s execution, deprecation messages are
printed.
* The returned `Callable` is tagged with a new reserved property,
`_pulumi_deprecated_callable`, which references the wrapped `Callable`
(that is, the original `Callable` whose invocation will _not_ produce
deprecation warnings).

With this in place, we subsequently make the following two changes:

* We modify the SDK enumeration code (specifically that in
`input_type_to_dict` to check for `_pulumi_deprecated_callable`
properties and use them where appropriate to invoke getters without
triggering deprecation warnings.
* We modify Python code generation so that instead of emitting
statements to print deprecation warnings, we simply emit applications of
the `@pulumi.deprecated` decorator instead.

This commit adds some Python unit tests to exercise the decorator and
manual testing has been performed using the AWS Classic SDK.

Fixes 
2024-06-17 16:04:55 +00:00
Julien P 91568bc03b
Handle extra CLI arguments passed policy packs plugins ()
The python policy plugin argument parsing was very brittle and would
fail when passed extra flags such as `--tracing <file>` or
`--logtostderr`. We now properly parse these standard plugin falgs (see
plugin#buildPluginArguments). Note that the flags are currently not
being used by the policy plugins.

Nodejs does not suffer from the same issue because we are already using
`minimist` to parse the arguments.

Fixes https://github.com/pulumi/pulumi/issues/11092
2024-06-17 09:10:04 +00:00
Mike Seese ec4086650c
Add removeStack options to NodeJS Auto API SDK ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

This PR adds an optional `opts` argument to the NodeJS SDK
`Workspace::removeStack` method, which has `force` and `preserveConfig`
optional booleans. Setting these bools to true will add their
corresponding CLI flag to the command.

Fixes  

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-06-14 08:35:06 +00:00
Will Jones 486a10e677
Regenerate test `package-lock.json` files ()
Many of our tests test JavaScript/TypeScript behaviour and thus rely on
`package.json` files specifying dependencies and `package-lock.json`
files pinning those dependencies. While the dependencies we use in our
tests are minimal and their bounds haven't changed (nor maybe have much
reason to change), the transitive dependency set is potentially large
and worth keeping up-to-date (e.g. for security reasons, or just keeping
Dependabot happy). This commit thus regenerates all the
`package-lock.json` files associated with tests that Dependabot has
previously recommended we bump.

* Closes 
* Closes 
* Closes  
* Closes  
* Closes  
* Closes  
* Closes  
* Closes 
* Closes  
* Closes 
* Closes  
* Closes 
* Closes  
* Closes  
* Closes 
2024-06-13 10:52:59 +00:00
Pulumi Bot 0fce8163d9
Changelog and go.mod updates for v3.120.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-06-13 09:48:57 +00:00
Thomas Gummerer befb2490fb
Freeze 3.120.0 ()
To be merged after https://github.com/pulumi/pulumi/pull/16146 lands.

Tentative changelog:

##  (2024-06-12)


### Features

- [components/dotnet] Upgrade dotnet to 3.64.0
  [](https://github.com/pulumi/pulumi/pull/16353)

- [cli/import] Add flag --json to pulumi import which would serialize
the import diffs, operations, and overall output as JSON
  [](https://github.com/pulumi/pulumi/pull/16342)

- [protobuf] Pass ProgramInfo to LanguageRuntime.About
  [](https://github.com/pulumi/pulumi/pull/16311)

- [sdk/python] Support Poetry as Python toolchain
  [](https://github.com/pulumi/pulumi/pull/16315)

- [sdk/python] Autoinstall dependencies using Poetry in
GetRequiredPlugins
  [](https://github.com/pulumi/pulumi/pull/16315)


### Bug Fixes

- [cli/{config,new}] Fix non-interactive flag for 'new' and 'config env'
commands"
  [](https://github.com/pulumi/pulumi/pull/16338)

- [programgen/go] Fix union type resolution in Go program generation
  [](https://github.com/pulumi/pulumi/pull/16297)

- [sdk/nodejs] Only look for main in package.json if no entyrpoint was
set via Pulumi.yaml
  [](https://github.com/pulumi/pulumi/pull/16363)


### Miscellaneous

- [pkg] Refactor plugin.Provider to a `Method(context.Context,
MethodRequest) (MethodResponse, error)` style interface.
  [](https://github.com/pulumi/pulumi/pull/16302)

- [programgen/nodejs] Sort dependencies in GenerateProject
  [](https://github.com/pulumi/pulumi/pull/16341)
2024-06-13 08:06:09 +00:00
Thomas Gummerer f553db0177
wait for RPCs to finish before registering stack transforms ()
For transforms, we want to make sure all resources are registered before
registering them, and that no resource registration happens while the
transform is being registered in the engine.

The latter is already given, since `register_stack_transform` happens
synchronously, so no new RegisterResource calls can be started while the
transforms are registered.

For the former, we can make use of the event loop. Since all of the rpc
calls are being put on the event loop, we can make sure to wait for them
to finish before re start registering the transforms. Note that we can't
just wait for all tasks to finish because there might be more than RPCs
in flight. However when the RPCs finished we can be certain that the
resources are registered in the engine, and registering the stack
transforms is now a valid operation.
2024-06-12 15:59:21 +00:00
Thomas Gummerer 29f783d956
Prepare for pulumi 3.120.0 release ()
It's Wednesday! :shipit: 

Tentative changelog:

##  (2024-06-12)


### Features

- [cli/import] Add flag --json to pulumi import which would serialize
the import diffs, operations, and overall output as JSON
  [](https://github.com/pulumi/pulumi/pull/16342)

- [protobuf] Pass ProgramInfo to LanguageRuntime.About
  [](https://github.com/pulumi/pulumi/pull/16311)

- [sdk/python] Support Poetry as Python toolchain
  [](https://github.com/pulumi/pulumi/pull/16315)

- [sdk/python] Autoinstall dependencies using Poetry in
GetRequiredPlugins
  [](https://github.com/pulumi/pulumi/pull/16315)


### Bug Fixes

- [cli/{config,new}] Fix non-interactive flag for 'new' and 'config env'
commands"
  [](https://github.com/pulumi/pulumi/pull/16338)

- [programgen/go] Fix union type resolution in Go program generation
  [](https://github.com/pulumi/pulumi/pull/16297)


### Miscellaneous

- [pkg] Refactor plugin.Provider to a `Method(context.Context,
MethodRequest) (MethodResponse, error)` style interface.
  [](https://github.com/pulumi/pulumi/pull/16302)

- [programgen/nodejs] Sort dependencies in GenerateProject
  [](https://github.com/pulumi/pulumi/pull/16341)
2024-06-12 09:09:43 +00:00
Fraser Waters ee6ec150d8
Add explict provider test to conformance tests ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

Adds a conformance test for an explicit provider resource.
2024-06-11 14:56:08 +00:00
Fraser Waters 5a83cfe6e4
Initial work for parameterized providers ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

This is the first part of paramaterized providers in the engine. This
only supports "replacement" packages, that is where we fully replace a
providers package with a new package (think how dynamic tfbridge will
work, vs how crd2pulumi will work).

I've made the decision to _not_ support using parameterised providers by
sending the parameter in the RegisterResource request. This will
necessitate some different work in how we send the parameter for
explicit providers compared to version and pluginDownloadURL, but I
think it's worth it going forward.

No changelog as this is still basically unusable without codegen support
done, and should still be considered primarily for internal experimental
use for now.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-06-10 17:28:47 +00:00
Julien P 6cee283a42
Support Poetry as Python toolchain ()
# Description

Implement `Toolchain` interface for Poetry.

This does not yet allow the user to select the toolchain during `pulumi
new`, but can be used with a template that has explicit poetry support
https://github.com/pulumi/templates/pull/795/files

```
pulumi new https://github.com/pulumi/templates/tree/julienp/poetry-template/aws-python-poetry 
```
Stacked on top of https://github.com/pulumi/pulumi/pull/16311

Fixes https://github.com/pulumi/pulumi/issues/16314
Ref https://github.com/pulumi/pulumi/issues/15937

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`
2024-06-06 14:16:24 +00:00
Julien P 8476c3f7f5
Pass ProgramInfo through to LanguageRuntime.About ()
# Description

To correctly determine which python executable we are using, we need the
ProgramInfo so we can determine which virtual environment is in use.

This PR updates the `About` rpc call to take `ProgramInfo` as argument.

Fixes https://github.com/pulumi/pulumi/issues/16299
Ref https://github.com/pulumi/pulumi/issues/15937

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`
2024-06-06 08:21:46 +00:00
Pulumi Bot 7c0489fafc
Changelog and go.mod updates for v3.119.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-06-05 16:33:59 +00:00
Justin Van Patten d2435e2992
Freeze v3.119.0 ()
To be merged after https://github.com/pulumi/pulumi/pull/16322 and
https://github.com/pulumi/pulumi/pull/16323

Tentative changelog:

### Features

- [auto/{go,nodejs,python}] Add support for `--all` parameter of the
`stack ls` command to the Automation API
  [](https://github.com/pulumi/pulumi/pull/16266)


### Bug Fixes

- [cli/new] Populate pulumi:template tag also for interactively selected
templates
  [](https://github.com/pulumi/pulumi/pull/16308)

- [backend/service] Improve error reporting when policy pack download
fails
  [](https://github.com/pulumi/pulumi/pull/16306)


### Miscellaneous

- [sdk/python] Move dependency installation and python command
invocation to Toolchain interface
  [](https://github.com/pulumi/pulumi/pull/16243)
2024-06-05 12:59:52 +00:00
Justin Van Patten f598962268
Prepare for v3.119.0 release ()
Planning to include https://github.com/pulumi/pulumi/pull/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
  [](https://github.com/pulumi/pulumi/pull/16266)


### Bug Fixes

- [cli/new] Populate pulumi:template tag also for interactively selected
templates
  [](https://github.com/pulumi/pulumi/pull/16308)

- [backend/service] Improve error reporting when policy pack download
fails
  [](https://github.com/pulumi/pulumi/pull/16306)


### Miscellaneous

- [sdk/python] Move dependency installation and python command
invocation to Toolchain interface
  [](https://github.com/pulumi/pulumi/pull/16243)
2024-06-05 11:54:52 +00:00
Pat Gavlin c376f9c728
[chore] Update esc to v0.9.1 ()
Bring in the latest additions to the CLI.
2024-06-05 06:22:01 +00:00
Zach Buchheit 0ebfde2629
Add support for `--all` parameter of the `stack ls` command to the Automation API ()
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

Adds Go/Nodejs/Python automation API support for pulumi stack ls --all.

Fixes: [](https://github.com/pulumi/pulumi/issues/14226)

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->

---------

Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-06-03 15:53:43 +00:00
Julien P 578e0937a9
[Python] Move existing dependency installation and python command invocation to a Toolchain interface ()
# Description

This PR refactors the existing Python dependency installation and
command running code to use the `Toolchain` interface. This will make it
possible to swap out the default Pip based toolchain for a Poetry based
toolchain.

Fixes https://github.com/pulumi/pulumi/issues/16285
Ref https://github.com/pulumi/pulumi/issues/15937

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`
2024-06-03 13:52:27 +00:00
Pulumi Bot 5e4f7dc076
Changelog and go.mod updates for v3.118.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-05-31 18:49:15 +00:00
Justin Van Patten 1aee7c20af
Freeze v3.118.0 ()
Planning to include https://github.com/pulumi/pulumi/pull/16293

Otherwise, tentative changelog:

### Features

- [sdk] Improve plugin parameterize interface
  [](https://github.com/pulumi/pulumi/pull/16283)

- [sdk/{go,nodejs,python}] Make stack transforms a stable,
non-experimental feature
  [](https://github.com/pulumi/pulumi/pull/16282)

- [programgen/go] Implement importPathPattern in Go language options to
override emitted paths in generated Go programs
  [](https://github.com/pulumi/pulumi/pull/16267)

### Bug Fixes

- [engine] Fix panic with --continue-on-error on delete after failed
create
  [](https://github.com/pulumi/pulumi/pull/16261)
2024-05-31 16:47:45 +00:00
Justin Van Patten d919543096
Prepare for v3.118.0 release ()
Going ahead and getting this prepared.

At a minimum, want to include:
- https://github.com/pulumi/pulumi/pull/16261
- https://github.com/pulumi/pulumi/pull/16282
2024-05-30 19:28:53 +00:00
Justin Van Patten c2cb41f49b
Flip stack transforms to non-experimental ()
Registering stack transforms is now non-experimental. This change
updates the function signatures in the Go, Node.js, and Python SDKs
along with associated types and comments.

Follow-up to 
2024-05-30 18:01:33 +00:00
Pulumi Bot ee831fc5b6
Changelog and go.mod updates for v3.117.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-05-25 04:02:38 +00:00
Justin Van Patten afbd3ea6e1
Freeze v3.117.0 ()
To be merged after:
- https://github.com/pulumi/pulumi/pull/16261
- https://github.com/pulumi/pulumi-docker-containers/pull/195

Tentative changelog...

### Features

- [engine] Guess ID references of dependant resources when generating
code for import operations
  [](https://github.com/pulumi/pulumi/pull/16208)


### Bug Fixes

- [engine] Check property dependencies and deleted-with relationships
for target dependents
  [](https://github.com/pulumi/pulumi/pull/16220)

- [engine] Propagate dependencies of untargeted resources correctly
during targeted updates
  [](https://github.com/pulumi/pulumi/pull/16247)

- [backend/diy] Rewrite DeletedWith references when renaming stacks
  [](https://github.com/pulumi/pulumi/pull/16216)

- [cli/state] Fix state renames involving DeletedWith

- [sdk/python] Use a separate type variable for static methods on Output
  [](https://github.com/pulumi/pulumi/pull/16172)

- [sdk/python] Relax Output.all types to better match the implementation
  [](https://github.com/pulumi/pulumi/pull/16172)

- [sdkgen/python] Generate __init__.py files for modules that only
contain enumerations
  [](https://github.com/pulumi/pulumi/pull/16229)
2024-05-24 21:16:00 +00:00
Justin Van Patten 7dd97b97a2
Prepare for v3.117.0 release ()
Tentative changelog:

### Features

- [engine] Guess ID references of dependant resources when generating
code for import operations
  [](https://github.com/pulumi/pulumi/pull/16208)


### Bug Fixes

- [engine] Check property dependencies and deleted-with relationships
for target dependents
  [](https://github.com/pulumi/pulumi/pull/16220)

- [engine] Propagate dependencies of untargeted resources correctly
during targeted updates
  [](https://github.com/pulumi/pulumi/pull/16247)

- [backend/diy] Rewrite DeletedWith references when renaming stacks
  [](https://github.com/pulumi/pulumi/pull/16216)

- [sdk/python] Use a separate type variable for static methods on Output
  [](https://github.com/pulumi/pulumi/pull/16172)

- [sdk/python] Relax Output.all types to better match the implementation
  [](https://github.com/pulumi/pulumi/pull/16172)

- [sdkgen/python] Generate __init__.py files for modules that only
contain enumerations
  [](https://github.com/pulumi/pulumi/pull/16229)
2024-05-24 15:29:40 +00:00