Commit Graph

72 Commits

Author SHA1 Message Date
Kyle Dixler 09fad93a65
[sdk/nodejs] pin `@grpc/grpc-js` to `v1.9.6` to resolve automation API hang ()
<!--- 
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  

A bug in @grpc/grpc-js v1.9.7 causes Automation API to hang. Pinning to
v1.9.6 resolves this hang.

See the added test case.

## 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. -->
2023-11-02 17:42:08 +00:00
Justin Van Patten 6d37c88fbf
[auto/nodejs] Add support for the path option for config operations ()
Add support for the `--path` flag for config operations in Node.js
Automation API.

Part of https://github.com/pulumi/pulumi/issues/5506
Related: https://github.com/pulumi/pulumi/pull/12265
Related: https://github.com/pulumi/pulumi/pull/13052
Related: https://github.com/pulumi/pulumi-dotnet/pull/191
2023-10-22 06:19:25 +00:00
Justin Van Patten b22087715f
[auto/nodejs] Remove SxS check that's no longer needed ()
This change removes the SxS check in the Node.js Automation API since
it's blocking a customer scenario and isn't needed anymore now that
 has been addressed with .

The check was originally added in  to provide a helpful error
message when multiple versions of `@pulumi/pulumi` were used with inline
programs, which could cause clashes with global state. Since then, we've
changed how state is stored to allow parallel execution of multiple
inline programs with . However, the SxS checks were not removed as
part of that change.

A customer recently hit the error associated with the SxS check. They
are creating a Next.js program that runs Pulumi operations as inline
programs. Next.js ends up loading modules multiple times in a way that
confuses the SxS checker, causing the error to be thrown, even though it
wouldn't have been a problem.

Fixes 
2023-10-11 18:09:58 +00:00
Joe Duffy 9e8435caec Add a better error message for invalid NodeJS AutoAPI workdir
If you supply a workDir to a NodeJS AutoAPI LocalWorkspace, it
does not validate its correctness, and proceeds to use it when
trying to spawn commands. That leads to misleading and confusing
"Command failed with ENOENT: pulumi version" error messages,
making it look like the issue is a missing `pulumi` binary on
your PATH. This changes to eagerly check and issue a more
friendly error message. Fixes .
2023-06-24 11:57:22 -07:00
Robbie McKinstry e05a3bd81c
Apply autoformat
This commit applies the Rome autoformatter to the Node SDK.
These changes are automatically produced. To reproduce these
changes, run `make format` from inside sdk/nodejs.
2023-04-28 18:27:10 -04:00
Robbie McKinstry 5054b1fa17
Update sdk/nodejs/tests/automation/localWorkspace.spec.ts
Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
2023-04-25 16:44:54 -04:00
Robbie McKinstry df1ceded29
Fix lint. 2023-04-25 15:05:11 -04:00
Robbie McKinstry 6d9b8511dc
Add potential stack modification code. 2023-04-25 13:42:22 -04:00
Robbie McKinstry 7d6b3c9444
Add --refresh flag to preview for NodeJS Automation API 2023-04-25 12:05:17 -04:00
Justin Van Patten 951e474470 [auto/nodejs] Add `excludeProtected` option for `destroy`
This change adds an `excludeProtected` option for `destroy`.
2023-04-24 12:12:11 -07:00
bors[bot] 8d88744d25
Merge
12374: whoami: Add --json flag, expose everything in Auto API r=abhinav a=mrod-io

<!--- 
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 `--json` flag to `pulumi whoami` (CLI)
* Adds `url` and `organizations` to WhoAmIResult in NodeJS, Go and Python (automation API)

I sanity tested the auto api in the 3 runtimes and the cli output looks like:

```bash
$ pulumi whoami -j
{
  "user": "me",
  "organizations": [
    "me",
    "company"
  ],
  "url": "https://app.pulumi.com/me"
}
```

<!--- 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/10356

