opentofu/internal/command/views
Martin Atkins 90ea7b0bc5 tfdiags: Treat unknown-related or sensitive-related messages differently
By observing the sorts of questions people ask in the community, and the
ways they ask them, we've inferred that various different people have been
confused by Terraform reporting that a value won't be known until apply
or that a value is sensitive as part of an error message when that message
doesn't actually relate to the known-ness and sensitivity of any value.

Quite reasonably, someone who sees Terraform discussing an unfamiliar
concept like unknown values can assume that it must be somehow relevant to
the problem being discussed, and so in that sense Terraform's current
error messages are giving "too much information": information that isn't
actually helpful in understanding the problem being described, and in the
worst case is a distraction from understanding the problem being described.

With that in mind then, here we introduce an explicit annotation on
diagnostic objects that are directly talking about unknown values or
sensitive values, and then the diagnostic renderer will react to that to
avoid using the terminology "known only after apply" or "sensitive" in the
generated diagnostic annotations unless we're rendering a message that is
explicitly related to one of those topics.

This ends up being a bit of a cross-cutting concern because the code that
generates these diagnostics and the code that renders them are in separate
packages and are not directly aware of each other. With that in mind, the
logic for actually deciding for a particular diagnostic whether it's
flagged in one of these special ways lives inside the tfdiags package as
an intermediation point, which both the diagnostic generator (in the core
package) and the diagnostic renderer can both depend on.
2022-06-23 13:52:23 -07:00
..
json tfdiags: Treat unknown-related or sensitive-related messages differently 2022-06-23 13:52:23 -07:00
testdata/show cli: Migrate show command to use command arguments and views 2022-01-13 11:00:03 -06:00
apply_test.go update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
apply.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_count_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_count.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_json_test.go test fixture race 2022-04-20 15:01:17 -04:00
hook_json.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_ui_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_ui.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
json_view_test.go json-output: Config-driven move support in JSON UI 2021-09-20 15:25:23 -04:00
json_view.go json-output: Release format version 1.0 2021-10-06 11:13:06 -04:00
operation_test.go track contributing instances 2022-03-17 09:35:36 -04:00
operation.go json-output: Config-driven move support in JSON UI 2021-09-20 15:25:23 -04:00
output_test.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
output.go de-linting 2021-09-01 11:36:21 -04:00
plan_test.go improve the contributing attributes filter 2022-03-30 10:04:48 -04:00
plan.go improve the contributing attributes filter 2022-03-30 10:04:48 -04:00
refresh_test.go update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
refresh.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
show_test.go cli: Migrate show command to use command arguments and views 2022-01-13 11:00:03 -06:00
show.go cli: Migrate show command to use command arguments and views 2022-01-13 11:00:03 -06:00
state_locker.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
test_test.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
test.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
validate_test.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
validate.go json-output: Release format version 1.0 2021-10-06 11:13:06 -04:00
view.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00