Commit graph

2662 commits

Author SHA1 Message Date
Matt Ellis 0732b05c5d Remove pulumi init
`pulumi init` was part of our old identity model with the service and
is no longer used. We can now delete this code.

Fixes #1241
2018-05-22 13:37:08 -07:00
Pat Gavlin b5efe40f04
Fold "global" messages under the stack resource. (#1406)
We currently display at most two rows for messages that are not
associated with a URN: one for those that arrive before the stack
resource is first observed and one for those that arrive after the stack
resource is first observed. The former is labeled "global"; the latter
is the row associated with the stack resource. These changes remove the
duplication by reassociating the row used for events with no URN that
arrive before the stack resource with the stack resource once it has
been observed.

Fixes #1385.
2018-05-22 13:30:52 -07:00
Pat Gavlin fe12800fb2
Merge pull request #1405 from pulumi/SupressMeaninglessRows
Only display preview/no-op resource rows once on non-TTYs.
2018-05-22 13:08:41 -07:00
Pat Gavlin c08ede339f Only display preview/no-op resource rows once on non-TTYs.
Our current strategy for the progress display on non-TTYs causes us to
display multiple identical rows for each resource when the row is a
preview or a no-op. This behavior is not particularly useful, and
generally just makes the display noisier than it needs to be.

These changes avoid displaying resource rows without meaningful output
by supressing the display of resource output events that are delivered
during a preview or that correspond to a no-op update.

Fixes #1384.
2018-05-22 11:35:07 -07:00
Joe Duffy 3c0376bb8e
Fix refresh on dynamic providers (#1393)
This changes two primary things about dynamic providers:

1) Always echo back the __provider upon read, even if there is a
   missing read function on the dynamic provider.  In fact, return
   the full input state in that case.

2) Store the __provider in the output state of the dynamic resource,
   in addition to the input state.  My recollection of the "model"
   discussion we had weeks ago was that the output properties are
   mean to capture the state of a resource in its entirety; not having
   this meant that refresh would marshal the outputs only, and find
   on the other side of the RPC boundary that __provider was missing.

Note that an alternative to the latter fix would be to use some hybrid
of input and output state, as we used to do, by merging property maps.
2018-05-20 07:42:24 -07:00
Joe Duffy df7a4ff827
Merge pull request #1387 from pulumi/nm_refresh_plugin_ctx
Don't pass PluginEvents for refresh
2018-05-18 16:50:15 -07:00
Matt Ellis d11acf5208 Pass --no-audit to npm install during pulumi new
While we wait for upstream to fix the security issue, we'll just pass
`--no-audit` to `npm install` when creating a new project. Since the
warning is against an indirect dependency of @pulumi/pulumi, we can't
actually address the issue ourselves.

Mitigates #1350
2018-05-18 15:14:10 -07:00
joeduffy 614a2cdeb3 Simplify previews, initialize plugin events
This changes two things:

1) Eliminates the fact that we had two kinds of previews in our engine.

2) Always initialize the plugin.Events, to ensure that all plugin loads
   are persisted no matter the update type (update, refresh, destroy),
   and skip initializing it when dryRun == true, since we won't save them.
2018-05-18 14:58:06 -07:00
joeduffy 4e9b228089 Don't pass PluginEvents for refresh
The PluginEvents will now try to register loaded plugins which,
during a refresh preview, will result in attempting to save mutations
when a token is missing.  This change mirrors the changes made to
destroy which avoid it panicing similarly, by simply leaving
PluginEvents unset.  Also adds a bit of tracing that was helpful to
me as I debugged through the underlying issues.