## Checklist

<!--- 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 Service,
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 Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


12397: Changelog and go.mod updates for v3.57.1 r=abhinav a=pulumi-bot

bors merge

Co-authored-by: Matthew Rodrigues <matthew.rodrigues@starburstdata.com>
Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
Co-authored-by: github-actions <github-actions@github.com>
2023-03-09 17:11:34 +00:00
Justin Van Patten 9af93ba0b6 [sdk/nodejs/tests] Fix bug in test that prevents concurrent runs
Fix the test to use a random suffix in the stack name (like the other tests) to prevent failures during concurrent runs.
2023-03-08 16:02:18 -08:00
Matthew Rodrigues 5e3cb03cf7 Add url and organizations to WhoAmIResult for NodeJS Automation API 2023-03-08 09:30:07 -05:00
bors[bot] d5831927be
Merge
11943: Test and fix for nodejs automation api r=Frassle a=Frassle

nodejs automation api was setting the envvar PULUMI_CONFIG for every pulumi command it called, this tripped up the dotnet sdk which only expects PULUMI_CONFIG to be set to a valid JSON string (not the empty string).

Looks like this was just a slightly confused bit of code to try and deal with parallel programs, I've moved it out of the workspace part of automation api and fixed up the inline server to deal with parallel programs correctly instead.

Fixes 

Co-authored-by: Fraser Waters <fraser@pulumi.com>
2023-01-23 08:52:19 +00:00
Fraser Waters 0251f7331e Test and fix for nodejs automation api 2023-01-23 08:26:58 +00:00
Matthew Rodrigues dd6ab403b2 Add stack tag support for nodejs automation api sdk 2022-12-14 22:27:56 -05: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
Justin Van Patten 31bf640375 [auto/nodejs] Test remote operations
Also cleans up some error messages to be consistent with the CLI and other languages.
2022-11-09 05:26:07 -08:00
bors[bot] 7711564193
Merge
10955: Add new install plugin from server function r=jaxxstorm a=jaxxstorm

Add the ability to install plugins from a server.

Co-authored-by: Lee Briggs <lee@leebriggs.co.uk>
Co-authored-by: Fraser Waters <fraser@pulumi.com>
2022-10-24 02:52:30 +00:00
Lee Briggs 145be00e44
remove trailing spaces 2022-10-14 08:12:12 -07:00
Lee Briggs 00366a158c
disable local plugin test 2022-10-13 11:20:49 -07:00
Kyle Pitzen 5cfad4a909 fix: Allows for parallel pulumi programs to run in the node runtime 2022-10-13 07:15:25 -04:00
Lee Briggs cd442d1e22
remove default kind from plugin commands 2022-10-11 07:51:32 -07:00
Lee Briggs 56e12e9140
Add new install plugin from server function 2022-10-06 18:40:02 -07:00
Robbie McKinstry e978311216
Enable ESModule interoperability 2022-09-20 10:34:00 -04:00
Kyle Pitzen 26549ab52d
fix(sdk/nodejs): resolves issue with multiple parallel shell processes () 2022-08-29 16:44:03 -04:00
Anton Tayanovskyy d695f046c6
Fix for 8518 automation API issue with set_config "-value" ()
* Fix auto api config set dash-prefixed -value

* Python changes

* Add a Python test

* TS LINT

* Go fix

* Go tests

* Go lint

* Fix test code

* .NET fix and test

* CHANGELOG
2021-12-23 13:44:56 -05:00
Anton Tayanovskyy 372ddc7e5c
Skip flaky tests for now () 2021-11-15 15:17:20 -05:00
Ian Wahbe 83e24765f3
.NET & python SDKs parity for bad pulumi versions ()
* .NET & python SDKs parity for bad pulumi versions

They handle invalid Pulumi CLI version gracefully.

* Make python version property lazy

* Clarify .NET logic

* Add python test for validate_pulumi_version

