terraform/backend/remote
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 clean up go mod for go-tfe 2019-09-27 14:16:41 -07:00
backend.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_apply.go cli: Remove deprecated destroy -force flag 2021-02-03 15:05:05 -05:00
backend_apply_test.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_common.go only print horizontal rule at first attempt 2021-02-10 20:47:50 -05:00
backend_context.go backend: Validate remote backend Terraform version 2020-11-19 13:19:40 -05:00
backend_context_test.go unused err value and nil context 2020-12-02 13:59:19 -05:00
backend_mock.go backend: Validate remote backend Terraform version 2020-11-19 13:19:40 -05:00
backend_plan.go backend: Faster remote backend tests 2020-11-18 16:00:05 -05:00
backend_plan_test.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
backend_state.go state: remove deprecated state package (#25490) 2020-08-11 11:43:01 -04:00
backend_state_test.go refactor tests to use modern states.State in favor of terraform.State where possible 2020-09-30 16:07:54 -04:00
backend_test.go backend/remote: No version check for local ops 2021-01-05 09:11:19 -05:00
cli.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00
colorize.go backend/remote: implement the Local interface 2018-11-26 20:50:25 +01:00
remote_test.go backend: Faster remote backend tests 2020-11-18 16:00:05 -05:00
testing.go backend: Add per-operation diagnostic rendering 2021-02-12 14:30:35 -05:00