Fixes #1377.
2018-05-18 13:54:23 -07:00
joeduffy 8aca7ab11e Fix pulumi.com hyperlink in README 2018-05-18 11:22:42 -07:00
joeduffy 12a2626c59 Prepare package for public publishing
This adds a warning to the top of the README.md and adds a license
to the package.json (to eliminate the associated warning).
2018-05-18 11:21:32 -07:00
Sean Gillespie 7b7870cdaa
Remove unused stack name from deploy.Snapshot (#1386) 2018-05-18 11:15:35 -07:00
joeduffy 6470adad2a Update the README 2018-05-18 07:41:28 -07:00
Sean Gillespie 82ac202139
Improve the promise leak experience (#1374)
* Fix a bug in promise leak detection that leaked promises when errors occur

* Add an opt-in to the super-verbose debug error message on promise leaks

* Fix a bad merge

* was/were grammar improvement in error message

* Fail the deployment if a debuggable promise leaks
2018-05-17 15:32:39 -07:00
Joe Duffy a1d806321e
Enable refresh for managed stacks (#1380) 2018-05-17 11:44:39 -07:00
Sean Gillespie 68911900fd
Graceful shutdown (#1320)
* Graceful RPC shutdown: CLI side

* Handle unavailable resource monitor in language hosts

* Fix a comment

* Don't commit package-lock.json

* fix mangled pylint pragma

* Rebase against master and fix Gopkg.lock

* Code review feedback

* Fix a race between closing the callerEventsOpt channel and terminating a goroutine that writes to it

* glog -> logging
2018-05-16 15:37:34 -07:00
Pat Gavlin 009096239c
Merge pull request #1378 from pulumi/SortPropertyKeys
Sort property keys in the progress display.
2018-05-16 11:28:11 -07:00
Pat Gavlin 3cc8758b85 Sort property keys in the progress display.
This prevents the "updated keys" list from being arbitrarily reordered
upon refresh.
2018-05-16 11:10:52 -07:00
Pat Gavlin 64d90b263d
Merge pull request #1375 from pulumi/ResourceChangesFromBackend
Validate empty previews and updates in tests.
2018-05-16 10:44:48 -07:00
Pat Gavlin 52424f5d42 PR feedback. 2018-05-16 10:22:09 -07:00
Pat Gavlin 05ef4fecb9 Validate empty previews and updates in tests.
Fixes #1154.
2018-05-15 18:03:30 -07:00
Pat Gavlin 79ec574660 Add an --expect-no-changes flag to {preview, update}.
When this flag is specified, the CLI will return an error if `preview`
proposes changes or `update` performs changes.
2018-05-15 17:44:35 -07:00
Pat Gavlin e3020e820b Expose change summaries from the backend.
This is a smallish refactoring that exposes the resource change
summaries reported by the engine from the relevant backend methods.
2018-05-15 17:44:35 -07:00
CyrusNajmabadi ad086a0dbd
Add test for filters. Also, filter anything that goes through our sinks. (#1373) 2018-05-15 16:09:16 -07:00
CyrusNajmabadi 72e00810c4
Filter the logs we emit to glog so that we don't leak out secrets. (#1371) 2018-05-15 15:28:00 -07:00
Matt Ellis 387fffd740 Allow retry of REST calls during a deployment
During a deployment, we end up making a bunch of PATCH/PUT/POST style
REST requests. For these calls, it should be safe to retry the
operation if there was a hickup during our REST call, so mark them as
retryable.
2018-05-15 13:08:03 -07:00
Pat Gavlin 016ae4acba
Add pre/post-update hooks to the test framework. (#1369)
These changes add support for pre- and post-`pulumi` callbacks to the
integration test framework. These callbacks will be invoked immediately
before and after (respectively) running a `pulumi` command.
2018-05-15 09:48:56 -07:00
Joe Duffy 369c619ab9
Skip loading language plugins when not needed (#1367)
In pulumi/pulumi#1356, we observed that we can fail during a destroy
because we attempt to load the language plugin, which now eagerly looks
for the @pulumi/pulumi package.

This is also blocking ingestion of the latest engine bits into the PPC.

It turns out that for destroy (and refresh), we have no need for the
language plugin.  So, let's skip loading it when appropriate.
2018-05-14 20:32:53 -07:00
Pat Gavlin 782a869765
Add support for passing tracing headers. (#1360)
These changes add support for adding a tracing header to API requests
made to the Pulumi service. Setting the `PULUMI_TRACING_HEADER`
environment variable or enabling debug commands and passing the
`--tracing-header` will change the value sent in this header. Setting
this value to `1` will request that the service enable distributed
tracing for all requests made by a particular CLI invocation.
2018-05-14 13:44:44 -07:00
Matt Ellis 6845f9ed20 Add pulumi config refresh to fetch most recent configuration
The newly added `pulumi config refresh` updates your local copy of the
Pulumi.<stack-name>.yaml file to have the same configuration as the
most recent deployment in the cloud.

This can be used in a varirty of ways. One place we plan to use it is
in automation to clean up "leaked" stacks we have in CI. With the
changes you'll now be able to do the following:

```
$ cd $(mktemp -d)
$ echo -e "name: who-cares\nruntime: nodejs" > Pulumi.yaml
$ pulumi stack select <leaked-stack-name>
$ pulumi config refresh -f
$ pulumi destroy --force
```

Having a simpler gesture for the above is something we'll want to do
long term (we should be able to support `pulumi destory <stack-name>`
from a completely empty folder, today you need a Pulumi.yaml file
present, even if the contents don't matter).

But this gets us a little closer to where we want to be and introduces
a helpful primitive in the system.

Contributes to #814
2018-05-14 10:28:42 -07:00
Cyrus Najmabadi 84e4737a2b Merge branch 'master' of github.com:pulumi/pulumi 2018-05-12 12:43:39 -07:00
joeduffy a5d3c8e2f4 Remove macOS allow_failures directive 2018-05-12 07:09:13 -07:00
Joe Duffy 457c34ff50
Add a PULUMI_DEV flag, and suppress warnings (#1361)
This change suppresses the warning

    warning: resource plugin aws is expected to have version >=0.11.3,
        but has 0.11.1-dev-1523506162-g06ec765; the wrong version may
        be on your path, or this may be a bug in the plugin

when the PULUMI_DEV envvar is set to a truthy value.

This warning keeps popping up in demos since I'm always using dev builds
and I'd like a way to shut it off, even though this can legitimately
point out a problem.  Eventually I'll switch to official buildsa but,
until then, it seems worth having a simple way to suppress.
2018-05-11 20:59:01 -07:00
CyrusNajmabadi 3e787779e5
Fix issue where replacements were not shown in the progress view. (#1357) 2018-05-11 16:48:05 -07:00
CyrusNajmabadi 4807de038c
Capture 'exports' if referenced in user code. (#1359) 2018-05-11 16:35:41 -07:00
CyrusNajmabadi 6de1cead5a
Fix issue where we were not properly serializing out the prototype for an object. (#1352) 2018-05-11 15:53:16 -07:00
Cyrus Najmabadi 315eec0a4e Merge branch 'master' of github.com:pulumi/pulumi 2018-05-10 13:37:41 -07:00
CyrusNajmabadi e94e358ddf
Fix small logic bug when printing out messages. (#1348) 2018-05-09 14:25:03 -07:00
Pat Gavlin af0b8d943c
Merge pull request #1349 from pulumi/TracingEnhancements
Enable distributed tracing.
2018-05-09 13:39:38 -07:00
Pat Gavlin 97e38bddc8 Enable distributed tracing.
These changes add support for injecting client tracing spans into HTTP
requests to the Pulumi API. The server can then rematerialize these span
references and attach its own spans for distributed tracing.
2018-05-09 11:43:09 -07:00
Cyrus Najmabadi 1d1e966e1e Fix small logic bug when printing out messages. 2018-05-09 11:14:23 -07:00
Matt Ellis c9db62060b Fix preview against a PPC
This will unblock `pulumi preview` against a PPC, which regressed
recently (c5b702e0ff was the likely
cause).
2018-05-08 21:43:17 -07:00
Pat Gavlin 0c04770f5e
Make tokenSource.Close() synchronous. (#1345)
Without these changes, it is possible for a token renewal to race with
CLI shutdown, which appears to be the cause of #1344.

Fixes #1344.
2018-05-08 15:28:42 -07:00
Pat Gavlin bb5b7da650 Revert "Revert the changes from #1261." 2018-05-08 11:46:15 -07:00
Joe Duffy 131daae22d
Merge pull request #1341 from pulumi/git_committer_author_info
Capture Git committer and author info
2018-05-08 11:35:16 -07:00
Justin Van Patten e1edd1e88d
Make the default pulumi new project description empty (#1339)
Previously, we'd default to "A Pulumi project.", which isn't a helpful
description for any real project.
2018-05-08 10:46:39 -07:00
joeduffy a5c70ac7f4 Change Git failures to CLI warnings
This change moves Git failures from glog.Warnings, which we don't
really pay attention, to true CLI warnings.

This will ensure we at least get bug reports in the event that this
fails on some user machine out in the wild.  They are still non-fatal,
of course, since such a failure needn't prevent an update from happening.
2018-05-08 10:37:42 -07:00
joeduffy b6db2c5763 Capture Git committer and author info
This change captures the Git committer and author's login and email
addresses, so that we can display them prominently in the service.  At
the moment, we only attribute updates to the identity that performed the
update which, in CI scenarios, is often always the same person for an
organization.  This makes Pulumi look like a needlessly lonely place.
2018-05-08 10:31:11 -07:00
Joe Duffy 24b350ea40
Support -y as shorthand for --yes (#1340) 2018-05-08 09:55:08 -07:00
Pat Gavlin e806b077ba
Merge pull request #1338 from pulumi/SimplifyTraceInit
Simplify cmdutil.InitTracing.
2018-05-07 20:33:50 -07:00