opentofu/internal
Martin Atkins fda0579537 Experiments supported only in alpha/dev builds
We originally introduced the idea of language experiments as a way to get
early feedback on not-yet-proven feature ideas, ideally as part of the
initial exploration of the solution space rather than only after a
solution has become relatively clear.

Unfortunately, our tradeoff of making them available in normal releases
behind an explicit opt-in in order to make it easier to participate in the
feedback process had the unintended side-effect of making it feel okay
to use experiments in production and endure the warnings they generate.
This in turn has made us reluctant to make use of the experiments feature
lest experiments become de-facto production features which we then feel
compelled to preserve even though we aren't yet ready to graduate them
to stable features.

In an attempt to tweak that compromise, here we make the availability of
experiments _at all_ a build-time flag which will not be set by default,
and therefore experiments will not be available in most release builds.

The intent (not yet implemented in this PR) is for our release process to
set this flag only when it knows it's building an alpha release or a
development snapshot not destined for release at all, which will therefore
allow us to still use the alpha releases as a vehicle for giving feedback
participants access to a feature (without needing to install a Go
toolchain) but will not encourage pretending that these features are
production-ready before they graduate from experimental.

Only language experiments have an explicit framework for dealing with them
which outlives any particular experiment, so most of the changes here are
to that generalized mechanism. However, the intent is that non-language
experiments, such as experimental CLI commands, would also in future
check Meta.AllowExperimentalFeatures and gate the use of those experiments
too, so that we can be consistent that experimental features will never
be available unless you explicitly choose to use an alpha release or
a custom build from source code.

Since there are already some experiments active at the time of this commit
which were not previously subject to this restriction, we'll pragmatically
leave those as exceptions that will remain generally available for now,
and so this new approach will apply only to new experiments started in the
future. Once those experiments have all concluded, we will be left with
no more exceptions unless we explicitly choose to make an exception for
some reason we've not imagined yet.

It's important that we be able to write tests that rely on experiments
either being available or not being available, so here we're using our
typical approach of making "package main" deal with the global setting
that applies to Terraform CLI executables while making the layers below
all support fine-grain selection of this behavior so that tests with
different needs can run concurrently without trampling on one another.

As a compromise, the integration tests in the terraform package will
run with experiments enabled _by default_ since we commonly need to
exercise experiments in those tests, but they can selectively opt-out
if they need to by overriding the loader setting back to false again.
2022-06-17 14:46:07 -07:00
..
addrs refactoring: Use addrs.Map for maps with addresses as keys 2022-06-16 07:03:36 -07: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 Experiments supported only in alpha/dev builds 2022-06-17 14:46:07 -07:00
communicator communicator/ssh: Fix crash using SSH+HTTP proxy 2022-05-03 08:24:59 -04:00
configs Experiments supported only in alpha/dev builds 2022-06-17 14:46:07 -07: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 addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08: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 Experiments supported only in alpha/dev builds 2022-06-17 14:46:07 -07:00
tfdiags core: Eval pre/postconditions in refresh-only mode 2022-03-11 13:32:40 -05: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