Commit graph

486 commits

Author SHA1 Message Date
Ian Wahbe 0d3311a4b4 Remove unused dependencies 2021-08-25 13:33:12 -07:00
Ian Wahbe cd2f126f5f Fix lint 2021-08-25 13:00:13 -07:00
Ian Wahbe 15e14b4126 Give up on the language plugin 2021-08-25 12:47:14 -07:00
Ian Wahbe a74aef0c0c Allow stderr to have content 2021-08-25 12:37:39 -07:00
Ian Wahbe 738af2b90f Remove AWS dependency for test 2021-08-25 10:50:45 -07:00
Ian Wahbe 6703075ae0 Make tests work
I figured out how easy it was to run the tests locally.
2021-08-25 09:31:24 -07:00
Ian Wahbe 5d466b67b3 Remove inconsistent assertion 2021-08-25 01:08:16 -07:00
Ian Wahbe 6b1eedff2b Ensure that "pulumi about" fails correctly 2021-08-25 00:34:14 -07:00
Ian Wahbe eaef5dfb29 Correctly handle empty stack in tests 2021-08-24 23:59:51 -07:00
Justin Van Patten 8112872b61
[sdk/dotnet] Support for calling methods (#7582) 2021-08-24 20:17:05 -07:00
Ian Wahbe aece703e94 Respect linter and run yarn install for tests 2021-08-24 18:15:38 -07:00
Ian Wahbe a406d6f30c fix test 2021-08-24 15:59:06 -07:00
Ian Wahbe d49a594093 Update tests and add integration test 2021-08-24 14:29:27 -07:00
Ian Wahbe 784c661c0c Make linter happy 2021-08-23 12:04:52 -07:00
Roopak Venkatakrishnan da2bd2ab04
Update x/sys for sdk to support go 1.17 (#7781)
Co-authored-by: Levi Blackstone <levi@pulumi.com>
2021-08-19 17:11:26 -06:00
Jan Češpivo e67334db1d
Added support for custom naming of dynamic provider resource (#7633)
Now there is not possible to change a name of dynamic provider resource without copying a code of the `pulumi.sdk.python.lib.pulumi.dynamic.dynamic.Resource` and changing the hard-coded name `"pulumi-python:dynamic:Resource"`. I successfully uses this proposal to make it possible.

Usage:
```python
class CustomResource(
    Resource, name="my-custom-provider:CustomResource"
):
   ...
```

Co-authored-by: Pat Gavlin <pgavlin@gmail.com>
2021-08-17 14:15:53 -07:00
PND b5ee840b16
[sdk/nodejs] Prevent Pulumi from overriding tsconfig.json options. (#7068) 2021-08-15 18:58:43 -07:00
Luke Hoban ebb0e6aaed
Allow Python dynamic provider resources to be constructed outside of __main__ (#7755)
The underlying library `dill` that we use for serializing dynamic providers into Pulumi state for Python dynamic providers serializes classes differently depending on whether they are in `__main__` or in another module.  We need the by-value serialization to be applied in all cases.

https://github.com/uqfoundation/dill/issues/424 is tracking adding the ability into `dill` to specify this by-value serialization explicitly, but until then, we will temporarily re-write the `__module__` of a provder class prior to serialization, so that `dill` behaves as we need for the dynamic provider use case.

Fixes #7453.
2021-08-12 20:02:17 -07:00
Anton Tayanovskyy 453bbe478a
Workaround flaky TestLocalStateLocking 7710 (#7730)
* Allow one unexplained error

* Revert extreme settings
2021-08-11 16:50:03 -04:00
Horace Lee a92a005d68
Use ESlint instead of TSlint (#7719)
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
Justin Van Patten fe603568fd
Use provider.MainWithOptions to reduce boilerplate in integration tests (#7684)
We can use the new `provider.MainWithOptions` to reduce boilerplate in some of our testcomponent providers.

Also, while cleaning up here, I took this as an opportunity to replace use of `github.com/pkg/errors` in the `tests` dir to use the built-in functionality of the Go standard library.
2021-07-30 06:31:17 -07:00
Justin Van Patten 74ab9e0869
[sdk/python] Handle unknown results from methods (#7677)
This fixes handling of unknown results from methods in the Python SDK. Node.js and Go were already handling this appropriately.
2021-07-29 11:11:52 -07:00
James Nugent 11fc7e7f2b
Add provider.MainWithOptions helper function (#7598)
This commit adds a new counterpart to `ComponentMain` which accepts
an options struct for specifying callback functions. Currently it
supports `construct` (for components) and `call` (for methods), but is
extensible in a non-breaking fashion in future to support all other
provider methods as they become useful to implement.

The original `ComponentMain` still exists, though it may be desirable to
deprecate it in future in favor of `MainWithOptions`.
2021-07-29 10:31:09 -07:00
Justin Van Patten e8bd8e5e1f
Rehydrate provider resources in Construct (#7624)
Previously, any provider resource passed to multi-lang components would be instantiated as a `DependencyProviderResource` inside `Construct`, which prevents the component from being able to easily access the provider's state as an instance of of the provider (e.g. `*aws.Provider`).

This change attempts to rehydrate the provider resource in the same way that resource references are rehydrated, if it's been registered, s.t. the specific provider resource type is instantiated with its state. Otherwise falling back to returning `DependencyProviderResource`.
2021-07-23 14:10:06 -07:00
Justin Van Patten 30311405ca
[sdk/go] Fix methods panic when marshaling self (#7604) 2021-07-22 05:28:46 -07:00
Justin Van Patten 68458bfab3
[sdk/python] Support for implementing methods in provider (#7555) 2021-07-19 14:58:55 -07:00
Luke Hoban 0bcca3883e
[sdk] Wait on remote component dependencies (#7541)
When a resource `dependsOn` a remote component, we were not correctly waiting on it, because we were skipping over waiting on comoponents, and only waiting on their custom resource children.  For remote components, we do not know the children, but waiting on the remote component will always wait on all children.

Co-authored-by: Mike Metral <1112768+metral@users.noreply.github.com>
2021-07-16 16:11:34 -07:00
Anton Tayanovskyy 30278f8e4c
Let alias tests compile under tags=all (#7489) 2021-07-12 14:38:51 -04:00
Justin Van Patten 4fc9f15525
Include the Go provider in the Node.js methods test (#7469) 2021-07-08 18:39:37 -07:00
Justin Van Patten eaf78edfef
[sdk/go] Support for calling methods (#7437) 2021-07-07 17:28:21 -07:00
Justin Van Patten c1f3e1c84b
[sdk/nodejs] Support for calling methods (#7377) 2021-07-07 16:03:56 -07:00
Anton Tayanovskyy 36d11261c6
Quick fix for provider flag ordering (#7412)
* specify plugin arguments before other flags

* Ignore these pesky flags in python provider.main

Co-authored-by: evanboyle <evan@pulumi.com>
2021-07-07 11:07:04 -04:00
Justin Van Patten 824fb397f9
[sdk/go] Support for implementing methods in provider (#7379) 2021-07-01 15:46:16 -07:00
Justin Van Patten 84b574f0df
Initial support for resource methods (authoring from Node.js, calling from Python) (#7363)
Adds initial support for resource methods (via a new `Call` gRPC method similar to `Invoke`), with support for authoring methods from Node.js, and calling methods from Python.
2021-06-30 07:48:56 -07:00
Evan Boyle c37cbc998b
Fix a hang in nodejs remote components when an error is thrown within an apply (#7365) 2021-06-25 18:41:54 -07:00
Evan Boyle 634e97cd55
Include config secret info in Construct calls (#7358) 2021-06-24 15:38:01 -07:00
Anton Tayanovskyy b16d50085b
Fix hanging deployments and improve errmsgs for programs with incorrect typings for output values (#7049)
* Do not hang but propagate exception when it happens in resolve_outputs

* Add an integration test for the issue

* Better error message

* Add CHANGELOG_PENDING entry

* Update sdk/python/lib/pulumi/runtime/rpc.py

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Address PR feedback and tighten path param typing

* Given Windows builder is failing, allow 2x time for the test

* Give some more time to the Windows runner

* Attempt to solve differently

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-06-23 11:27:17 -04:00
Pat Gavlin 2cc89defbc
Read passphrase from the terminal when rotating. (#7347)
Rotating a passphrase requires that the old passphrase is available via
one of the `PULUMI_CONFIG_PASSPHRASE` or `PULUMI_CONFIG_PASSPHRASE_FILE`
environment variables. This confuses `readPassphrase` when reading a new
passphrase, since that function checks the aforementioned environment
variables prior to reading from the console. The overall effect is that
it is impossible to rotate the passphrase for a stack using the
passphrase provider. These changes fix this by always reading from the
console when rotating a passphrase.
2021-06-22 11:13:57 -07:00
Justin Van Patten 48bbc28d9e
[sdk/go] Specify known when creating outputs for construct (#7343)
If an input is an unknown value or contains unknowns, specify `false` for `known` when creating the output.
2021-06-21 09:51:41 -07:00
Pat Gavlin 4da051a799
Add a convert-trace command. (#7319)
This command converts an appdash trace into a pprof file for use with
`go tool pprof`. Spans are converted into stacks by sampling each root
span at a given rate and recording the stack of subspans at each sample.

These changes also replace the conditional addition of experimental and
debug commands with conditional visibility. Experimental and debug
commands will always be available, but will be hidden unless the
appropraite environment variables are set.

Co-authored-by: Levi Blackstone <levi@pulumi.com>
2021-06-17 14:46:05 -07:00
Anton Tayanovskyy 7ff1491397
Add trace proxying to fix sub-process trace collection into files (#7248)
* Add trace proxying to fix sub-process trace collection when tracing to files

* Better func naming in test

* Avoid dealing with Windows path nightmare

* On Windows it is go.exe of course

* Rename operation to component to better align with existing trace output
2021-06-10 22:57:18 -04:00
Emiliza Gutierrez 8dda59d10f
Bumping version of go-cloud to v.0.23.0 (#7204)
* updating to go-cloud 0.23.0

* referencing go-cloud directly, remove fork reference

* updating dependencies from make ensure

* updating changelog
2021-06-03 15:28:33 -07:00
stack72 9a96d3c5e1 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.3.1 2021-05-25 09:35:31 +01:00
Justin Van Patten d6b7762102
Temporarily disable config secrets warning (#7129)
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
stack72 71297a56b4 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.3.0 2021-05-20 13:25:06 +01:00
Paul Stack 558aec5cef
Fixup go.sum file to prevent dirty builds (#7090) 2021-05-19 14:33:48 -07:00
Justin Van Patten f973fbcf58
[sdk/nodejs|python] Add GetSchema support to providers (#6892) 2021-05-19 07:11:18 -07:00
Justin Van Patten 070125e685
[sdk/go] Warn when a secret config is read as a non-secret (#7080) 2021-05-18 15:02:43 -07:00
Justin Van Patten 34a40d2b10
[sdk/dotnet] Warn when a secret config is read as a non-secret (#7079) 2021-05-18 15:01:57 -07:00
Justin Van Patten 480173a57f
[sdk/python] Warn when a secret config is read as a non-secret (#7078) 2021-05-18 15:00:30 -07:00
Justin Van Patten a61e79eb0d
[sdk/nodejs] Warn when a secret config is read as a non-secret (#6896) 2021-05-18 09:48:08 -07:00
Paul Stack ae22a99dbf
Adding acceptance tests for password less passphrase secret providers (#7019)
Fixes: #6982
2021-05-14 23:00:09 +01:00
Anton Tayanovskyy 493bac4c18
Make virtualenv paths relative to root when main points elsewhere (#6966)
* Propagate workspace.Project metadata to plugin init

* Get to a working fix

* Propagate Root via plugin context

* Propagate root instead of yaml path

* Revert out unnecessary parameter propagation

* Root is now always absolute at this point; simplify code and docs

* Drop python conditional and propagate unused -root to all lang hosts

* Add tests that fail before and pass after

* Lint

* Add changelog entry
2021-05-14 13:41:55 -04:00
stack72 24875d810c [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.2.1 2021-05-06 17:23:58 +01:00
stack72 46ec1aa9e2 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.2.0 2021-05-05 18:28:59 +01:00
Paul Stack 1640b7a5b1
[cli] Ensure the user has set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE (#6893)
Fixes: #6286

When a user is using the passphrase provider and unsets the environment
variables that let them interact with the secrets provider, then would
get an error as follows:

```
▶ pulumi up -y -f
error: decrypting secret value: failed to decrypt: incorrect passphrase, please set PULUMI_CONFIG_PASSPHRASE to the correct passphrase
```

We are oging to change this error message to make it more obvious
to a user what the error is and how they need to fix it

```
▶ pulumi up -y -f
error: constructing secrets manager of type "passphrase": unable to find either `PULUMI_CONFIG_PASSPHRASE` nor `PULUMI_CONFIG_PASSPHRASE_FILE` when trying to access the Passphrase Secrets Manager. Please ensure one of these values are set to allow the operation to continue
```

Ideally, we would like to prompt the user for the passphrase at this
point rather than error, but the CLI could be in the middle of an
update operation as the same codepath is used for reading stackreference
values
2021-04-28 01:21:16 +01:00
stack72 5279b1dfcf [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.1.0 2021-04-22 19:34:31 +01:00
stack72 c27e58bf2d [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.0.0 2021-04-19 09:14:31 +01:00
Paul Stack ddc3a30406
Merge pull request #6799 from pulumi/reconcile-master-2.x
Reconcile master with 2.25.x patch releases
2021-04-18 21:06:40 +01:00
Justin Van Patten 81810cbb9c
[sdk/go] Support prompt values in Construct (#6790)
Adds support for prompt values. And renames `ConstructInputs.SetArgs` to `ConstructInputs.CopyTo`.
2021-04-18 09:18:25 -07:00
stack72 2a224982a5 Reconcile master with 2.25.x patch releases 2021-04-17 11:43:08 +01:00
Justin Van Patten 780a0c8a3d
Support defining remote components in Go (#6403) 2021-04-16 11:49:21 -07:00
stack72 664776efe8 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.0.0-rc.1 2021-04-16 09:00:09 +01:00
Anton Tayanovskyy b77f32930c
Remote component py SDK (#6715)
* Python support for authoring resource providers for multi-lang

* Support for passing prompt values to Python resource providers
2021-04-15 14:49:51 -04:00
Paul Stack 19bd08fb1c fixup linting errors after rebase of master -> feature-3.0 (#6766) 2021-04-14 19:32:18 +01:00
stack72 5679496127 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.0.0-beta.2 2021-04-14 19:32:18 +01:00
Paul Stack f6fea7fafb [cli] Removing the deprecated pulumi history command (#6724) 2021-04-14 19:32:18 +01:00
Paul Stack e955a6b06a Refactor Mock newResource and call to accept property bag rather than individual args (#6672) 2021-04-14 19:32:18 +01:00
Justin Van Patten 1112c513c0 [sdk/python] Improved dict key translation support (#6695)
This change addresses Python dictionary key translation issues. When the
type of `props` passed to the resource is decorated with `@input_type`,
the type's and resource's property name metadata will be used for dict
key translations instead of the resource's `translate_input_property`
and `translate_output_property` methods.

The generated provider SDKs will be updated to opt-in to this new
behavior:

- FIX: Keys in user-defined dicts will no longer be unintentionally
  translated/modified.

- BREAKING: Dictionary keys in nested output classes are now
  consistently snake_case. If accessing camelCase keys from such output
  classes, move to accessing the values via the snake_case property
  getters (or snake_case keys). Generated SDKs will log a warning
  when accessing camelCase keys.

When serializing inputs:

  - If a value is a dict and the associated type is an input type, the
    dict's keys will be translated based on the input type's property
    name metadata.

  - If a value is a dict and the associated type is a dict (or Mapping),
    the dict's keys will _not_ be translated.

When resolving outputs:

  - If a value is a dict and the associated type is an output type, the
    dict's keys will be translated based on the output type's property
    name metadata.

  - If a value is a dict and the associated type is a dict (or Mapping),
    the dict's keys will _not_ be translated.
2021-04-14 19:32:18 +01:00
stack72 e05477b8d6 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v3.0.0-beta.1 2021-04-14 19:32:18 +01:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Luke Hoban 11c2ae3bd2 [sdk/go] Simplify Apply method options to reduce binary size (#6607)
Co-authored-by: Komal <komal@pulumi.com>
2021-04-14 19:32:18 +01:00
pulumi-bot 3082ebe275 Ensuring that Pulumi automation api is minimum 3.0.0 CLI version 2021-04-14 19:32:18 +01:00
stack72 5db7c9e277 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v2.25.0 2021-04-14 17:22:27 +01:00
svangordon-fruit 3a276bdd5e
Don't return an error if DeleteAllAccounts failed because the creds file doesn't exist (#6741)
Co-authored-by: Paul Stack <public@paulstack.co.uk>
2021-04-11 14:49:42 +01:00
Justin Van Patten f7cc19f89d
[sdk/nodejs] Keep prompt values prompt in construct (#6522)
In order to support prompt values in multi-lang components, if an input value is prompt, keep it as-is instead of wrapping it in an Output.
2021-04-09 14:36:22 -07:00
Evan Boyle 15120b99e3
Enable absolute and relative parent paths for pulumi main (#6734) 2021-04-08 21:39:52 -07:00
Justin Van Patten 394f79f27f
[sdk/nodejs] Fix construct to wait for RPC operations to complete (#6452)
This change fixes the provider implementation of `Construct` for multi-lang components written in Node.js to wait for any in-flight RPCs to finish before returning the results, s.t. all registered child resources are created.

In additional, invocations of `construct` are now serialized so that each call runs one after another, avoiding concurrent runs, since `construct` modifies global state. We'll follow-up with a more general concurrency fix to allow nested `construct` calls within the same provider.
2021-04-05 11:11:27 -07:00
Justin Van Patten dcf4359c57
[codegen/python] Support <Resource>Args classes (#6525)
Add support for creating instances of resources in Python using a
`<Resource>Args` class. This capability aligns with how args are passed
to resources in all the other language SDKs and the separate object bag
allows the properties to be manipulated/validated/passed-around before
creating the resource.
2021-04-02 10:09:17 -07:00
stack72 7f6ec8a7cf Cleanup after v2.24.1 release 2021-04-01 22:11:21 +01:00
Levi Blackstone 2dad8a6649
Revert "Swap out YAML parser library (#6642)" (#6681)
This reverts commit ff2cf70
2021-04-01 14:44:29 -06:00
stack72 80a43e9bec [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v2.24.0 2021-03-31 21:27:02 +01:00
Komal 35321159fc
[sdk/python] - Await all async tasks (#6606) 2021-03-30 10:56:17 -07:00
Levi Blackstone ff2cf701a7
Swap out YAML parser library (#6642)
Related to #423
2021-03-29 14:49:00 -06:00
Levi Blackstone 80270174f4
[tests] Add test to validate generated config file (#6624) 2021-03-26 13:10:41 -06:00
stack72 5ca9f4f57a [deps] Ensure pulumi/pulumi tests uses sdk v2.23.2 2021-03-25 17:39:55 +00:00
Anton Tayanovskyy 4e5828a890
Avoid double-quailfying venv folder path (#6599)
* Avoid double-quailfying venv folder path

* Replace `path` with `filepath`

* Add a Python integration test to cover venv auto-creation

* Merged

* Fix spelling

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Make AbsPath and RelPath test variants

* Fix issue on Windows backslash paths

* Debug windows test failure: more logging and aggressive YAML escaping

* Use filepath.IsAbs instead of path.IsAbs

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-03-24 15:51:46 -04:00
pulumi-bot 92544b746a [deps] Pinning pulumi/pulumi pkg & tests to v2.23.1 of the pulumi sdk 2021-03-18 04:14:20 +00:00
pulumi-bot dbac818c5d [deps] Pinning pulumi/pulumi tests to v2.23.0 of the pulumi sdk 2021-03-17 16:29:57 +00:00
Kraig Amador 71ec66aa45
Support locking on filestate logins (#2697)
When using the filestate backend (local files and cloud buckets) there is no protection to prevent two processes from managing the same stack simultaneously.

This PR creates a locks directory in the management directory that stores lock files for a stack. Each backend implementation gets its own UUID that is joined with the stack name. The feature is currently available behind the `PULUMI_SELF_MANAGED_STATE_LOCKING=1` environment variable flag.
2021-03-16 14:00:47 +11:00
Paul Stack 3f2d58ef7b
Fixing up go.mod and go.sum to ensure they don't continually change (#6502) 2021-03-11 20:41:45 +00:00
Komal 10d99b8afb
[automation/go] - Expose structured logging (#6436) 2021-03-10 20:49:48 -08:00
Paul Stack 0241fb282c
Upgrading to go-cloud v0.22.0 (#6473) 2021-03-09 18:59:01 +00:00
Paul Stack 0d5b3d375d
Ensuring dotnet package sources are correct for local packages (#6476)
When passing a package source as part of a `dotnet add package` in
our acceptance testing framework, dotnet was then trying to use that
package source for the restoration of other packages in the csproj
file.

We have removed passing the source to dotnet add package add
and replaced it with adding a machine level package source via
dotnet nuget add source command

this is the more correct way to work and will allow us to be able
to search multiple locations as part of the dotnet restore command
2021-03-09 14:57:24 +00:00
Komal 4882c9fec5
[CLI] - Add commands for config set-all and rm-all (#6373) 2021-02-19 21:55:58 -08:00
Justin Van Patten d02c0b1152
Default to UseAutomaticVirtualEnv in integration tests (#6318)
This way, the tests use the built-in virtual environment support by
default, which is what most customers will be using. A new `UsePipenv`
option is available to go back to using pipenv for tests.
2021-02-11 18:16:07 -08:00
Justin Van Patten f111a53337
Look for python binary first on Windows (#6317)
We previously looked for `python3` and fallback to `python` on all systems. However, our Windows CI images include a `python3.exe` symlink to `python.exe` which does not work with `venv`. So on Windows, just look for `python` first, falling back to `python3`. (The default python.org Windows installation only includes `python.exe`).
2021-02-11 11:34:07 -08:00
Justin Van Patten 0059cf205e
Remove dead Python integration tests (#6315)
These test files are no longer used. All the Python integration tests now use venv.
2021-02-11 08:21:50 -08:00
Justin Van Patten 71e8bf4325
Fix Python Windows test failures (#6296)
Update Python tests to use `UseAutomaticVirtualEnv` and set `PythonBin` to `python` on Windows because `python3` doesn't work correctly in the GitHub Action runners.
2021-02-10 16:35:21 -08:00
Evan Boyle 8e58f5d682
Add pagination to pulumi stack history (#6292)
replaces the unreleased `--limit` flag with `--page` and `--page-size` to support full pagination
2021-02-09 16:20:01 -08:00