Commit graph

338 commits

Author SHA1 Message Date
Levi Blackstone
d297db3d59
[sdk/proto] Add providers field to RegisterResourceRequest (#6761) 2021-04-13 15:19:24 -06:00
Komal
0c4e1a33e0
[automation/python - Expose structured logging (#6527) 2021-04-13 12:58:19 -07:00
Komal
33ceb1b70e
[automation/python] - Fix (de)serialization of StackSettings (#6749) 2021-04-12 15:50:53 -07:00
Evan Boyle
3d5ede69af
Set main for default projects in Automation API (#6743) 2021-04-09 20:30:11 -07:00
Ville Penttinen
d93e5acf67
[automation/dotnet] Expose WorkspaceStack.GetOutputsAsync (#6699) 2021-04-07 16:23:38 -07:00
Komal
7f226c1cb6
Fix serializing bug if output contains 'items' property (#6705) 2021-04-05 20:36:56 -07:00
Komal
5254e3f01d
[python/sdk] - Fix serialization bug if output contains 'items' property (#6701) 2021-04-05 12:39:56 -07:00
Pat Gavlin
55ecf7a81e
Run SDK lint jobs (#6674)
Just what it says on the tin. Fixes #6628.
2021-04-01 11:23:47 -07:00
Komal
55a0c1fc8e
[automation/go,nodejs,python] - Don't roundtrip project settings if file already exists. (#6669) 2021-03-31 11:00:11 -07:00
Komal
7671e85440
[automation/go,nodejs,python] - Respect existing project settings (#6655) 2021-03-31 07:51:11 -07:00
Komal
7d10e8c5be
Fix mypy errors (#6656) 2021-03-30 19:11:13 -07:00
Komal
35321159fc
[sdk/python] - Await all async tasks (#6606) 2021-03-30 10:56:17 -07:00
Pat Gavlin
7c5ec6815e
Make data sources catchable in Python (#6504)
The current logic lets unhandled errors in the RPC invocation
unahandled in the async loop, which crashes the process due to
the way we await completion of RPCs before exiting the process
in Python. Instead of doing that, we can just marshal them back
to the synchronous awaiter as part of the calling convention,
and have that awaiter (which is called by the invoke methods)
re-raise the exception. This should fix pulumi/pulumi#3611.
2021-03-29 12:07:43 -07:00
Komal
e5223492c7
[automation/python] - Fix passing of extra environment variables (#6639) 2021-03-29 11:48:17 -07:00
Justin Van Patten
872d9cb849
[sdk/python] Fix mypy errors (#6627) 2021-03-26 15:41:08 -07:00
Komal
60cc4be9d3
[automation/*] - Add min version test for prerelease (#6612) 2021-03-24 14:00:33 -07: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
Levi Blackstone
7f42d42b2b
[automation/python] Fix Settings file save (#6605)
The Project and Stack save routines were erroneously
dumping the Python objects rather than the __dict__
property, which resulted in some extra annotations
in the resulting YAML files. Some parsers don't handle
these annotations correctly, and consider the resulting
YAML file to be invalid.
2021-03-23 19:26:34 -06:00
Komal
5e5c6ffb50
[automation/nodejs,go,python] - Expose pulumiVersion as string (#6604) 2021-03-23 15:09:50 -07:00
Komal
b187ce18c2
[automation/python] - Implement min version checking (#6589) 2021-03-23 08:35:11 -07:00
Anton Tayanovskyy
22f332e094
Fix docstring on node log.error and other SDK equivalents (#6573)
* Fix docstring of log.error across SDKs to explain non-termination

* Accept PR feedback, briefer docstrings.
2021-03-18 13:57:10 -04:00
Paul Stack
1d3c9edb6c
Ensure that make brew works as expected rather than passing empty version (#6566)
Fixes:#6565

As part of #6460, the logic for determing the version of the build was
moved to be a dependency on pulumictl.

Unfortunately, the homebrew installs use the "make dist" command to
build + install Pulumi to the user maching and as that would have a
dependency on pulumictl and it not existing on the user machine, it
would pass an empty version to the ldflag

This then manifested to the user as:

```
▶ pulumi version
warning: A new version of Pulumi is available. To upgrade from version '0.0.0' to '2.22.0', run
   $ brew upgrade pulumi
or visit https://pulumi.com/docs/reference/install/ for manual instructions and release notes.
```

We are able to mitigate this behaviour by bringing back the get-version
script and using that script as part of the make brew installation

We can see that the versions are the same between the 2 different
installation techniques

```
make dist <------- uses pulumict
DIST:
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=2.24.0-alpha.1616029310+787eb70a" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet
DIST:
BUILD:
```

```
make brew <----- uses the legacy script
▶ make brew
BREW:
go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=v2.24.0-alpha.1616029310+g787eb70a2" github.com/pulumi/pulumi/sdk/v2/dotnet/cmd/pulumi-language-dotnet
BREW:
```

A full post mortem will be carried out to ensure we mitigate these
types of errors going forward and that we are able to better test
these types of situations
2021-03-18 02:07:02 +00:00
Ville Penttinen
66f5d50a50
[automation/dotnet,nodejs,python] Specify exec-kind for refresh & destroy (#6530)
dotnet, nodejs and python automation APIs did not specify exec-kind for
refresh or destroy operations. This is now added following the same
logic from the go automation API.
2021-03-16 14:24:32 -07:00
Paul Stack
c48ba37fcf
Migrate the version calculation to use pulumictl (#6460) 2021-03-10 19:03:29 +00:00
Meno Abels
fad0393288
[sdk/python] mypy was not found (#6478) 2021-03-09 15:02:27 -08:00
Justin Van Patten
0b1414dc6d
[sdk/python] Fix mocks issue when passing a resource more than once (#6479)
This change avoids `RuntimeError: There is no current event loop in thread '<thread_name>'` errors when passing a resource as an input multiple times when using mocks.

The problem is that when using mocks, we deserialize the gRPC inputs before passing them to the user's mock methods. Deserializing inputs doesn't typically require an event loop, however, during deserialization of resource references, we end up creating some instances of `Future`, which does require an event loop to be present for the current thread. If this is done multiple times for a resource, it's possible that `deserialize_properties` will be called on an asyncio thread that doesn't yet have an event loop, resulting in the error being raised.

The error does not occur when only passing the resource reference once because typically the thread (e.g. `asyncio_0`) used in that case will have already had an event loop created for it due to the use of the internal `_syncawait` when _serializing_ the source resource's properties, which ensures an event loop is set for the thread.

The fix is to ensure an event loop is created for the thread in the mocks implementation before calling `deserialize_properties`.
2021-03-09 13:48:24 -08:00
Paul Stack
20e84dfe9e
Upgrading Go to 1.16.x (#6470) 2021-03-09 20:05:23 +00:00
Komal
48bc267445
[automation/python] - Add missing options to preview and up (#6450) 2021-03-02 10:53:39 -08:00
Komal
4a59900920
Enable python automation API tests on Windows (#6424) 2021-02-24 17:28:23 -08:00
Komal
24e07ab507
[automation/python] - Use TemporaryFile and seek() (#6421) 2021-02-24 17:21:24 -08:00
Mike Chen
256e8284d0
[automation] - Add diff to up and preview in automation API (#6413)
Co-authored-by: Mike Chen <mikechen@ip-192-168-1-8.ec2.internal>
2021-02-23 17:38:28 -08:00
Komal
8b665f7131
[automation] - Remove summary from PreviewResult (#6405) 2021-02-23 17:07:16 -08:00
Komal
5f4e687a1d
[automation] - Consume config set-all and rm-all commands (#6388) 2021-02-19 22:59:18 -08:00
Komal
ca5ab18f6d
[sdk/python] - Allow Output.all with no inputs (#6381) 2021-02-18 10:11:13 -08:00
Komal
a6b6437b49
[Automation] Fix python nested config parsing (#6349) 2021-02-17 10:16:35 -08:00
Komal
b6f548a599
[sdk/python] - Define __all__ for better autocomplete. (#6351) 2021-02-17 09:09:10 -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
Komal
1a9050eaa6
[sdk/python] - Allow kwargs in Output.all() to create a dict (#6269) 2021-02-11 08:52:46 -07: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
Evan Boyle
eefc104c2b
Add --limit flag to pulumi stack history and consume from automation api (#6257)
Adds a `--limit` flag to `pulumi stack history. This allows limiting to the last few entries rather than fetching the entirety of a stack's update history (which can be quite slow for stacks with lots of updates). Example: `pulumi stack history --limit 1` fetches the last history entry only. 

`stack.up` and related operations in the Automation API have been updated to consume this change, drastically reducing overhead.
2021-02-08 10:49:57 -08:00
Komal
f374b8a953
[python/sdk] - Correctly handle outputs with properties named "values" (#6264)
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-02-05 17:16:13 -07:00
Komal
3a3b96de72
[sdk/python] - Gracefully handle monitor shutdown (#6249) 2021-02-04 20:28:39 -07:00
Justin Van Patten
2779de38ea
[sdk/python] from_input: Unwrap nested outputs in input types (#6221)
`Output.from_input` deeply unwraps nested output values in dicts and lists, but doesn't currently do that for the more recently added "input types" (i.e. args classes). This leads to errors when using args classes with output values with `Provider` resources, which uses `Output.from_input` on each input property and then serializes the value to JSON in an `apply`. This changes fixes `Output.from_input` to recurse into values within args classes to properly unwrap any nested outputs.
2021-01-29 15:44:00 -08:00
Komal
216fd2bed5
Fix the rendering of ResourceOptions.merge (#6206) 2021-01-26 15:44:12 -07:00
Komal
0f06e03931
Docstring fixups (#6194) 2021-01-25 12:22:17 -07:00
Komal
51521bbe73
Improve automation-api docs (#6178) 2021-01-22 15:12:41 -07:00
Vivek Lakshmanan
68b655bba6 Test fixes for other languages due to change in schema. 2021-01-20 11:29:01 -08:00
Paul Stack
1cff1a4bcf
[sdk/python] Adding pulumi.unsecret and pulumi.is_secret (#6111) 2021-01-14 20:37:05 +00:00
Komal
dd66d8d2ab
Remove annotations import (#6109) 2021-01-14 12:36:11 -08:00
Komal
89b1d0d2c7
[automation-api/python] - Support recovery workflow (#6037) 2021-01-12 19:27:21 -08:00