Commit Graph

6 Commits

Author SHA1 Message Date
Julien P 96b7e56799
Allow disabling version validation when using a custom PulumiCommand isntance ()
# Description

When we introduced `PulumiCommand` we maintained the existing behaviour
to disable validating the version. However when creating a custom
`PulumiCommand` instance instead of letting `LocalWorkspace` [create
it](c306b13c51/sdk/nodejs/automation/localWorkspace.ts (L307)),
there is no way to disable the validation.

This PR makes `skipVersionCheck` a documented option and additionally
checks `PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK` inside
`PulumiCommand`.

`PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK` always takes precedence. When
running with that env variable set, there's no way to turn off checks.
This matches the behaviour pre-autoinstall.

Ref https://github.com/pulumi/pulumi/issues/14987
2024-01-26 13:41:10 +00:00
Julien P 09c36945ac
Install Pulumi CLI from Automation API ()
# Description

Provide a way for the Automation API to install the Pulumi CLI so that
Automation API can be used in a more standalone manner.

https://github.com/pulumi/pulumi/issues/14987

⚠️ Needs https://github.com/pulumi/get.pulumi.com/pull/171 to be merged
and deployed to production first.

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

---------

Co-authored-by: Pat Gavlin <pat@pulumi.com>
2024-01-19 10:43:31 +00:00
Justin Van Patten 1fca4e9d89 [sdk/nodejs] Cleanup use of `asyncTest` and `assertAsyncThrows`
The `asyncTest` and `assertAsyncThrows` helpers were necessary when originally written, but are no longer needed as Mocha has built-in support for testing async functions that return promises, and Node's `assert.rejects` can be used to assert whether a promise has been rejected.
2022-11-09 15:08:08 -08:00
Anton Tayanovskyy 40accabf72
Relax assert about num of onOutput calls () 2022-09-12 13:03:25 -07:00
Anton Tayanovskyy a13426ded8
[nodejs/auto] Fix incremental behavior of onStdout ()
* Fix incrementality of onStdout

* Test that onOutput is called more than once

* Add a CHANGELOG entry
2022-09-12 12:41:08 -04:00
Kyle Pitzen 490be1cc52
fix(automation): runPulumiCommand failed to call onOutput when provided () 2022-09-06 12:18:31 -04:00