Commit graph

3283 commits

Author SHA1 Message Date
Chris Smith 3045236dec
Record engine events concurrently (#2314)
* Record engine events concurrently

* Drop errors recording engine events
2018-12-20 15:34:30 -08:00
CyrusNajmabadi c3c51e6ea7
Don't record reads as changes during updates unless something actually changed. (#2308) 2018-12-19 13:19:56 -08:00
CyrusNajmabadi f7e6368218
During preview, don't record reads if they didn't actually result in any property changes. (#2305) 2018-12-18 16:33:13 -08:00
Pat Gavlin 24f89e1121
Close plugin context on plan creation failure (#2304)
This ensures that the gRPC server is properly shut down. This fixes an
issue in which a resource plugin that is still configuring could report
log messages to the plugin host, which would in turn attempt to send
diagnostic packets over a closed channel, causing a panic.

Fixes #2170.
2018-12-18 13:25:52 -08:00
Sean Gillespie 81c0de1e4e
Add 'Output.all' combinator for Python (#2293)
* Add 'Output.all' combinator for Python

Output.all is a useful combinator that we already have in Node that
allows the composition of a list of outputs into an output of a list.
This is very useful when authoring components and its lack of presence
in Python was an oversight.

This commit adds 'Output.all' and 'Output.from_input', adding tests and
documentation for each.

* start unwrap

* Add functionality and test for nested inputs
2018-12-18 13:22:04 -08:00
CyrusNajmabadi e86ea70ea0
Force rebuild of htis package to wipe out previously published 'dev' package. (#2300) 2018-12-17 16:00:31 -08:00
Matt Ellis d6a8fd6189
Merge pull request #2294 from pulumi/ellismg/merge-v-0-16-8-to-master
Merge v0.16.8 into master
2018-12-17 10:59:55 -08:00
CyrusNajmabadi 7e7544e27e
Revert https://github.com/pulumi/pulumi/pull/2281 (#2297) 2018-12-15 21:04:53 -08:00
CyrusNajmabadi 2d92b516b2
Do not pass component resource properties to the engine. (#2296) 2018-12-15 15:32:19 -08:00
Matt Ellis b03c48e852 Merge v0.16.8 into master 2018-12-14 15:32:48 -08:00
Matt Ellis d2bd696d15 Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.

(cherry picked from commit ded3882afd)
2018-12-14 14:19:01 -08:00
Pat Gavlin ded3882afd
Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.
2018-12-13 19:58:26 -08:00
Matt Ellis 89f862e74e Update webhook notification endpoint
The app for our build notification was re-deployed an its URL changed. This adopts the new endpoint
2018-12-12 13:24:52 -08:00
CyrusNajmabadi b94cfb22d5
Handle cycles in component resources more simply. (#2283) 2018-12-11 13:42:49 -08:00
CyrusNajmabadi 05f5311055
Prevent cycles when serializing props. (#2281) 2018-12-10 14:31:54 -08:00
Matt Ellis 59a54f1802
Add --stack argument to a few missing commands (#2278)
As of this change, all of the stack specific commands for `pulumi` now
allow passing `--stack` to operate on a different stack from the
default one.

Fixes #1648
2018-12-10 10:10:43 -08:00
Matt Ellis ad78f3ef59 Improve error message when Pulumi.yaml can't be found
Fixes #2234
2018-12-06 14:04:01 -08:00
Matt Ellis 7b74f3b1be Update CHANGELOG.md for v0.16.7 2018-12-05 14:32:32 -08:00
Matt Ellis d7575072f2 Do not use relative path when launching dynamic provider
Previously, we assumed that the dynamic provider was located in
`./node_modules/@pulumi/pulumi/../` which is correct in the majority
of cases. However, tools like lerna or yarn workspaces (or custom
workflows) allow the node_modules folder to be located elsewhere on
disk, and node will still find it because of its algorithm for module
resolution.

So, do what we do in the language host itself, first launch node and
ask it to tell us where it resolves a require statement to on disk and
then launch node against that script.

Fixes #2261
2018-12-05 13:45:06 -08:00
Pat Gavlin 663e5342b0
Inherit custom resource providers (#2264)
If a custom resource has explicitly specified a provider, add that
provider to the resource's provider map under the resource's package.
This allows children of the custom resource to inherit the resource's
provider.

Fixes #2262.
2018-12-05 12:35:19 -08:00
Matt Ellis 01d58ad7e4 Fix +dirty tag on Windows for tagged versions
The logic to append the `+dirty` tag to a generated version on Windows
was incorrect in the case where we were producing a version for a
tagged build. In that case we would append `+dirty` when the work tree
was clean and not append it when it was dirty.
2018-12-05 11:11:43 -08:00
Matt Ellis bb1fa36a47
Enable ANSI colorization in Windows terminal (#2269)
Before the windows console will understand ANSI colorization codes the
terminal must be put in a special mode by passing
ENABLE_VIRTUAL_TERMINAL_PROCESSING to SetConsoleMode. This was
happening as a side effect of term.StdStreams() from a docker package,
which we did before displaying the update data. However, any
colorization done before that call would just show the raw ANSI escape
codes.

Call this helper much earlier (i.e. as soon as the CLI starts up) so
any messages that we print will have the correct colorization applied
to them.

Fixes #2214
2018-12-04 16:58:32 -08:00
Chris Smith 84ea2f0df7
Don't emit pre-rendered update logs (#2268)
* Don't emit pre-rendered update logs

* Retry posting engine events if needed

* Update comment
2018-12-04 14:46:32 -08:00
Matt Ellis f3fbc1d9ee Do not disable echo when stdin is not a terminal
When reading values like access keys or secrets from the terminal, we
would use the `terminal.ReadPassword` function to ensure characters
the user typed were not echo'd back to the console, as a convience.

When standard input was not connected to a tty (which would happen in
some cases like in docker when -t was not passed or in CI), this would
fail with an error about an bad ioctl. Update our logic such that
when standard in is not connected to a terminal, we just read input
normally.

While I was in the area, I unified the code for Windows and *NIX for
these functions.

Fixes #2017
2018-12-03 16:40:51 -08:00
Luke Hoban d9f37e6667
Add Roadmap to README (#2271) 2018-12-03 16:31:49 -08:00
Chris Smith 71375fe47e
Record engine events by default (#2256) 2018-12-03 08:25:58 -08:00
CyrusNajmabadi ca8169e344
Use 'output<...>' as our terminology for 'computed' properties. (#2267) 2018-12-02 19:44:50 -08:00
CyrusNajmabadi d93e930856
Provide an actual 'table' printing routine so that we can appropriate choose columns widths dynamically. (#2266) 2018-12-02 00:22:07 -08:00
Pat Gavlin 9c5526e7dd
Add a --config-file option for stack ops (#2258)
This option allows the user to override the file used to fetch and store
configuration information for a stack. It is available for the config,
destroy, logs, preview, refresh, and up commands.

Note that this option is not persistent: if it is not specified, the
stack's default configuration will be used. If an alternate config file
is used exclusively for a stack, it must be specified to all commands
that interact with that stack.

This option can be used to share plaintext configuration across multiple
stacks. It cannot be used to share secret configuration, as secrets are
associated with a particular stack and cannot be decryptex by other
stacks.
2018-11-30 15:11:05 -08:00
Chris Smith 55bea65276
Fix error when canceling update (#2254)
* Fix error when canceling update

* Update error message
2018-11-29 12:54:05 -08:00
Pat Gavlin 95db6439f5
Add stackReference.ts to tsconfig.json (#2253)
Otherwise this file is not picked up by typedoc.
2018-11-29 10:27:29 -08:00
CyrusNajmabadi e53f746c35
Export our 'unwrap' types so that downstream packages can create combinators that TS will accept. (#2252) 2018-11-28 13:33:33 -08:00
CyrusNajmabadi af9671a4dd
Add test helper function. (#2251) 2018-11-28 11:46:10 -08:00
Pat Gavlin 3e913d2577
Update changelog (#2250)
Stamp in release info for 0.16.6.
2018-11-28 10:02:13 -08:00
Justin Van Patten 55534e9dad
Fix typo in CHANGELOG.md (#2249) 2018-11-28 08:27:28 -08:00
Chris Smith ba31c6c69a
Incorporate feedback on Engine Events API (#2235)
* Add Sequence number to EngineEvents apitype

* Fix typo

* Send Timestamp with EngineEvents
2018-11-27 07:34:44 -08:00
Matt Ellis 466f92dfb1 Minor wordsmithing in CHANGELOG.md 2018-11-26 13:34:24 -08:00
Matt Ellis 4865c1fc68 Update CHANGELOG.md
We are still building the muscle to do this per commit, so some things
had fallen through the cracks. I walked the output of `git log
v0.16.5...master` and added some small notes for improvements that we
had not documented.
2018-11-26 09:21:44 -08:00
Matt Ellis 8cbe6554f5 Only run the 0.10.0 compat test on Node 6.10.X 2018-11-25 22:02:28 -08:00
Matt Ellis e3f8726d0a Do not pass --verbose to yarn install
When the install fails, we end up printing the entire contents of
yarn's stdout to stdout. This output can often be quite long and will
cause Travis to fail in some cases.

The regular error output should be sufficent for us to diagnose any
issues we'll face.
2018-11-25 22:02:28 -08:00
Matt Ellis 872c7661e3 Provide a way to override packages during a test run
Add a new property to ProgramTestOptions, `Overrides` that allows a
test to request a different version of a package is used instead of
what would be listed in the package.json file.

This will be used by our nightly automation to run everything "at head"
2018-11-25 22:02:28 -08:00
CyrusNajmabadi 9a044ff865
make the context-param non-optional for debuggable promises. (#2242) 2018-11-24 18:57:17 -08:00
Matt Ellis e0918723ae Allow build metadata in semver for plugins
Semver allows you to attach "build metadata" to a version by appending
the version with `+` and then metadata. In #2216 we started to take
advantage of this as the place to put the git commit information,
instead of including it as part of the "version". This is more in line
with what Semver expects to be done, because git commit information
isn't orderable.

Because of this, we started to publish plugins with versions like
`v0.16.5-dev.1542649729+g07d8224`. However, our logic for discovering
plugins in the cache did an initial filtering based on folder names in
the cache and the regex did not allow a + in the "version" field.

This meant that from the point of view of the cache, the plugin was
not present. This would lead to very confusing behavior where
something like `pulumi plugin install resource azure
v0.16.5-dev.1542649729+g07d8224` would download the plugin, but
`pulumi plugin ls` would not see it and attempting to do an update
with it would fail with an error saying the plugin was not installed.

This change relaxes the regular expression to allow it to match these
sorts of paths. We still use the `semver` library to ensure that the
version we've extracted from the directory name is a valid semver.
2018-11-21 17:10:43 -08:00
Pat Gavlin ab36b1116f
Handle unconfigured plugins in Diff. (#2238)
After #2088, we began calling `Diff` on providers that are not configured
due to unknown configuration values. This hit an assertion intended to
detect exactly this scenario, which was previously unexpected.

These changes adjust `Diff` to indicate that a Diff is unavailable and
return an error message that describes why. The step generator then
interprets the diff as indicating a normal update and issues the error
message to the diagnostic stream.

Fixes #2223.
2018-11-21 16:53:29 -08:00
Sean Gillespie 1bf41cb37d
Don't attempt to install packages for Python new (#2225)
* Don't attempt to install packages for Python new

Global installation of packages is almost always not what a user will
want when running 'pulumi new'. This commit instead prints out the
commands that a user should run in order to create a new virtualenv and
install the required Pulumi packages within it.

* CR feedback
2018-11-21 15:01:57 -08:00
Matt Ellis e56cefa285 Publish SDK binaries with same filename format as NPM packages
With this change, you can now use the `dev` tag of `@pulumi/pulumi` to
get the latest version of the SDK and install it from get.pulumi.com

This is helpful for some of our internal testing.
2018-11-21 14:38:24 -08:00
Matt Ellis 72d52c6e1f Don't fail on configuration keys like a:config:b:c
Configuration keys are simple namespace/name pairs, delimited by
":". For compatability, we also allow
"<namespace>:config:<name>", but we always record the "nice" name in
`Pulumi.<stack-name>.yaml`.

While `pulumi config` and friends would block setting a key like
`a🅱️c` (where the "name" has a colon in it), it would allow
`a:config:b:c`. However, this would be recorded as `a🅱️c` in
`Pulumi.<stack-name>.yaml`, which meant we'd error when parsing the
configuration file later.

To work around this, disallow ":" in the "name" part of a
configuration key.  With this change the following all work:

```
keyName
my-project:keyName
my-project:config:keyName
```

However, both

`my-project:keyName:subKey`
`my-project:config:keyName:subKey`

are now disallowed.

I considered allowing colons in subkeys, but I think it adds more
confusion (due to the interaction with how we allow you elide the
project name in the default case) than is worthwhile at this point.

Fixes #2171
2018-11-20 14:14:37 -08:00
Matt Ellis c878916901 Look for language plugins next to pulumi when probing
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
2018-11-20 12:02:36 -08:00
CyrusNajmabadi a7d2f10eaf
Allow tests to pass additional flags when doing a preview. (#2232) 2018-11-20 02:05:24 -08:00
Matt Ellis 35215d6a07 Write .yarnrc with both test frameworks
While the lifecycle tests wrote a `.yarnrc` file to ensure that copies
of `yarn` did not race with one another, the more barebones testing
framework did not.

This should address some of the yarn issues we've been seeing in CI
recently
2018-11-19 17:12:18 -08:00