opentofu/internal
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
..
addrs addrs: Add tests for Module.String 2022-06-23 10:42:07 -04:00
backend http-backend: http backend lock error return LockError instead of generic error 2022-06-16 11:01:01 -04:00
builtin return diagnostics from provisioners 2021-05-19 11:24:54 -04:00
cloud add url to summary and check for optional values (#30993) 2022-05-31 13:48:07 -07:00
command tfdiags: Treat unknown-related or sensitive-related messages differently 2022-06-23 13:52:23 -07:00
communicator communicator/ssh: Fix crash using SSH+HTTP proxy 2022-05-03 08:24:59 -04:00
configs configs: Fix check block configuration diagnostics 2022-06-21 12:13:45 -04:00
copy test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
dag do not use pointer addr strings as map keys in set 2022-01-05 11:28:47 +00:00
depsfile test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
didyoumean didyoumean: move from "helper" to "internal" 2020-10-02 13:35:07 -07:00
e2e test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
earlyconfig tfdiags: Expose the "extra information" concept from HCL 2022-06-23 13:52:23 -07:00
experiments Conclude module variable optional attrs experiment 2022-06-13 12:27:21 -04:00
getmodules add XTerraformGetLimit to prevent redirect loops 2022-06-01 12:46:22 -04:00
getproviders internal/getproviders: Add URL to error message for clarity (#30810) 2022-04-14 16:14:50 +01:00
grpcwrap Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
helper/slowmessage remove wrapped streams and readline 2021-10-28 11:51:39 -04:00
httpclient Move httpclient/ to internal/httpclient/ 2021-05-17 14:09:07 -07:00
initwd test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
instances InstancesForModule should not panic 2021-12-17 13:31:41 -05:00
ipaddr lang/funcs: Preserve IP address leading zero behavior from Go 1.16 2021-08-17 15:20:05 -07:00
lang lang: Remove defaults function 2022-06-01 06:40:37 -04:00
legacy Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
logging cleanup panic output 2021-12-17 11:57:52 -05:00
modsdir Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
moduledeps Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
moduletest Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
plans core: Report reason for deferring data read until apply 2022-05-09 11:12:47 -07:00
plugin Return early on GetProviderSchema RPC responses with error diagnostics 2022-06-03 14:27:55 -04:00
plugin6 Return early on GetProviderSchema RPC responses with error diagnostics 2022-06-03 14:27:55 -04:00
provider-simple Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-simple-v6 Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-terraform/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
providercache test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
providers providers: A type for all schemas for a particular provider 2022-03-04 15:51:36 -05:00
provisioner-local-exec/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provisioners Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
refactoring refactoring: Use addrs.Map for maps with addresses as keys 2022-06-16 07:03:36 -07:00
registry command: make module installation interruptible 2021-11-11 12:28:10 +00:00
repl lang: Further limit the console-only type function 2022-02-10 06:12:58 -05:00
replacefile Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
states states/remote: Check for LockError error type 2022-06-17 10:51:00 -04:00
terminal remove the use of panicwrap 2021-10-28 11:51:39 -04:00
terraform tfdiags: Treat unknown-related or sensitive-related messages differently 2022-06-23 13:52:23 -07:00
tfdiags tfdiags: Treat unknown-related or sensitive-related messages differently 2022-06-23 13:52:23 -07:00
tfplugin5 go.mod: go get google.golang.org/protobuf@v1.27.1 2021-10-11 16:37:39 -07:00
tfplugin6 Introduce Terraform Plugin Protocol 6.2 with legacy_type_system fields from Protocol 5 (#30375) 2022-01-20 09:57:42 -05:00
typeexpr configs: Add default argument to optional() 2022-05-31 12:11:15 -04:00