* Add tests for invalid versions

* Fix python test

* Fix typo

* Fix tests

* Have _validate_pulumi_version handle parsing

* Modify python and .NET to parseAndValidate

* Modify typescript and go to parseAndValidate

* fix name
2021-10-27 20:54:23 -07:00
Horace Lee a92a005d68
Use ESlint instead of TSlint ()
Migrated TSlint configs to ESlint ones using [tslint-to-eslint-config](https://github.com/typescript-eslint/tslint-to-eslint-config) tool, and refined the configs to better match the current coding style.

Changes:
- [member-delimiter-style](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md#options) that as suggested default for type definition to be  with `semicolon`
- Indentation fixes that is enforced by [eslint-indent](https://eslint.org/docs/rules/indent#options)
- Added dependencies for ESlint with Typescript
- Removed TSlint
2021-08-10 11:31:59 -07:00
Evan Boyle a850648504
detect nodejs side by side pulumi for inline automation programs and fail fast () 2021-06-23 07:57:36 -07:00
Justin Van Patten d6b7762102
Temporarily disable config secrets warning ()
Temporarily disable the new config secret warning to avoid unactionable warnings from provider `config` modules. We'll re-enable the warning when we've addressed that issue.
2021-05-24 16:06:27 -07:00
Justin Van Patten a61e79eb0d
[sdk/nodejs] Warn when a secret config is read as a non-secret () 2021-05-18 09:48:08 -07:00
Komal 840c7a5a13
Create stacks serially before setting config concurrently () 2021-05-12 01:36:03 -07:00
Komal 3ef2648f45
Use test-org from env var () 2021-05-11 08:41:21 -07:00
Evan Boyle 815f42d8a5
Set nodejs automation api test org from env () 2021-05-10 10:39:36 -07:00
Komal 37baab9749
Use local backend for concurrency test () 2021-05-04 09:43:11 -07:00
Evan Boyle c3dc2d54ab
Add user agent to the CLI, Go and Nodejs Automation API SDKs () 2021-04-30 07:26:23 -07:00
Komal 1ed3445ed4
[automation/*] - Optionally skip Automation API version check ()
Co-authored-by: James Nugent <jen20@apple.com>
2021-04-27 20:54:27 -07:00
Komal 288d67d78b
[auto/*] - Bump min version () 2021-04-22 16:17:49 -07:00
Komal 61ce479241
Re-add [BREAKING] - Standardize stack select behavior () ()
Co-authored-by: Paul Stack <public@paulstack.co.uk>
2021-04-22 14:10:39 +01:00
Evan Boyle 036344679a Enable nodejs dynamic provider caching by default on program side () 2021-04-14 19:32:18 +01:00
Paul Stack 3fad2e5329 Removing x namespace from go/python/nodejs automation packages () 2021-04-14 19:32:18 +01:00
Ville Penttinen d93e5acf67
[automation/dotnet] Expose WorkspaceStack.GetOutputsAsync () 2021-04-07 16:23:38 -07:00
Komal 55a0c1fc8e
[automation/go,nodejs,python] - Don't roundtrip project settings if file already exists. () 2021-03-31 11:00:11 -07:00
Komal 7671e85440
[automation/go,nodejs,python] - Respect existing project settings () 2021-03-31 07:51:11 -07:00
Komal 60cc4be9d3
[automation/*] - Add min version test for prerelease () 2021-03-24 14:00:33 -07:00
Komal 5e5c6ffb50
[automation/nodejs,go,python] - Expose pulumiVersion as string () 2021-03-23 15:09:50 -07:00
Komal 768db3e067
[automation/nodejs] - Implement min version checking () 2021-03-22 23:04:36 -07:00
Komal 1fc2ba48e2
[automation/nodejs] - Expose structured logging ()
Co-authored-by: Luke Hoban <luke@pulumi.com>
2021-03-11 11:45:28 -08:00