terraform/backend/local
Alisdair McDiarmid 536c80da23 backend: Add per-operation diagnostic rendering
The enhanced backends (local and remote) need to be able to render
diagnostics during operations. Prior to this commit, this functionality
was supported with a per-backend `ShowDiagnostics` function pointer.

In order to allow users of these backends to control how diagnostics are
rendered, this commit moves that function pointer to the `Operation`
type. This means that a diagnostic renderer is configured for each
operation, rather than once per backend initialization.

Some secondary consequences of this change:

- The `ReportResult` method on the backend is now moved to the
  `Operation` type, as it needs to access the `ShowDiagnostics` callback
  (and nothing else from the backend);
- Tests which assumed that diagnostics would be written to the backend's
  `cli.Ui` instance are migrated to using a new record/playback diags
  helper function;
- Apply, plan, and refresh commands now pass a pointer to the `Meta`
  struct's `showDiagnostics` method.

This commit should not change how Terraform works, and is refactoring in
preparation for more changes which move UI code out of the backend.
2021-02-12 14:30:35 -05:00
..
testdata cli: Move resource count code to command package 2021-01-29 15:29:35 -05:00
backend.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_apply.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_apply_test.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_local.go set SkipRefresh for plan and apply 2020-12-10 09:47:13 -05:00
backend_local_test.go * backend/local: push responsibility for unlocking state into individual operations 2020-08-11 11:23:42 -04:00
backend_plan.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_plan_test.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_refresh.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_refresh_test.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_test.go Implement the remote enhanced backend 2018-11-06 16:29:46 +01:00
cli.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
hook_state.go state: remove deprecated state package (#25490) 2020-08-11 11:43:01 -04:00
hook_state_test.go state: remove deprecated state package (#25490) 2020-08-11 11:43:01 -04:00
local_test.go use a single log writer 2020-10-19 14:29:54 -04:00
testing.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00