Commit graph

2600 commits

Author SHA1 Message Date
Matt Ellis fe8bad70d1 Don't mention PPC unless needed in the CLI
PPCs are no longer a central concept to our model, but instead a
feature that that pulumi.com provides to some organizations. Let's
remove most mentions of PPCs except for cases where we really need to
talk about them (e.g. when a stack is actually hosted in a PPC instead
of just via the normal pulumi.com service)

Also remove some "in the Pulumi Cloud" messages from the CLI, as using
the Pulumi Cloud is now the only real way to use pulumi.

Fixes pulumi/pulumi-service#1117
2018-04-23 16:50:48 -04:00
Matt Ellis cbb7e8e862 Fix "interactive" stack creation
The cloud backend would fail if `nil` was passed in as the options to
use when creating a stack. However, we passed nil in places where we
allow the user to create stacks interacively. I noticed this while
dogfooding.

In the cloud backend, treat a `nil` opts as if the default set of
options was passed.
2018-04-23 16:26:16 -04:00
Chris Smith 4651419f7f
Add Commit message, committer, and author to update env (#1249)
* Add Commit message, committer, and author to update env

* Remove low value comments
2018-04-23 11:39:14 -07:00
Pat Gavlin fa97af772a
Merge pull request #1250 from pulumi/MoreDeploymentVersions
Add deployment version fields to more types.
2018-04-23 09:52:53 -07:00
CyrusNajmabadi 7807edc166
Simplifying progress code (#1253) 2018-04-22 18:10:19 -07:00
Chris Smith fe3d854bc5
Use ContinuationToken (#1220)
* Use ContinuationToken

* Rename 'afterIndex' to 'continuationToken' for clarity
2018-04-20 15:48:23 -07:00
pat@pulumi.com 5ed6f8b9e3 Add deployment version fields to more types.
This completes the rollout of deployment version fields in the API
types.
2018-04-20 14:36:15 -07:00
Pat Gavlin f61998ea99
Merge pull request #1248 from pulumi/NoOutputsComponents
Fix issue #1135.
2018-04-20 13:46:35 -07:00
Pat Gavlin d42bc346c5
Merge pull request #1246 from pulumi/FixTypos
Fix a couple of typos.
2018-04-20 11:54:55 -07:00
pat@pulumi.com 864d70968b Improve a comment. 2018-04-20 11:52:33 -07:00
pat@pulumi.com 7866e1d561 Fix issue #1135.
Do not fire a "resource outputs" display event for component resources
after their initial registration. Instead, defer this event until the
component's `RegisterResourceOutputs` call arrives.
2018-04-20 11:44:28 -07:00
pat@pulumi.com 42b67a4dbc Fix a couple of typos.
- Restore a dropped "update"
- %s/Resouce/Resource/g
2018-04-20 11:09:54 -07:00
Matt Ellis 17faae5517
Merge pull request #1226 from pulumi/ellismg/identity
New Identity Model in the CLI
2018-04-19 23:48:32 -07:00
Matt Ellis 15e2ad27fe Address code review feedback 2018-04-20 02:34:10 -04:00
Matt Ellis cc938a3bc8 Merge remote-tracking branch 'origin/master' into ellismg/identity 2018-04-20 01:56:41 -04:00
Matt Ellis 04e5dfde5f Address code review feedback 2018-04-20 01:31:14 -04:00
Sean Gillespie 4724f91e82
Fix wording in nodejs readme (#1239) 2018-04-19 21:42:26 -07:00
Pat Gavlin 4fa69bfd72
Plumb basic cancellation through the engine. (#1231)
hese changes plumb basic support for cancellation through the engine.
Two types of cancellation are supported for all engine operations:
- Cancellation, which waits for the operation to drive itself to a safe
  point before the operation returns, and
- Termination, which does not wait for the operation to drive itself
  to a safe opint for the operation returns.

When updating local or managed stacks, a single ^C triggers cancellation
of any running operation; a second ^C will trigger termination.

Fixes #513, #1077.
2018-04-19 18:59:14 -07:00
CyrusNajmabadi e8485c2388
Lighten our dependency on the docker cli (#1238) 2018-04-19 15:55:24 -07:00
CyrusNajmabadi ffcd9fde7b
Show stdout events at hte bottom of the progress view. (#1236) 2018-04-19 14:44:53 -07:00
Pat Gavlin e2b023af9e
Merge pull request #1235 from pulumi/RemoveConvUtil
Remove the convutil package.
2018-04-19 14:25:08 -07:00
Sean Gillespie 9e3500d181
CI cleanup for various Node versions (#1233)
* Run Windows CI against node v8.10

* Update READMEs
2018-04-19 13:44:47 -07:00
CyrusNajmabadi 41dbd9a62e
Cleanup work before putting in the ability to have system messages shown in hte progress view. (#1234) 2018-04-19 12:31:47 -07:00
pat@pulumi.com 87d629aafe Remove the convutil package.
This code is unused.
2018-04-19 12:21:33 -07:00
Pat Gavlin d1c547524d
Add a pulumi cancel command. (#1230)
This command cancels a stack's currently running update, if any. It can
be used to recover from the scenario in which an update is aborted
without marking the running update as complete. Once an update has been
cancelled, it is likely that the affected stack will need to be repaired
via an pair of export/import commands before future updates can succeed.

This is part of #1077.
2018-04-19 10:09:32 -07:00
Sean Gillespie 28806ac9f3
Fix the protect_resources test (#1228)
Step 3 should also assert that the protected resource that we failed to
delete is still in the checkpoint.
2018-04-18 12:26:46 -07:00
Joe Duffy 3b8d0e6d96
Merge pull request #1148 from pulumi/1081_refresh_cmd
Implement a refresh command
2018-04-18 12:12:33 -07:00
joeduffy bac58d7922 Respond to CR feedback
Incorporate feedback from @swgillespie and @pgavlin.
2018-04-18 11:46:37 -07:00
joeduffy b77403b4bb Implement a refresh command
This change implements a `pulumi refresh` command.  It operates a bit
like `pulumi update`, and friends, in that it supports `--preview` and
`--diff`, along with the usual flags, and will update your checkpoint.

It works through substitution of the deploy.Source abstraction, which
generates a sequence of resource registration events.  This new
deploy.RefreshSource takes in a prior checkpoint and will walk it,
refreshing the state via the associated resource providers by invoking
Read for each resource encountered, and merging the resulting state with
the prior checkpoint, to yield a new resource.Goal state.  This state is
then fed through the engine in the usual ways with a few minor caveats:
namely, although the engine must generate steps for the logical
operations (permitting us to get nice summaries, progress, and diffs),
it mustn't actually carry them out because the state being imported
already reflects reality (a deleted resource has *already* been deleted,
so of course the engine need not perform the deletion).  The diffing
logic also needs to know how to treat the case of refresh slightly
differently, because we are going to be diffing outputs and not inputs.

Note that support for managed stacks is not yet complete, since that
requires updates to the service to support a refresh endpoint.  That
will be coming soon ...
2018-04-18 10:57:16 -07:00
Matt Ellis 56d7f8eb24 Support new stack identity for the cloud backend
This change introduces support for using the cloud backend when
`pulumi init` has not been run. When this is the case, we use the new
identity model, where a stack is referenced by an owner and a stack
name only.

There are a few things going on here:

- We add a new `--owner` flag to `pulumi stack init` that lets you
  control what account a stack is created in.

- When listing stacks, we show stacks owned by you and any
  organizations you are a member of. So, for example, I can do:

  * `pulumi stack init my-great-stack`
  * `pulumi stack init --owner pulumi my-great-stack`

  To create a stack owned by my user and one owned by my
  organization. When `pulumi stack ls` is run, you'll see both
  stacks (since they are part of the same project).

- When spelling a stack on the CLI, an owner can be optionally
  specified by prefixing the stack name with an owner name. For
  example `my-great-stack` means the stack `my-great-stack` owned by
  the current logged in user, where-as `pulumi/my-great-stack` would
  be the stack owned by the `pulumi` organization

- `--all` can be passed to `pulumi stack ls` to see *all* stacks you
  have access to, not just stacks tied to the current project.
2018-04-18 04:54:02 -07:00
Matt Ellis c0b2c4f17f Introduce backend.StackReference
Long term, a stack name alone will not be sufficent to address a
stack. Introduce a new `backend.StackReference` interface that allows
each backend to give an opaque stack reference that can be used across
operations.
2018-04-18 04:54:02 -07:00
Matt Ellis 50982e8763 Add some randomness to stack names in our integration tests
To prepare for a world where stack names must be unique across an
owner, add some randomness to the names we use for stacks as part of
our integration tests.
2018-04-18 04:54:02 -07:00
Matt Ellis b5129dba19 Don't leak a file from asset_test.go 2018-04-18 04:54:02 -07:00
Matt Ellis bac02f1df1 Remove the need to pulumi init for the local backend
This change removes the need to `pulumi init` when targeting the local
backend. A fair amount of the change lays the foundation that the next
set of changes to stop having `pulumi init` be used for cloud stacks
as well.

Previously, `pulumi init` logically did two things:

1. It created the bookkeeping directory for local stacks, this was
stored in `<repository-root>/.pulumi`, where `<repository-root>` was
the path to what we belived the "root" of your project was. In the
case of git repositories, this was the directory that contained your
`.git` folder.

2. It recorded repository information in
`<repository-root>/.pulumi/repository.json`. This was used by the
cloud backend when computing what project to interact with on
Pulumi.com

The new identity model will remove the need for (2), since we only
need an owner and stack name to fully qualify a stack on
pulumi.com, so it's easy enough to stop creating a folder just for
that.

However, for the local backend, we need to continue to retain some
information about stacks (e.g. checkpoints, history, etc). In
addition, we need to store our workspace settings (which today just
contains the selected stack) somehere.

For state stored by the local backend, we change the URL scheme from
`local://` to `local://<optional-root-path>`. When
`<optional-root-path>` is unset, it defaults to `$HOME`. We create our
`.pulumi` folder in that directory. This is important because stack
names now must be unique within the backend, but we have some tests
using local stacks which use fixed stack names, so each integration
test really wants its own "view" of the world.

For the workspace settings, we introduce a new `workspaces` directory
in `~/.pulumi`. In this folder we write the workspace settings file
for each project. The file name is the name of the project, combined
with the SHA1 of the path of the project file on disk, to ensure that
multiple pulumi programs with the same project name have different
workspace settings.

This does mean that moving a project's location on disk will cause the
CLI to "forget" what the selected stack was, which is unfortunate, but
not the end of the world. If this ends up being a big pain point, we
can certianly try to play games in the future (for example, if we saw
a .git folder in a parent folder, we could store data in there).

With respect to compatibility, we don't attempt to migrate older files
to their newer locations. For long lived stacks managed using the
local backend, we can provide information on where to move things
to. For all stacks (regardless of backend) we'll require the user to
`pulumi stack select` their stack again, but that seems like the
correct trade-off vs writing complicated upgrade code.
2018-04-18 04:53:49 -07:00
Matt Ellis 6f0bc7eb46 Call pulumi stack rm --yes in some tests
Our normal lifecycle tests always call pulumi stack rm, but some of
the tests that used the more barebones framework did not do so. This
was "ok" in the past, since all bookkeeping data about a stack was
stored next to the Pulumi program itself and we deleted that folder
once the test passed.

As part of removing `pulumi init` workspace tracking will move to
~/.pulumi/workspaces and so we'd like to have a gesture that actually
removes the stack, which will cause the workspace file to be removed
as well, instead of littering ~/.pulumi/workspaces with tests.
2018-04-18 03:29:19 -07:00
Matt Ellis e83aa175ff Remove configuration upgrade code
Upcoming work to remove the need for `pulumi init` makes testing the
upgrade code much harder than it did in the past (since workspace data
is moving to a different location on the file system, as well as some
other changes).

Instead of trying to maintain the code and test, let's just remove
it. Folks who haven't migrated (LM and the PPC deployment in the
service) should use the 0.11.3 or earlier CLI to migrate their
projects (simply by logging in and running a pulumi command) or move
things forward by hand.
2018-04-18 03:29:19 -07:00
Pat Gavlin c4234527db
Merge pull request #1225 from pulumi/VersionedDeployment
Add a `Version` field to `UntypedDeployment`.
2018-04-17 17:28:03 -07:00
Pat Gavlin a4d6cba664 Add a Version field to UntypedDeployment.
This field indicates the schema of the serialized deployment. This field
behaves identically to the `Version` field of
`PatchUpdateCheckpointRequest`.

This is part of pulumi/pulumi-service#1046
2018-04-17 16:23:20 -07:00
Pat Gavlin a1626aea36
Add a version field to PatchUpdateCheckpointRequest. (#1222)
And make the deployment an opaque JSON message. The verison field
indicates the schema of the deployment. A missing version field will
behave as if the version was set to `1`. A version of `1` indicates that
the serialized deployment has the `DeploymentV1` schema.

This is part of pulumi/pulumi-service#1046.
2018-04-17 15:58:20 -07:00
Pat Gavlin fb55f3aab6
Add version suffixes to more API types. (#1215)
This covers most of the transitive closure of the types that appear in a
checkpoint. A breaking change to any of these types implies a bump in
the checkpoint version number.

This is part of pulumi/pulumi-service#1046.
2018-04-17 10:38:47 -07:00
CyrusNajmabadi 50dafdae6a
Simplify the diff for primitive values. (#1212) 2018-04-17 01:51:53 -07:00
CyrusNajmabadi 4a5e72fb16
Progress tweaks (#1219) 2018-04-16 23:41:00 -07:00
Sean Gillespie 55711e4ca3
Revert "Lift snapshot management out of the engine and serialize writes to snapshot (#1069)" (#1216)
This reverts commit 2c479c172d.
2018-04-16 23:04:56 -07:00
CyrusNajmabadi 0bd3036115
Small progress tweaks. (#1218) 2018-04-16 19:46:57 -07:00
Joe Duffy 2a9cf66ed0
Merge pull request #1209 from pulumi/1203_dont_use_instanceof
Don't use `instanceof` for RTTI
2018-04-16 18:41:34 -07:00
joeduffy 4e9ff55def Change login prompt text and enable no-echo
This makes two minor tweaks to the login prompt:

1. Change the text so that it hyperlinks in most terminals, including
   iTerm, in a way that doesn't include excess characters.

2. Disable echoing of the token.
2018-04-16 17:43:37 -07:00
Matt Ellis a55d3f9d7e Make diff tests pass when running against a local service
In cases where we are running against a local service, the CLI does
not print a Permalink line when updating a stack, because we can not
determine what the URL for the link would be. This breaks the diff
tests which need to clean the CLI output and compare them to known
values, since the output now has one less line than expected.

Update the test's cleaning logic to handle this case.
2018-04-16 16:38:39 -07:00
CyrusNajmabadi 4dbb56d142
Just the minimal change to unbreak the client requesting a preview from the service. (#1214) 2018-04-16 15:34:59 -07:00
joeduffy d5608f2fee Use x is T return types for isX functions
This change adopts `x is T` style of RTTI inquiry, which fits much
more nicely with TypeScript's typechecking flow.

Thanks to @lukehoban for teaching me a new trick today! :-)
2018-04-16 15:03:23 -07:00
CyrusNajmabadi b4b11991a2
Remove unused param. (#1211) 2018-04-16 14:42:36 -07:00