pulumi/pkg/backend
Sean Gillespie 491bcdc602
Add a list of in-flight operations to the deployment (#1759)
* Add a list of in-flight operations to the deployment

This commit augments 'DeploymentV2' with a list of operations that are
currently in flight. This information is used by the engine to keep
track of whether or not a particular deployment is in a valid state.

The SnapshotManager is responsible for inserting and removing operations
from the in-flight operation list. When the engine registers an intent
to perform an operation, SnapshotManager inserts an Operation into this
list and saves it to the snapshot. When an operation completes, the
SnapshotManager removes it from the snapshot. From this, the engine can
infer that if it ever sees a deployment with pending operations, the
Pulumi CLI must have crashed or otherwise abnormally terminated before
seeing whether or not an operation completed successfully.

To remedy this state, this commit also adds code to 'pulumi stack
import' that clears all pending operations from a deployment, as well as
code to plan generation that will reject any deployments that have
pending operations present.

At the CLI level, if we see that we are in a state where pending
operations were in-flight when the engine died, we'll issue a
human-friendly error message that indicates which resources are in a bad
state and how to recover their stack.

* CR: Multi-line string literals, renaming in-flight -> pending

* CR: Add enum to apitype for operation type, also name status -> type for clarity

* Fix the yaml type

* Fix missed renames

* Add implementation for lifecycle_test.go

* Rebase against master
2018-08-10 21:39:59 -07:00
..
cloud Initial support for passing URLs to new and up (#1727) 2018-08-10 18:08:16 -07:00
local Add a list of in-flight operations to the deployment (#1759) 2018-08-10 21:39:59 -07:00
state Add license headers 2018-05-22 15:02:47 -07:00
backend.go Initial support for passing URLs to new and up (#1727) 2018-08-10 18:08:16 -07:00
display.go Add license headers 2018-05-22 15:02:47 -07:00
snapshot.go Add a list of in-flight operations to the deployment (#1759) 2018-08-10 21:39:59 -07:00
snapshot_test.go Add a list of in-flight operations to the deployment (#1759) 2018-08-10 21:39:59 -07:00
stack.go Support TypeScript in a more first-class way 2018-08-06 14:00:58 -07:00
updates.go Add a few more CI env vars (#1738) 2018-08-08 14:12:47 -07:00