Commit graph

2562 commits

Author SHA1 Message Date
Paul Stack a42bafcf5c
Ensure the CLI doesn't panic when trying to build a graph for a stack with no snapshot (#5678)
Fixes: #4952
2020-11-04 17:33:39 +00:00
Lee Briggs 4d96994fd1
switch uuid packages (#5608)
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-11-04 03:13:04 +00:00
Paul Stack 056c82cd09
Ensure CLI doesn't panic when using pulumi watch and ComponentResources (#5675) 2020-11-04 01:14:43 +00:00
Pat Gavlin 696cff10ec
Add engine support for getResource. (#5646)
The langauge SDKs will use this function to fetch the state required to
deserialize a resource reference. SDK support will be added as a follow-up
change.

Contributes to #2430.
2020-11-02 13:36:12 -08:00
Levi Blackstone 5188ec4c9f
[codegen/schema] Add support for external schema refs (#5606) 2020-10-29 17:41:12 -06:00
Mikhail Shilkov 5cef84f036
Read .NET plugin name from version.txt (#5629) 2020-10-28 15:53:29 +01:00
Pat Gavlin 3d2e31289a
Add support for serialized resource references. (#5041)
Resources are serialized as their URN, ID, and package version. Each
Pulumi package is expected to register itself with the SDK. The package
will be invoked to construct appropriate instances of rehydrated
resources. Packages are distinguished by their name and their version.

This is the foundation of cross-process resources.

Related to #2430.

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
Co-authored-by: Luke Hoban <luke@pulumi.com>
Co-authored-by: Levi Blackstone <levi@pulumi.com>
2020-10-27 10:12:12 -07:00
Paul Stack 83f2aa613b
Adding the Venafi provider to the docs generation (#5620) 2020-10-23 20:25:37 +01:00
Paul Stack b75ca2602f
Ensure policy events do not cause a panic when using preview --json (#5610) 2020-10-22 20:28:39 +01:00
Komal ec9c02f578
Add tests for ts enums (#5605) 2020-10-22 10:53:29 -07:00
Paul Stack 7f0bc891c4
Ensure CLI doesn't panic when pulumi watch is used with policies enabled (#5569)
Fixes: #5561
2020-10-17 21:29:16 +01:00
Pat Gavlin eaac9280f5
Refactor lifecycle tests. (#5575)
Move these tests to a new package, `lifecycletest`, that also exposes
APIs that allow consumers to implement their own lifecycle tests. This
is intended to ease the burden of testing plugin implementations and to
set the stage for cleaning up the lifecycle tests themselves.

This involves two changes to the public API, only one of which is
strictly necessary:

- The `host` field of `UpdateOptions` is now exported
- The `Journal` type has been moved from test-only code to the package
  proper

The former change is necessary, as it is the mechanism by which package
consumers may inject their own plugin loaders. I was reluctant to expose
this field originally because I wanted to ensure that the behavior of
packages that embed Pulumi is consistent with that of the Pulumi CLI
with respect to plugin loading. I now believe that the risk of consumers
changing this behavior outside of test scenarios is low enough that we
can expose this field. This may also be useful for future scenarios,
e.g. statically linking providers and Pulumi programs.

The latter change is not necessary, but fleshes out the engine package
into a more complete toolkit. Downstream consumers may use the Journal
type to conveniently implement snapshotting.
2020-10-15 10:35:09 -07:00
Pat Gavlin 89c71bb49e
[cli] Add an import command. (#4765)
Co-authored-by: stack72 <public@paulstack.co.uk>
2020-10-14 12:51:53 +01:00
Levi Blackstone 99ba1ab943
[codegen/dotnet] Add support for ResourceType and isComponent (#5460) 2020-10-13 12:33:22 -06:00
Paul Stack 186e2f059e
Respect logging verbosity as part of pulumi plugin install (#5549)
Fixes: #4427

By default, there is no indepth logging:

```
pulumi plugin install resource azure-nextgen v0.2.1
[resource plugin azure-nextgen-0.2.1] installing
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 2s
Moving plugin... done.
```

We can increase the logging verosity get more detailed logging:
```
pulumi plugin install resource azure-nextgen v0.2.1 -v=1 --logtostderr
[resource plugin azure-nextgen-0.2.1] installing
I1010 19:30:58.472772    7128 plugins.go:201] azure-nextgen downloading from https://get.pulumi.com/releases/plugins
Downloading plugin: 0 B / 17.82 MiB [----------------------------------]   0.00%I1010 19:30:58.704168    7128 plugin_install.go:136] [resource plugin azure-nextgen-0.2.1] installing tarball ...
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 3s
Moving plugin...I1010 19:31:01.874427    7128 plugins.go:304] moving plugin from "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1.tmp884796935" to "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1"
 done.
```

The most verbose logging level will log the request and response headers
```
pulumi plugin install resource azure-nextgen v0.2.1 -v=9 --logtostderr
I1010 19:29:46.989150    7089 sink.go:146] defaultSink::Infoerr([resource plugin azure-nextgen-0.2.1] installing)
[resource plugin azure-nextgen-0.2.1] installing
I1010 19:29:46.989295    7089 plugins.go:591] SelectCompatiblePlugin(..., azure-nextgen): beginning
I1010 19:29:46.989300    7089 plugins.go:630] SelectCompatiblePlugin(..., azure-nextgen): failed to find match
I1010 19:29:46.989323    7089 plugins.go:201] azure-nextgen downloading from https://get.pulumi.com/releases/plugins
I1010 19:29:46.989333    7089 plugins.go:208] full plugin download url: https://get.pulumi.com/releases/plugins/pulumi-resource-azure-nextgen-v0.2.1-darwin-amd64.tar.gz
I1010 19:29:46.989360    7089 plugins.go:218] plugin install request headers: map[User-Agent:[pulumi-cli/1 (; darwin)]]
I1010 19:29:47.242941    7089 plugins.go:225] plugin install response headers: map[Accept-Ranges:[bytes] Age:[370098] Content-Disposition:[attachment; filename=pulumi-resource-azure-nextgen-v0.2.1-darwin-amd64.tar.gz] Content-Length:[18684382] Content-Type:[application/x-gzip] Date:[Tue, 06 Oct 2020 11:41:30 GMT] Etag:["518f2e7efd46fe5b7be9508dc785b9c9-4"] Last-Modified:[Sat, 03 Oct 2020 20:57:45 GMT] Server:[AmazonS3] Via:[1.1 198b7d1bb217783eef010e6636984c9f.cloudfront.net (CloudFront)] X-Amz-Cf-Id:[aaC3Q0WcecspsFbWROLxXnD6iF7sYoAfShQKYiS2xkFKAWlFRBu-1Q==] X-Amz-Cf-Pop:[MAN50-C2] X-Cache:[Hit from cloudfront]]
Downloading plugin: 0 B / 17.82 MiB [----------------------------------]   0.00%I1010 19:29:47.243189    7089 plugin_install.go:136] [resource plugin azure-nextgen-0.2.1] installing tarball ...
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 2s
Moving plugin...I1010 19:29:50.031099    7089 plugins.go:304] moving plugin from "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1.tmp960784076" to "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1"
 done.
```
2020-10-13 13:09:29 +01:00
Paul Stack 095da7084c
Accept -f as a shorthand for --skip-preview on up, refresh and destroy operations (#5556)
Fixes: #2321
2020-10-13 11:10:59 +01:00
Paul Stack 38152ba6f0
Improve user message when pulumi plugin rm --all has no plugins to remove (#5547)
Fixes: #5376

```                                                                                                                                                                                          ⍉
pulumi plugin rm --all --yes
no plugins found to uninstall
echo $?
0
```
2020-10-12 18:31:55 +01:00
Paul Stack df9c9f195f
Validate and error on invalid cloudUrl formats on pulumi login (#5550)
Fixes: #3382

```
▶ pulumi login --cloud-url az://myblob
error: unknown backend cloudUrl format 'az' (supported Url formats are: azblob://, gs:// and s3://)
```
2020-10-12 17:35:22 +01:00
Paul Stack 64577f5b10
Protect against panic in finding go executable and finding resources (#5548)
Fixes: #5131
Fixes: #5016
2020-10-11 07:13:54 +01:00
Komal af9f636eef
Split schema tests by language (#5540) 2020-10-10 13:47:23 -07:00
Paul Stack 36db22d488
Ensure secret provider variables are cleaned up when changing secret providers (#5545)
Fixes: #5509

When changing from a passphrase provider to a cloud secrets provider,
the encryptionsalt is not required, so we should ensure this is removed
2020-10-10 19:04:07 +01:00
Pat Gavlin 249140242e
Add support for provider-side preview. (#5443)
These changes add support for provider-side previews of create and
update operations, which allows resource providers to supply output
property values for resources that are being created or updated during a
preview.

If a plugin supports provider-side preview, its create/update methods
will be invoked during previews with the `preview` property set to true.
It is the responsibility of the provider to fill in any output
properties that are known before returning. It is a best practice for
providers to only fill in property values that are guaranteed to be
identical if the preview were instead an update (i.e. only those output
properties whose values can be conclusively determined without
actually performing the create/update operation should be populated).
Providers that support previews must accept unknown values in their
create and update methods.

If a plugin does not support provider-side preview, the inputs to a
create or update operation will be propagated to the outputs as they are
today.

Fixes #4992.
2020-10-09 13:13:55 -07:00
Paul Stack 5430586a9e
Upgrade to Go v1.15.x (#5467) 2020-10-09 17:35:12 +01:00
Komal 6c51e6ce1c
[codegen/nodejs] - Update enum generation (#5525) 2020-10-09 08:27:01 -07:00
Lee Briggs 7093565e2c
jaxxstorm/build fixes (#5483)
* fix pulumi bot token and env var

* use commit hash non-marketplace actions

* fix goreleaser binaries

foo

* fix goreleaser archive format

* update workflows to use repo-dispatch

* fixing tag naming

* add support for beta tags

* add prerelease workflow

* remove windows builds

* only use travis for tags

* remove prerelease steps

* fix container build indentation

* check the policy tempdir exists
2020-10-08 12:43:38 -07:00
Vivek Lakshmanan 08272ff49a
Merge pull request #5520 from pulumi/vl/dotnetProgramGen
Fix config params and default handling for .NET programgen
2020-10-08 00:30:11 -07:00
Komal 7039e67284
[codegen/nodejs] - Enums (#5472) 2020-10-07 18:13:10 -07:00
Paul Stack 5e8f219652
Reorder resource docs templates to make deprecated more prominent (#5523)
Fixes: https://github.com/pulumi/docs/issues/4340

The deprecated message sits below the examples so it is not clear
to the user that the resource / datasource is deprecated
2020-10-07 21:25:25 +01:00
Vivek Lakshmanan a0ee220243 Convert config params to outputs only if promise types are seen 2020-10-07 12:29:33 -07:00
Vivek Lakshmanan f4235f27a1 Fix config params and default handling for .NET programgen
Fixes https://github.com/pulumi/pulumi-azure-nextgen/issues/42
2020-10-07 09:59:23 -07:00
Komal b531038d33
[codegen/schema] - Add deprecation messages for enum values (#5521) 2020-10-07 09:32:00 -07:00
Vivek Lakshmanan 2b67c6ea81
Merge pull request #5514 from pulumi/vl/AddGoConfigGen
[codegen] Add support for config generation in go programgen
2020-10-06 16:54:41 -07:00
Vivek Lakshmanan e49ba01f8f PR comments 2020-10-06 16:13:49 -07:00
Vivek Lakshmanan ea75755d88 Add test scaffolding for azure provider 2020-10-06 16:13:30 -07:00
Vivek Lakshmanan 8f7874b3e2 Handle aliases correctly for invokes 2020-10-05 22:57:00 -07:00
Vivek Lakshmanan 739b664046 Add support for go config generation 2020-10-05 22:55:41 -07:00
Luke Hoban 32f13fabfa Merge branch 'fix_gzip_compression' of https://github.com/birdypme/pulumi into birdypme-fix_gzip_compression 2020-10-05 13:52:23 -07:00
Joe Duffy 12e5e46c73
Handle blank project names in 'new' (#5504)
The logic for validating prompted values in 'new' wasn't quite right,
leading to the possibility of creating Pulumi.yaml files with blank
project names.

This manifests in various ways and I've hit it a number of times
over the past few months because of the way we handle project/stack
name conflicts in 'new' -- which itself is a bit annoying too:

https://github.com/pulumi/pulumi/blob/master/pkg/cmd/pulumi/new.go#L206-L207

Because we substitue a default value of "", and because the prompting
logic assumed default values are always valid, we would skip validation
and therefore accept a blank Pulumi.yaml file.

This generates an invalid project which causes errors elsewhere, such as

    error: failed to load Pulumi project located at ".../Pulumi.yaml":
        project is missing a 'name' attribute

I hit this all the time with our getting started guide because I've
gone through it so many times and have leftover stacks from prior
run-throughs. I wouldn't be surprised if a lot of people hit this.

The solution here validates all values, including the default.

Note also that we failed to validate the value used by 'new --yes'
which meant you could bypass all validation by passing --yes, leading
to similar outcomes.

I've added a couple new tests for these cases. There is a risk we
depend on illegal default values somewhere which will now be rejected,
but that would seem strange, and assuming the tests pass, I would
assume that's not true. Let me know if that's wrong.

Fixes pulumi/pulumi#3255.
2020-10-05 13:40:24 -07:00
Mikhail Shilkov 98f04cd2fc
Ensure top-level precedence to avoid flaky tests (#5508) 2020-10-05 19:50:51 +02:00
Mikhail Shilkov 3a2d7356a2
Quit if a static passphrase is invalid (#5507) 2020-10-05 14:57:48 +01:00
Luke Hoban 3be1ea9592
Fix panic with logs (#5503)
Fixes #5112.
2020-10-02 14:09:34 -07:00
Julien Champseix f2b75b1e5f Merge branch 'master' into fix_gzip_compression 2020-10-01 09:22:12 +02:00
Julien Champseix f9eae8b8e9 Merge branch 'master' of https://github.com/pulumi/pulumi 2020-10-01 09:17:14 +02:00
Julien Champseix 3df5d55256 removed superfluous Flush() 2020-10-01 09:07:30 +02:00
Justin Van Patten 9bcf02e7ed
Support remote components in Python (#5375) 2020-09-30 14:09:20 -07:00
Julien Champseix 88c556d2fe restored contract.IgnoreClose on gzip reader, but only when pointer is valid 2020-09-30 22:57:09 +02:00
Levi Blackstone 38172999e7
[codegen] Extract common test logic (#5480) 2020-09-30 14:41:52 -06:00
Julien Champseix 370125868d Merge branch 'master' of github.com:birdypme/pulumi 2020-09-30 22:31:36 +02:00
Julien Champseix bcac6cf1d7 only close the gzip reader if a valid pointer was returned 2020-09-30 21:52:35 +02:00
Levi Blackstone 64602798b1
[codegen/python] Don't generate get methods for ComponentResources (#5459) 2020-09-30 10:16:25 -06:00