Commit graph

4005 commits

Author SHA1 Message Date
Pat Gavlin 3d35eebb58
Fix another colorizer bug. (#3417)
If a maximum length was specified and the string did not end in a
colorization directive, the maximum length was not respected.

Fixes #3374.
2019-10-29 10:55:30 -07:00
CyrusNajmabadi 9f5f12c766
Simplify dotnet resource options (#3411) 2019-10-28 14:01:36 -07:00
CyrusNajmabadi fcc57f2e0f
Fix crash when specifying update-target that doesn't exist. (#3408) 2019-10-28 11:41:43 -07:00
CyrusNajmabadi fd3b64dae8
Simplify Output.apply greatly (#3353) 2019-10-28 11:39:52 -07:00
CyrusNajmabadi df12fa7574
Don't read a resource if the Id we got was null or empty. (#3410) 2019-10-27 00:06:16 -07:00
CyrusNajmabadi a343bb015f
Fix null argument in reads (#3409) 2019-10-26 14:17:42 -07:00
CyrusNajmabadi 394c91d7f6
Add **preview** .NET Core support for pulumi. (#3399) 2019-10-25 16:59:50 -07:00
Chris Smith 602232ec27
Fix panic in stack select (#3407) 2019-10-25 15:18:28 -07:00
Chris Smith d2805fcb3f
Add support for aggregate resource analysis (#3366)
* Add AnalyzeStack method to Analyze service

* Protobuf generated code

* Hook up AnalyzeStack method

* Address PR feedback

* Address PR feedback
2019-10-25 08:29:02 -07:00
Pat Gavlin 06d4dde889 Update the CHANGELOG for v1.4.0 2019-10-24 10:11:44 -07:00
Alex Clemmer a54fd5149a Temporarily disable localbackend-based query tests 2019-10-23 15:14:56 -07:00
Alex Clemmer ae6cd64dc8 Factor queryResmon to share more code with resmon 2019-10-23 15:14:56 -07:00
Alex Clemmer 628abb5636 Fix bug causing pulumi query to hang forever
`engine.Query` queues up a bunch of `defer` functions that (among other
things) wait for various resources to clean themselves up.

In `query`, we have a "naive" (read: bad) `eventEmitter`, whose `done`
channel is set to `nil`. Therefore, the relevent `defer` waits for an
event on a `nil` channel which in Go will famously simply hang forever.

This commit will correct this by setting this channel appropriately, so
that it signals appropriately when it's done.
2019-10-23 15:14:56 -07:00
Alex Clemmer 34093b1361 Allow provider loading in query mode
This commit will introduce the ability to load providers in `query`
mode.

Previously, `query` mode has been effectively a stand-alone execution
environment for language hosts, running without (e.g.) the
`StepExecutor` and similar engine facilities, but with some minimal
constructs hooked up, notably the ability to retrieve stack snapshots
from the backend for querying.

This commit extends this functionality somewhat by allowing `query` to
load Pulumi resource providers, and to run `Invoke` on them. This will
allow us, in the future, to "query" resource providers in the same way
we can query stack snapshots.
2019-10-23 15:14:56 -07:00
Alex Clemmer 91f50eeb51 Report pulumi query as not supporting secrets 2019-10-23 15:14:56 -07:00
Alex Clemmer 9c16485152 Don't require a stack to run pulumi query 2019-10-23 15:14:56 -07:00
Matthieu Leclercq 877861eb7e Export GOOGLE_APPLICATION_CREDENTIALS when google credential are given (#3379)
Allows to use that credential when the stack uses Google KMS encryption
provider.
2019-10-23 13:38:00 -07:00
CyrusNajmabadi d88944b268
Fix issue where we tore down our sync-rpc channels in expected recoverable scenarios. (#3387) 2019-10-22 14:13:07 -07:00
David McKay d9f363ea72 fix: ensure plugins are available before Pulumi command (#3228)
This patch ensures, if `package.json` exists, that `npm install` is
always run prior to any pulumi command. This will trigger any scripts
that install plugins; ensuring most CI systems can build Pulumi projects
without hacky workarounds.
2019-10-22 08:11:37 -07:00
Pat Gavlin f14eba46b5
Add a URN validation method. (#3386)
This method can be used to check whether or not a URN is well-formed.
This is used by the provider reference parser to avoid panicking on
malformed URNs.
2019-10-21 19:09:39 -07:00
Pat Gavlin 76a0079641
Fix two colorization issues. (#3385)
- The length of the text content (i.e. the content of a colorized string
  that is not control sequences) was not being correctly tracked. This
  caused the "status" column of the progress display to overflow.
- Colorization was unconditionally disabled on Windows. When we were
  using loreley, we had set the global colorization flag s.t.
  colorization on Windows _should_ have been disabled, but we overrode
  this flag each time we actually colorized anything.

Fixes #3378.
2019-10-21 16:05:45 -07:00
Ryan Campbell 665b4caa89 Update python FileAsset to accept os.PathLike in addition to str. (#3368)
This should fix #2896.
2019-10-18 14:31:59 -07:00
Pat Gavlin fa20d88e12 Update the CHANGELOG for 1.3.4 2019-10-18 13:47:35 -07:00
CyrusNajmabadi da1f27d3ab Remove errant console logging. (#3376) 2019-10-18 13:02:53 -07:00
CyrusNajmabadi 9f00e95e87
Remove unnecessary casts (#3367) 2019-10-17 17:12:45 -07:00
Pat Gavlin 1ae6629d81 Prepare the CHANGELOG for v1.3.3 2019-10-17 15:10:30 -07:00
Pat Gavlin d84e5340c2
Fix a bug in the Brew version check. (#3360)
It is not a fatal error for the brew version check to fail. In this
case, just use the values returned by the service.
2019-10-16 19:18:04 -07:00
CyrusNajmabadi b1f20115cf
Properly handle providers with unknown Ids (#3357) 2019-10-16 15:19:43 -07:00
Paul Stack 795f141311
Update t.Error to t.FailNow (#3354) 2019-10-16 22:39:37 +03:00
CyrusNajmabadi 8272a48447
Update changelist. 2019-10-16 11:58:11 -07:00
Justin Van Patten 95f85a7f28
Load PulumiPolicy.yaml instead of Pulumi.yaml during installation (#3352) 2019-10-16 11:23:50 -07:00
Pat Gavlin 730fe8617e
Buffer events. (#3332)
This avoids unnecessary blocking inside pre/post-step callbacks if the
reader on the other side of the event channel is slow.

We do not use a buffered channel in the event pipe because it is
empirically less likely that the goroutine reading from a buffered
channel will be scheduled when new data is placed in the channel. In the
case of our event system in which events will not be delivered to the
service and display until the copying goroutine is scheduled, this can
lead to unacceptable delay between the send of the original event and
its output.
2019-10-15 15:47:40 -07:00
Pat Gavlin 460ff875ab
Cache account information. (#3340)
- Cache the username and last verified time associated with each logged-in
  backend
- In the HTTP backend, verify the access token explicitly at most once
  per hour

This trades off a little bit of usability for improved inner-loop
latency: if a user's API token becomes invalid less than an hour after
it was last verified, the user will see 4xx errors when attempting stack
operations rather than seeing the login prompt.
2019-10-15 15:37:57 -07:00
CyrusNajmabadi d72872c49a
Fix error message (#3344) 2019-10-15 13:29:32 -07:00
CyrusNajmabadi 91addf2feb
New approach to move us to using deasync as little as possible (and with as little impact to users as possible). (#3325) 2019-10-14 22:08:06 -07:00
Luke Hoban 893e51d0ce
Add Python resource transformations support (#3319)
Adds Python support for resource transformations aligned with the existing NodeJS support in #3174.

This PR also moves processing of transformations to earlier in the resource construction process (for both NodeJS and Python) to ensure that invariants established in the constructor cannot be violated by transformations. This change can technically be a breaking change, but given that (a) the transformations features was just released in 1.3.0 and (b) the cases where this is a breaking change are uncommon and unlikely to have been reliable anyway - it feels like a change we should make now.

Fixes #3283.
2019-10-14 19:35:00 -05:00
Pat Gavlin 14da941b0c
Standardize on Stack for backend methods. (#3336)
The current pattern of using backend.Stack values in the CLI but
accepting backend.StackReference values in backend methods leads to
frequent transitions between these types. In the case of the HTTP
backend, the transition from a StackReference to a Stack requires an API
call. These changes refactor the backend.Backend API such that most of
its methods accept backend.Stack values in place of
backend.StackReference values, which avoids these transitions.

This removes two calls to the getStack API on the startup path of a
`pulumi preview`.
2019-10-14 14:30:42 -07:00
Paul Stack 756534865e
appveyor: Bump go version to 1.12.9 for builds to match travis (#3312) 2019-10-14 21:33:30 +03:00
Pat Gavlin d18b59e9c6
Fix a dependency graph bug during DBR. (#3329)
The dependency graph used to determine the set of resources that
depend on a resource being DBR'd is constructured from the list of
resource states present in the old snapshot. However, the dependencies
of resources that are present in both the old snapshot and the current
plan can be different, which in turn can cause the engine to make
incorrect decisions during DBR with respect to which resources need to
be replaced. For example, consider the following program:

```
var resA = new Resource("a", {dbr: "foo"});
var resB = new Resource("b", {dbr: resA.prop});
```

If this program is then changed to:
```
var resB = new Resource("b", {dbr: "<literal value of resA.prop>"});
var resA = new Resource("a", {dbr: "bar"});
```

The engine will first decide to make no changes to "b", as its input
property values have not changed. "b" has changed, however, such that it
no longer has a dependency on "a".

The engine will then decide to DBR "a". In the process, it will
determine that it first needs to delete "b", because the state for "b"
that is used when calculating "a"'s dependents does not reflect the
changes made during the plan.

To fix this issue, we rely on the observation that dependents can only
have been _removed_ from the base dependency graph: for a dependent to
have been added, it would have had to have been registered prior to the
root--a resource it depends on--which is not a valid operation. This
means that any resources that depend on the root must not yet have
been registered, which in turn implies that resources that have already
been registered must not depend on the root. Thus, we ignore these
resources if they are encountered while walking the old dependency graph
to determine the set of dependents.
2019-10-12 17:22:13 -07:00
Pat Gavlin 2c67288189
Stop using loreley. (#3331)
Loreley's approach to colorization via Go templates has significant
overhead when colorization is used extensively.

Also, stop parsing colorized text with regexes and use the actual
parser.
2019-10-12 13:53:57 -07:00
Paul Stack a30d66557e
Examples: Change the examples to run as individual tests (#3328) 2019-10-12 20:07:08 +03:00
Pat Gavlin 97803a6591 Prepare the CHANGELOG for 1.3.1. 2019-10-10 10:33:50 -07:00
Pat Gavlin 834e583c95
Revert "Propagate inputs to outputs during preview. (#3245)" (#3324)
This reverts commit 80504bf0bc.
2019-10-10 10:33:05 -07:00
Alex Clemmer 5e1c4d31c6 Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00
CyrusNajmabadi 1574f6f9c2
Enable some tests that weren't actually running (#3320) 2019-10-09 20:16:16 -07:00
Chris Smith bec608d0d3
Improve error message when using PAC on out-of-date SDK (#3307)
* Fix lint warnings

* Improve error message when using PAC on old SDK

* Update pkg/resource/plugin/analyzer_plugin.go

Co-Authored-By: Justin Van Patten <jvp@justinvp.com>
2019-10-09 13:51:10 -07:00
Chris Smith 0e52e965db
Add local policy packs to summary event (#3308) 2019-10-09 13:50:28 -07:00
Pat Gavlin 7778d7ae84 Prepare the CHANGELOG for 1.3.0. 2019-10-09 11:50:21 -07:00
Ken Fukuyama 0700e6fa05 Fix invalid bullet points in stack init (#3303)
This fixes the issue where the bullet points aren't rendered correctly
by hugo.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2019-10-08 15:07:03 -07:00
Mikhail Shilkov 69743fe2bf Make the path to .pulumi folder configurable with an ENV variable (#3300)
Introduces `PULUMI_HOME` environment variable which points to a path to the path to `.pulumi` folder. Defaults to `<user's home dir> + ".pulumi"` if not specified.

Fixes #2966. In addition to plugins, it "moves" the credentials file, templates, workspaces.

`bin` folder is intact: to move it, we need to adjust all installation scripts to respect `PULUMI_HOME` and put executables in the proper `bin` folder.
2019-10-08 15:01:46 -07:00