Commit Graph

11594 Commits

Author SHA1 Message Date
Pat Gavlin 5d73fc5b05
[snapshot] Elide writes for RRO with no changes ()
These changes elide checkpoint writes for RegisterResourceOutputs steps
if the associated resource's outputs have not changed. This can
eliminate unnecessary snapshot writes for stacks with large numbers of
component resources whose outputs do not change.
2024-04-18 22:09:08 +00:00
Mikhail Shilkov 60adf1823d
Don't bail at preview when a protected resource needs replacement ()
<!--- 
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

Don't bail at preview when a protected resource needs replacement, just
error. This makes sure that users can see the actual diff that causes
the replacement.

Fixes 

Before:

```
$ pulumi preview
Type                                     Name                  Plan     Info
     pulumi:pulumi:Stack                      azure-native-ts-dev2           
     └─ azure-native:resources:ResourceGroup  rg                             1 error

Diagnostics:
  azure-native:resources:ResourceGroup (rg):
    error: unable to replace resource "urn:pulumi:dev2::azure-native-ts::azure-native:resources:ResourceGroup::rg"
    as it is currently marked for protection. To unprotect the resource, remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`


$ pulumi preview --diff
pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev2::azure-native-ts::pulumi:pulumi:Stack::azure-native-ts-dev2]
error: unable to replace resource "urn:pulumi:dev2::azure-native-ts::azure-native:resources:ResourceGroup::rg"
as it is currently marked for protection. To unprotect the resource, remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`
Resources:
    1 unchanged
```

After:

```
$ pulumi preview
Type                                     Name                  Plan        Info
     pulumi:pulumi:Stack                      azure-native-ts-dev2              1 error; 2 warnings
 +-  └─ azure-native:resources:ResourceGroup  rg                    replace     [diff: ~location]; 1 error

Diagnostics:
  azure-native:resources:ResourceGroup (rg):
    error: unable to replace resource "urn:pulumi:dev2::azure-native-ts::azure-native:resources:ResourceGroup::rg"
    as it is currently marked for protection. To unprotect the resource, remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`

  pulumi:pulumi:Stack (azure-native-ts-dev2):
    error: preview failed


$ pulumi preview --diff
pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev2::azure-native-ts::pulumi:pulumi:Stack::azure-native-ts-dev2]
error: unable to replace resource "urn:pulumi:dev2::azure-native-ts::azure-native:resources:ResourceGroup::rg"
as it is currently marked for protection. To unprotect the resource, remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`
    +-azure-native:resources:ResourceGroup: (replace) 🔒
        [id=/subscriptions/0282681f-7a9e-424b-80b2-96babd57a8a1/resourceGroups/rg5f8e30e4]
        [urn=urn:pulumi:dev2::azure-native-ts::azure-native:resources:ResourceGroup::rg]
        [provider=urn:pulumi:dev2::azure-native-ts::pulumi:providers:azure-native::default_2_30_0::3c957b2a-4852-439c-b211-22a115bbe89a]
      ~ location: "westeurope" => "westus2"
error: preview failed
Resources:
    +-1 to replace
    1 unchanged
```

## 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`

<!--- 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-04-18 16:45:52 +00:00
Pulumi Bot 10e63ccb96
Changelog and go.mod updates for v3.113.1 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-04-18 13:07:23 +00:00
Daniel Bradley 690dfbdc7a
Allow setting version during generation ()
<!--- 
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

Some schemas can't contain the correct version as they need to be
committed. Therefore allow the option to set the version in the schema
at the point of generation.

## 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`
- [ ] I have added tests that prove my fix is effective or that my
feature works
  - There appears to be no existing tests for this command.
- No changelog required as this is still a hidden command for internal
use.
2024-04-18 10:09:13 +00:00
Thomas Gummerer cfd3784782
Freeze 3.113.1 ()
This should be merged after https://github.com/pulumi/pulumi/pull/15974.
I'm not including the tentative changelog there as the most important
item on the list isn't merged yet (and go-change isn't cooperating with
me trying to get that included manually).
2024-04-18 09:25:49 +00:00
Pat Gavlin 64bee7d287
[backend] Fix dependency sorting in mustWrite ()
Just use slices.Sort instead of sort.Slice.

