terraform/backend/local
Martin Atkins 3ea159297c command/format: improve consistency of plan results
Previously the rendered plan output was constructed directly from the
core plan and then annotated with counts derived from the count hook.
At various places we applied little adjustments to deal with the fact that
the user-facing diff model is not identical to the internal diff model,
including the special handling of data source reads and destroys. Since
this logic was just muddled into the rendering code, it behaved
inconsistently with the tally of adds, updates and deletes.

This change reworks the plan formatter so that it happens in two stages:
- First, we produce a specialized Plan object that is tailored for use
  in the UI. This applies all the relevant logic to transform the
  physical model into the user model.
- Second, we do a straightforward visual rendering of the display-oriented
  plan object.

For the moment this is slightly overkill since there's only one rendering
path, but it does give us the benefit of letting the counts be derived
from the same data as the full detailed diff, ensuring that they'll stay
consistent.

Later we may choose to have other UIs for plans, such as a
machine-readable output intended to drive a web UI. In that case, we'd
want the web UI to consume a serialization of the _display-oriented_ plan
so that it doesn't need to re-implement all of these UI special cases.

This introduces to core a new diff action type for "refresh". Currently
this is used _only_ in the UI layer, to represent data source reads.
Later it would be good to use this type for the core diff as well, to
improve consistency, but that is left for another day to keep this change
focused on the UI.
2017-09-01 17:55:05 -07:00
..
test-fixtures core: Move Refreh/Plan diff count to general operation test 2017-06-24 07:54:40 -07:00
backend.go improve plugin reinit error text 2017-06-22 15:11:37 -04:00
backend_apply.go command/format: improve consistency of plan results 2017-09-01 17:55:05 -07:00
backend_apply_test.go backend/local: create local state file if backend write fails 2017-05-23 11:18:01 -07:00
backend_local.go Add warning to mismatched plan state 2017-07-17 10:41:29 -04:00
backend_plan.go command/format: improve consistency of plan results 2017-09-01 17:55:05 -07:00
backend_plan_test.go core: Move Refreh/Plan diff count to general operation test 2017-06-24 07:54:40 -07:00
backend_refresh.go provide contexts to clistate.Lock calls 2017-04-01 17:09:20 -04:00
backend_refresh_test.go backend/local: refresh with no config should not crash on input 2017-02-22 13:10:08 -08:00
backend_test.go command + backend: rename various API objects to "Workspace" terminology 2017-06-09 16:26:25 -07:00
cli.go command: use backend.CLIIinit 2017-02-28 10:58:29 -08:00
counthookaction_string.go Fix stringer comments (#15069) 2017-06-05 10:17:35 +01:00
hook_count.go core: Skip diff hooks for stubs on eval altogether 2017-06-24 08:01:17 -07:00
hook_count_action.go backend/local 2017-01-26 14:33:49 -08:00
hook_count_test.go core: Skip diff hooks for stubs on eval altogether 2017-06-24 08:01:17 -07:00
hook_state.go Revert "have StateHook periodically PersistState" 2017-06-07 16:25:19 -07:00
hook_state_test.go Revert "have StateHook periodically PersistState" 2017-06-07 16:25:19 -07:00
local_test.go backend/local 2017-01-26 14:33:49 -08:00
testing.go command + backend: rename various API objects to "Workspace" terminology 2017-06-09 16:26:25 -07:00