pulumi/pkg/backend/local
joeduffy 6ad785d5c4 Revise the way previews are controlled
I found the flag --force to be a strange name for skipping a preview,
since that name is usually reserved for operations that might be harmful
and yet you're coercing a tool to do it anyway, knowing there's a chance
you're going to shoot yourself in the foot.

I also found that what I almost always want in the situation where
--force was being used is to actually just run a preview and have the
confirmation auto-accepted.  Going straight to --force isn't the right
thing in a CI scenario, where you actually want to run a preview first,
just to ensure there aren't any issues, before doing the update.

In a sense, there are four options here:

1. Run a preview, ask for confirmation, then do an update (the default).
2. Run a preview, auto-accept, and then do an update (the CI scenario).
3. Just run a preview with neither a confirmation nor an update (dry run).
4. Just do an update, without performing a preview beforehand (rare).

This change enables all four workflows in our CLI.

Rather than have an explosion of flags, we have a single flag,
--preview, which can specify the mode that we're operating in.  The
following are the values which correlate to the above four modes:

1. "": default (no --preview specified)
2. "auto": auto-accept preview confirmation
3. "only": only run a preview, don't confirm or update
4. "skip": skip the preview altogether

As part of this change, I redid a bit of how the preview modes
were specified.  Rather than booleans, which had some illegal
combinations, this change introduces a new enum type.  Furthermore,
because the engine is wholly ignorant of these flags -- and only the
backend understands them -- it was confusing to me that
engine.UpdateOptions stored this flag, especially given that all
interesting engine options _also_ accepted a dryRun boolean.  As of
this change, the backend.PreviewBehavior controls the preview options.
2018-05-06 13:55:04 -07:00
..
backend.go Revise the way previews are controlled 2018-05-06 13:55:04 -07:00
crypto.go Update the copyright end date to 2018. (#1068) 2018-03-21 12:43:21 -07:00
display.go Add a hidden --no-interactive flag so that we can reduce interactive noise when running jenkins. (#1262) 2018-04-24 14:23:08 -07:00
jsonmessage.go Add a new tree-view form for the progress view. (#1260) 2018-04-24 11:13:22 -07:00
progress.go Simplify code that decides to show stack outputs. (#1332) 2018-05-06 11:30:20 -07:00
rows.go Print stack outputs at the end of an update. (#1327) 2018-05-05 12:54:57 -07:00
snapshot.go Snapshot management overhaul and refactor (#1273) 2018-04-25 17:20:08 -07:00
stack.go Revise the way previews are controlled 2018-05-06 13:55:04 -07:00
state.go Re-introduce interface for snapshot management (#1254) 2018-04-23 14:12:13 -07:00