---------

Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-04-18 08:14:51 +00:00
Thomas Kappler f6b405c24e
Replace non-updating filtered template counter ()
# Description

When running `pulumi new` and choosing a template, it says _“Please
choose a template (51/227 shown)”_ which is probably correct (haven’t
counted), but then when I type to narrow it down, the number of shown
templates never changes.

<img width="722" alt="Screenshot 2024-04-14 at 08 10 57"
src="https://github.com/pulumi/pulumi/assets/12074/dc5d242b-3f48-4ab9-a3f1-c192fb5a5dd5">

This PR removes the number of templates shown from the message so it
just says how many there are in total.

<img width="382" alt="Screenshot 2024-04-17 at 07 57 27"
src="https://github.com/pulumi/pulumi/assets/12074/2f095374-83e3-4c69-b8ab-0425d2424982">


I did look into making the number of shown templates update correctly
but couldn't find a hook in the Survey package that allows this. I also
thought it's not worth much effort since [Survey is deprecated in favor
of Bubbletea](https://github.com/AlecAivazis/survey?tab=readme-ov-file).

## 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
_Unfortunately, I couldn't find pre-existing tests for that area of the
CLI._

- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
_I'll let the engine team guide me on whether this is changelog-worthy._

- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
2024-04-17 11:32:04 +00:00
Thomas Gummerer 4dbacf37af
update dotnet SDK version in codegen tests ()
Since we released a new SDK we should also update the version here.
Otherwise tests might end up failing as soon as a provider we're using
in the tests depends on the new dotnet SDK version.

Saw https://github.com/pulumi/pulumi/pull/15955 and realized we ran into
issues with this last time.
2024-04-17 08:15:06 +00:00
Thomas Gummerer ca2a1cb83a
add issue template for flaky tests ()
I keep reporting these, but it's kind of annoying to always add the
right labels and have them kind of consistent. Add an issue template to
make reporting these flakes a little easier, which hopefully makes
people more likely to open issues, and thus track the flakes.
2024-04-17 07:44:40 +00:00
Komal 9a370c727a
Use new API for deployments ()
<!--- 
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. -->

Updates Remote Automation API to use the new stable URLs for the
Deployments API. Adds support for `inheritSettings` to allow inheriting
deployment settings pre-existing on the stack.

I've tested this manually by editing the automation-api-examples for
remote deployments, but not sure of a great way to add automated tests
since automation api doesn't yet have support for setting deployment
settings.

EDIT: I considered just setting up a static stack for this but abandoned
it because of concerns around parallel runs. We can add automated tests
for this once we support creating deployment settings with automation
api (coming soon).

Fixes  
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. -->
- [ ] 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-04-16 23:23:56 +00:00
Fraser Waters 571ccc6de4
Update dotnet language host () 2024-04-16 15:07:33 +00:00
Fraser Waters 901c2f5e9c
Add StackReference conformance test ()
<!--- 
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/15932.

This adds a conformance test that checks that StackReferences work.
Tests a plain string and a secret string output.

To support this test we add a new intrinsic `getOutput` that takes a
stack reference resource and a string and calls the
`get_output/getOutput/GetOutput` method on the stack reference resource
type.


## 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-04-16 11:13:25 +00:00
Thomas Gummerer 1dd0f7fdc7
Allow CopyFile to copy symlinks ()
Bazel builds create symlinks of each file. We still want to copy these
into test directories etc., so allow CopyFile to do that. This is a
prerequisite for getting pulumi-yaml to build in Bazel.

We hide this with an environment variable, as that's easy to set during
Bazel builds, but does not affect this function during regular usage.
2024-04-16 07:54:36 +00:00
coderwander 93748ad958
chore: fix some comments ()
<!--- 
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. -->

Fix some names in comments to match the attached code names.

Signed-off-by: coderwander <770732124@qq.com>
2024-04-16 07:21:22 +00:00
Pulumi Bot 4c67ab76f8
Changelog and go.mod updates for v3.113.0 ()
Co-authored-by: github-actions <github-actions@github.com>
2024-04-16 00:06:35 +00:00
Justin Van Patten c7bd2c5859
Add missing `typescript` dependency to sxs_ts_test ()
With the release of v3.113.0, `@pulumi/pulumi` has an optional peer
dependency on `typescript`. If trying to use `tsc` directly, you must
explicitly add `typescript` as a dependency in your `package.json`.
We're calling `tsc` for this test, so we need to add an explicit
dependency.

Note: This could be a `devDependency`, but the `package.json` files for
the other test cases list the `typescript` dependency as a regular
`dependency` (see
[this](https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/tests/sxs_ts_test/package%5E3.json)
and
[this](https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/tests/sxs_ts_test/package%5E4.json)),
so doing the same here.

Fixes https://github.com/pulumi/pulumi/issues/15949
2024-04-16 00:05:05 +00:00
Justin Van Patten 6210fe97f8
Freeze v3.113.0 ()
### Features

- [auto/{go,nodejs,python}] Add support for continue-on-error parameter
of the destroy command to the Automation API
  [](https://github.com/pulumi/pulumi/pull/15921)

- [cli] Support always fully qualifying stack names in CLI output
  [](https://github.com/pulumi/pulumi/pull/15857)

- [cli] Add --no-plugins and --no-dependencies to `pulumi install`
  [](https://github.com/pulumi/pulumi/pull/15910)

- [docs] Implement Java constructor syntax examples
  [](https://github.com/pulumi/pulumi/pull/15805)

- [sdk/nodejs] Make TypeScript and ts-node optional peer dependencies to
allow using user specified versions
  [](https://github.com/pulumi/pulumi/pull/15622)

- [sdk/{nodejs,python}] Allow apply to have unknown values during
updates
  [](https://github.com/pulumi/pulumi/pull/15898)

- [sdk/python] Add 'typeChecker' runtime option to the Python language
host
  [](https://github.com/pulumi/pulumi/pull/15922)
  [](https://github.com/pulumi/pulumi/pull/15725)


### Bug Fixes

- [auto] Tolerate missing stack and bookkeeping files in ProgramTest
  [](https://github.com/pulumi/pulumi/pull/15922)
  [](https://github.com/pulumi/pulumi/pull/15863)

- [cli] Fix a panic when user's home directory could not be looked up
  [](https://github.com/pulumi/pulumi/pull/15872)

- [cli] Fix some commands that didn't respect
`--disable-integrity-checking`
  [](https://github.com/pulumi/pulumi/pull/15911)

- [programgen/dotnet] Remove trailing whitespace from emitted DependsOn
resource option expressions
  [](https://github.com/pulumi/pulumi/pull/15922)
  [](https://github.com/pulumi/pulumi/pull/15892)

- [auto/go] Avoid flakyness when reading the event log from pulumi
commands
  [](https://github.com/pulumi/pulumi/pull/15856)

- [sdk/go] Fix Provider and Providers options in Go transform functions
  [](https://github.com/pulumi/pulumi/pull/15885)

- [sdk/nodejs] Handle serialization of aliases for well known native
functions
  [](https://github.com/pulumi/pulumi/pull/15873)

- [sdk/nodejs] Correctly serialise functions whose code would make use
of reserved identifiers
  [](https://github.com/pulumi/pulumi/pull/15879)

- [sdk/nodejs] Serialize function values obtained from Function.bind
  [](https://github.com/pulumi/pulumi/pull/15887)

- [sdk/python] Improve types of getters in Python SDK
  [](https://github.com/pulumi/pulumi/pull/15865)

- [sdkgen/{dotnet,go}] Fix SDK-generation when referencing shared types
in config variables
  [](https://github.com/pulumi/pulumi/pull/15772)
  [](https://github.com/pulumi/pulumi/pull/15922)


### Miscellaneous

- [sdk/nodejs] Update builtin module list for function serialization
  [](https://github.com/pulumi/pulumi/pull/15830)

- [sdk/nodejs] Set package.json engines to node >= 18
  [](https://github.com/pulumi/pulumi/pull/15845)
2024-04-15 16:41:08 +00:00
Thomas Gummerer 44c8de53d5
go: allow unknowns during update ()
Currently we reject all unknowns during `pulumi up`. However we are soon
going to allow them to come through via `up --continue-on-error`, and
thus should no longer error out when we have them.

This is a similar preparatory PR to
https://github.com/pulumi/pulumi/pull/15898, except that Go deals with
the unknowns a little different, so we don't need to treat apply
specially, but the marshalling.
2024-04-15 16:28:17 +00:00
Fraser Waters a7e0551153
Reenable TestPythonTranslation and delete stack reference 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/14765.

TestPythonTranslation wasn't flaky in of itself, it was just the
standard venv logic being iffy. No reason to disable this one test.

The stack reference tests haven't ran for ages, taking some advice from
@lunaris and just deleting them all, I've raised
https://github.com/pulumi/pulumi/issues/15932 to rewrite them as
conformance tests.
2024-04-15 12:36:03 +00:00
Fraser Waters ce04d43792
Save component resources as parents ()
<!--- 
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/15843.

This tracks parent information separate from Goal information (as that
was only generated and saved for custom, not component, resources).

We also need to keep track of the transform list between the first
RegisterResource starting a remote component construction and the remote
component _actually_ registering itself. This means we save the
transform list correctly once the component is registered inside the
remote process allowing other resource registrations in the remote
process to see that saved transform list.
If we just wait till the Construct call is done then none of the inner
children pick up the transform list.

## 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-04-15 12:07:45 +00:00
Thomas Gummerer cd9d1603ba
Fix race condition when listing stacks ()
When listing stacks, we currently try to get all the stacks from the
backend, and then get the checkpoint to for each stack to show the
summary.

However there's a race between listing the stacks and getting the
checkpoints, so the checkpoint may be missing by the time we get to that
part of the code.

Unfortunately the errors we're getting form getCheckpoint are not
structured, so we can't tell if we got a 404 from the cloud here, so the
next best option we have is re-checking whether the stack still exists.

This is another attempt at fixing
https://github.com/pulumi/pulumi/issues/15658.
2024-04-15 11:25:20 +00:00
Thomas Gummerer fbfe3904a5
Upgrade gocloud.dev to 0.37 ()
Upgrade gocloud.dev to 0.37.  

Given what I found in
https://github.com/pulumi/pulumi/issues/15786#issuecomment-2051667094, I
don't believe this will help with this issue, but we should probably
upgrade this to the latest version anyway.

This should not be merged until
https://github.com/pulumi/pulumi/pull/15906 is also merged.
2024-04-15 07:47:29 +00:00
Fraser Waters 8588aa365c
Lift context parameter to SerializeDeployment/Resource/Operations/Properties ()
<!--- 
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. -->

SerializePropertyValue needed a `context.Context` object to pass to the
`config.Encrypter`. It was using `context.TODO()`, this change instead
accepts a context on the parameters and lifts that up to
SerializeProperties, SerializeResource, SerializeOperation, and
SerializeDeployment.

There were a few call sites for those methods that already had a context
on hand, and they now pass that context. The other calls sites now use
`context.TODO()`, we should continue to iterate in this area to ensure
everywhere that needs a context has one passed in.


## 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-04-15 07:45:46 +00:00
Eron Wright bdb813ae66
test: schema support for testprovider ()
<!--- 
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 enhances the testprovider to have a Pulumi schema, e.g. to be
able to use it with Pulumi YAML.

Related to https://github.com/pulumi/pulumi/issues/15788

## 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.
-->
- [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-04-12 20:38:49 +00:00
Fraser Waters b610557f5a
Fix warning about Snapshot write failed for previews ()
This stops the CLI warning about `error: Snapshot write failed: failed
to save snapshot: [403] Updating the checkpoint is not permitted for
preview operations.` on every preview operation.
2024-04-12 18:40:55 +00:00
Justin Van Patten ea4fdcad58
Revert "Freeze v3.113.0 ()" ()
This reverts commit 8ff72bf9fa.

We want to get in https://github.com/pulumi/pulumi/pull/15923 before
publishing the release.
2024-04-12 18:37:22 +00:00
Justin Van Patten 8ff72bf9fa
Freeze v3.113.0 ()
### Features

- [cli] Support always fully qualifying stack names in CLI output
  [](https://github.com/pulumi/pulumi/pull/15857)

- [cli] Add --no-plugins and --no-dependencies to `pulumi install`
  [](https://github.com/pulumi/pulumi/pull/15910)

- [docs] Implement Java constructor syntax examples
  [](https://github.com/pulumi/pulumi/pull/15805)

- [sdk/nodejs] Make TypeScript and ts-node optional peer dependencies to
allow using user specified versions
  [](https://github.com/pulumi/pulumi/pull/15622)

- [sdk/{nodejs,python}] Allow apply to have unknown values during
updates
  [](https://github.com/pulumi/pulumi/pull/15898)

- [sdk/python] Adds 'typeChecker' runtime option to the Python language
host
  [](https://github.com/pulumi/pulumi/pull/15725)


### Bug Fixes

- [auto] Tolerate missing stack and bookkeeping files in ProgramTest.
  [](https://github.com/pulumi/pulumi/pull/15863)

- [cli] Fix a panic when user's home directory could not be looked up
  [](https://github.com/pulumi/pulumi/pull/15872)

- [cli] Fix some commands that didn't respect
`--disable-integrity-checking`
  [](https://github.com/pulumi/pulumi/pull/15911)

- [programgen/dotnet] Removes trailing whitespace from emitted DependsOn
resource option expressions
  [](https://github.com/pulumi/pulumi/pull/15892)

- [auto/go] Avoid flakyness when reading the event log from pulumi
commands
  [](https://github.com/pulumi/pulumi/pull/15856)

- [sdk/go] Fix Provider and Providers options in Go transform functions
  [](https://github.com/pulumi/pulumi/pull/15885)

- [sdk/nodejs] Handle serialization of aliases for well known native
functions
  [](https://github.com/pulumi/pulumi/pull/15873)

- [sdk/nodejs] Correctly serialise functions whose code would make use
of reserved identifiers
  [](https://github.com/pulumi/pulumi/pull/15879)

- [sdk/nodejs] Serialize function values obtained from Function.bind
  [](https://github.com/pulumi/pulumi/pull/15887)

- [sdk/python] Improve types of getters in Python SDK
  [](https://github.com/pulumi/pulumi/pull/15865)

- [sdkgen/{dotnet,go}] Fixes SDK-generation when referencing shared
types in config variables
  [](https://github.com/pulumi/pulumi/pull/15772)


### Miscellaneous

- [sdk/nodejs] Update builtin module list for function serialization
  [](https://github.com/pulumi/pulumi/pull/15830)

- [sdk/nodejs] Set package.json engines to node >= 18
  [](https://github.com/pulumi/pulumi/pull/15845)
2024-04-12 16:21:27 +00:00
Thomas Gummerer 5f5f1eb7a9
Add fixed key tests for GCP and AWS key management ()
Add tests with fixed keys for GCP and AWS, similar to what we added for
Azure in https://github.com/pulumi/pulumi/pull/15187.

Fixes https://github.com/pulumi/pulumi/issues/15414
2024-04-12 15:09:26 +00:00
Thomas Gummerer 80f6ea9686
Add AWS access key to environment variables ()
This should make the AWS tests actually be run in CI instead of them
being skipped.

Fixes: https://github.com/pulumi/pulumi/issues/15908
2024-04-12 09:34:53 +00:00
Thomas Gummerer f491de125b
changelog consistency fixes ()
Fix a few changelog entries that aren't consistent with our style guide.

I noticed these in https://github.com/pulumi/pulumi/pull/15920. If we
want to fix these up we should merge this before that PR.
2024-04-12 08:50:22 +00:00
Mikhail Shilkov 5603b275f0
Add support for continue-on-error parameter of the destroy 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

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
Automation API Destroy in Node/Python/Go now has `--continue-on-error`

Resolves  (pending .NET)

.NET is interesting because we probably want to add it to
`UpdateOptions` once `up` has it and not to `DestroyOptions` (that
inherit from `UpdateOptions`). I'll probably skip it for now.

## 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`

<!--- 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. -->
2024-04-12 07:58:38 +00:00
Fraser Waters d28fa18eec
Test SnapshotManager and Journal in engine 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. -->

This tests the production snapshot manager against the journalling
snapshot system in engine tests. This should ensure that both systems
produce similar (we ignore exact resource ordering, as long as both are
valid) results.

## 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-04-11 22:54:08 +00:00
Fraser Waters 038759e698
Disable -race in dev builds () 2024-04-11 21:15:29 +00:00
Justin Van Patten c70d4e4e95
Prepare for v3.113.0 release ()
Tentative changelog:


### Features

- [cli] Support always fully qualifying stack names in CLI output
  [](https://github.com/pulumi/pulumi/pull/15857)

- [cli] Add --no-plugins and --no-dependencies to `pulumi install`
  [](https://github.com/pulumi/pulumi/pull/15910)

- [docs] Implement Java constructor syntax examples
  [](https://github.com/pulumi/pulumi/pull/15805)

- [sdk/nodejs] Make TypeScript and ts-node optional peer dependencies to
allow using user specified versions
  [](https://github.com/pulumi/pulumi/pull/15622)

- [sdk/{nodejs,python}] Allow apply to have unknown values during
updates
  [](https://github.com/pulumi/pulumi/pull/15898)

- [sdk/python] Adds 'typeChecker' runtime option to the Python language
host
  [](https://github.com/pulumi/pulumi/pull/15725)


### Bug Fixes

- [auto] Tolerate missing stack and bookkeeping files in ProgramTest.
  [](https://github.com/pulumi/pulumi/pull/15863)

- [cli] Fix a panic when user's home directory could not be looked up
  [](https://github.com/pulumi/pulumi/pull/15872)

- [cli] Fix some commands that didn't respect
`--disable-integrity-checking`

- [programgen/dotnet] Removes trailing whitespace from emitted DependsOn
resource option expressions
  [](https://github.com/pulumi/pulumi/pull/15892)

- [auto/go] Avoid flakyness when reading the event log from pulumi
commands
  [](https://github.com/pulumi/pulumi/pull/15856)

- [sdk/go] Fix Provider and Providers options in Go transform functions
  [](https://github.com/pulumi/pulumi/pull/15885)

- [sdk/nodejs] Handle serialization of aliases for well known native
functions
  [](https://github.com/pulumi/pulumi/pull/15873)

- [sdk/nodejs] Correctly serialise functions whose code would make use
of reserved identifiers
  [](https://github.com/pulumi/pulumi/pull/15879)

- [sdk/nodejs] Serialize function values obtained from Function.bind
  [](https://github.com/pulumi/pulumi/pull/15887)

- [sdk/python] Improve types of getters in Python SDK
  [](https://github.com/pulumi/pulumi/pull/15865)

- [sdkgen/{dotnet,go}] Fixes SDK-generation when referencing shared
types in config variables
  [](https://github.com/pulumi/pulumi/pull/15772)


### Miscellaneous

- [sdk/nodejs] Update builtin module list for function serialization
  [](https://github.com/pulumi/pulumi/pull/15830)

- [sdk/nodejs] Set package.json engines to node >= 18
  [](https://github.com/pulumi/pulumi/pull/15845)
2024-04-11 20:52:58 +00:00
Fraser Waters 1b65e6c885
Add some missing checks for DisableIntegrityChecking ()
<!--- 
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 would have helped with
https://github.com/pulumi/pulumi/issues/15831 as the `destroy` would
have been able to run instead of err'ing on the first save because of
the already broken snapshot.

## 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.
-->
- [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-04-11 16:38:19 +00:00
Fraser Waters 959fc6c8b4
Run integration tests with race detection ()
<!--- 
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. -->
Combining  and  and including fixes to allow tests to pass.

Enable race detection in the binary we're using for integration tests.
This will allow us to catch more data races before they get into any
release. This does mean the binary we're using for integration tests is
slightly different from the binary we're releasing, however that's
already the case as we're running a binary with coverage enabled for
them. Later we rebuild the binary we're actually releasing.

This requires us to fix the race between snapshot code, display code,
and the step executor. I've done that by adding a lock to the State
struct. This does not feel great, but it's a quick way to fix this and
get race detection running (and unblocks  which was also hitting
the race detector because it started pulling snapshot code into unit
tests as well). There's probably a more principled overhaul that doesn't
require locking at this level.

## 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-04-11 15:58:42 +00:00
Fraser Waters 0c3884f72e
Add --no-plugins and --no-dependencies to `pulumi install` ()
<!--- 
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. -->

Raised on Slack. User would like to be able to use `pulumi install` but
just for dependency installation, skipping the plugins. Makes sense to
also support the opposite while here, i.e. just plugins.

## 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.
-->
- [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-04-11 14:59:54 +00:00
Thomas Gummerer eff61838ac
Make sure TestCall test doesn't flake ()
The ordering of this array isn't guaranteed, so use ElementsMatch
instead of Equal to compare to avoid the flakyness.

I noticed this test being flaky while working on bazel, but also noticed
it in CI logs, here:
https://github.com/pulumi/pulumi/actions/runs/8646652290/job/23706586759?pr=15906
2024-04-11 13:47:29 +00:00
Thomas Gummerer c91d40ac5f
allow unknowns in apply during update ()
Currently during updates we try to make the values known during apply,
even if they are marked unknown. This results in knows that should
really still be unknown.

Note that this behaviour is currently encoded in tests, which also
needed to change.
2024-04-10 16:48:38 +00:00
Fraser Waters 9cd05b41b1
Add array conformance test ()
Add an array output test to the conformance suite. Similar to the other
basic output tests.
2024-04-10 16:00:24 +00:00
Julien P fa2a196c27
Vendor TypeScript and ts-node ()
<!--- 
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

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

Historically these packages were direct dependencies of
`@pulumi/pulumi`. To decouple the node SDK from the precise version of
TypeScript, the packages are now declared as optional peer pependencies
of `@pulumi/pulumi` and customers can pick the versions they want.

The reason we mark the peer dependencies as *optional* is to prevent
package managers from automatically installing them. This avoids the
situation where the package manger would install a more recent version
of TypeScript without the user explictly opting in. Newer versions have
stricter type checks, and can thus stop existing programs from running
successfully.

When the peer dependencies are not present, we load the vendored
versions of the modules.

## 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`

<!--- 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-04-10 15:26:37 +00:00
Will Jones 0a6876c527
Support serialising reserved NodeJS identifiers ()
This commit addresses part of , in which we fail to serialise
closures whose code would use reserved identifiers like `exports`. This
is due to a change we made where module imports are hoisted to avoid
importing the same module multiple times. Previously, code adopted a
strategy of passing all dependencies using a `with` statement, viz.:

```typescript
function x() {
  return (function () {
    with({ fooBarBaz: require("foo/bar/baz"), ... }) {
      // Use of fooBarBaz
    }
  }).apply(...)
}

function y() {
  return (function () {
    with({ fooBarBaz: require("foo/bar/baz"), ... }) {
      // Use of fooBarBaz
    }
  }).apply(...)
}
```

This was changed to remove the duplicate imports, yielding code like:

```typescript
const fooBarBaz = require("foo/bar/baz")

function x() {
  return (function () {
    with({ ... }) {
      // Use of fooBarBaz
    }
  }).apply(...)
}

function y() {
  return (function () {
    with({ ... }) {
      // Use of fooBarBaz
    }
  }).apply(...)
}
```

However, while the previous approach would work with reserved
identifiers such as `exports` (`with({ exports, ... }) { ... }` is
perfectly acceptable), the new one does not (`const exports = ...` is
not acceptable since NodeJS will not allow redeclaration of the
`exports` global).

This commit combines the two approaches. Modules are only imported once,
but if an import would use a reserved identifier, we generate a fresh
non-conflicting identifier and alias this using a `with` statement. For
example:

```typescript
const fooBarBaz = require("foo/bar/baz")

// __pulumi_closure_import_exports is generated to avoid shadowing the reserved "exports"
const __pulumi_closure_import_exports = require("some/other/module")

function x() {
  return (function () {
    with({ exports: __pulumi_closure_import_exports, ... }) {
      // Use of fooBarBaz and exports
    }
  }).apply(...)
}
```

Note that it is not expected that  will be solved in its entirety.
While this commit fixes code that introduces identifiers like `exports`,
the introduction in question in that issue is caused by the use of
`pulumi.output(...)` in the constructor of a dynamic resource provider.
Since dynamic resource providers are implemented under the hood by
serialising their code, we attempt to serialise `pulumi.output` and its
dependency chain. This commit allows us to make more progress in that
regard, but other things go wrong thereafter. Fixing the deeper issue
that underpins  (and likely other challenges with dynamic
providers) is probably a more involved piece of work.
2024-04-10 15:12:43 +00:00
Julien P 29dfdcae72
Serialize function values obtained from Function.bind ()
<!--- 
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

When encountering a function obtained via `Function.bind` we previously
failed to serialise the function because we could not get the function
text.

This PR uses the v8 debugger API to grab the internal
`[[TargetFunction]]` property to obtain the original function and
re-bind it.

This does currently not handle successive binds like

```(function f() { ... }).bind("a").bind("b")```

Ref https://github.com/pulumi/pulumi/issues/5294

## 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`

<!--- 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. -->
2024-04-10 11:17:53 +00:00
Fraser Waters ac032a139f
Fix marshalling Provider and Providers options from Go transforms ()
<!--- 
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/15881.

## 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. -->
2024-04-10 07:58:30 +00:00
Zaid Ajaj 413f76cd77
[csharp/program-gen] Removes trailing whitespace from emitted DependsOn resource option expressions ()
# Description

Fixes  by removing the trailing whitespace from each expression
emitted in the `DependsOn` array

## Checklist

- [ ] 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. -->
2024-04-09 21:11:25 +00:00
Thomas Gummerer b2740680cf
use yarn less in nodejs codegen tests ()
Whenever yarn runs it holds a global lock, preventing any other yarn
process from running. Since our tests potentially try to run multiple
yarn processes in parallel, this reduces the potential for parallelism
in the tests dramatically.

By using `npm install` instead of `yarn install`, and runnig `tsc`
directly instead of using `yarn run`, the time to run this test goes
from >500s to ~90s when trying to run `nodejs/gen_program_test/batch1`.

Similar improvements can be expected from the other batches. This should
also help speed up CI, since this is part of the long tail of long
running tests.

This is another thing I noticed during the hackathon (running all tests
locally with bazel the difference was even more extreme).
2024-04-09 16:56:05 +00:00
Fraser Waters 616e911c0f
Use a generic wrapper around `sync.Map` ()
This removes the type casts necessary when using `sync.Map` and ensures
correctness without needing to check other use sites.
2024-04-09 10:56:25 +00:00
Aaron Friel e211f2e3d4
feat: declare a new type for 'any resource' ()
This commit exists to enable the Java SDK to update and use it, which
then unblocks the next commit passing tests.

Part of 

---------

Co-authored-by: Eron Wright <eron@pulumi.com>
2024-04-09 07:59:16 +00:00
Gilad Maymon f72e2763e2
Fix panic when looking up home ()
<!--- 
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

https://github.com/pulumi/pulumi/pull/15160 tries to fix
https://github.com/pulumi/pulumi/issues/15159 by checking that user is
nil or user.HomeDir is nil. Given github.com/tweekmonster/luser embeds
the builtin Golang User type as pointer, it still possible that
user.User is nil and calling user.HomeDir causes a nil pointer access.
this PR checks the embedded pointer explicitly

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

## 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.
-->
- [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-04-09 04:10:55 +00:00
Julien P ba78d97a93
Handle serialization of aliases for well known native functions ()
# Description

Emit expressions for aliased native functions
https://github.com/pulumi/pulumi/issues/5294#issuecomment-2031404191

## 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-04-08 15:06:40 +00:00