terraform/backend
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
..
init backend: remove deprecated atlas backend 2020-10-26 14:05:18 -04:00
local backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
remote backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
remote-state Grammar nit: "setup" as a verb should be spelled "set up" 2021-01-26 20:39:11 +01:00
backend.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_test.go helper: deprecate pathorcontents 2020-10-08 08:42:16 -04:00
cli.go command: Use the new terminal.Streams object 2021-01-13 15:37:04 -08:00
operation_type.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
operationtype_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
testing.go remove LegacyProvider (#26433) 2020-10-05 08:33:49 -04:00
unparsed_value.go Avoid leaking sensitive values in undeclared warnings 2019-11-05 17:32:57 -08:00
unparsed_value_test.go backend/local: Handle interactive prompts for variables in UI layer 2019-10-10 10:07:01 -07:00