From 88100e3d399b11a295574ac4c974a0f460c50d69 Mon Sep 17 00:00:00 2001 From: Elbaz Date: Mon, 21 Aug 2023 14:21:06 +0300 Subject: [PATCH 1/3] Renames --- internal/addrs/check_rule_diagnostic.go | 2 +- internal/addrs/doc.go | 4 ++-- internal/addrs/module_instance.go | 2 +- internal/addrs/module_package.go | 4 ++-- internal/addrs/module_source.go | 10 +++++----- internal/addrs/module_source_test.go | 4 ++-- internal/addrs/move_endpoint.go | 6 +++--- internal/addrs/parse_ref.go | 8 ++++---- internal/addrs/parse_ref_test.go | 8 ++++---- internal/addrs/provider.go | 4 ++-- internal/addrs/provider_config.go | 6 +++--- internal/addrs/provider_test.go | 10 +++++----- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal/addrs/check_rule_diagnostic.go b/internal/addrs/check_rule_diagnostic.go index 637bc3f2c5..e2f695dbee 100644 --- a/internal/addrs/check_rule_diagnostic.go +++ b/internal/addrs/check_rule_diagnostic.go @@ -55,7 +55,7 @@ func (c *CheckRuleDiagnosticExtra) WrapDiagnosticExtra(inner interface{}) { if c.wrapped != nil { // This is a logical inconsistency, the caller should know whether they // have already wrapped an extra or not. - panic("Attempted to wrap a diagnostic extra into a CheckRuleDiagnosticExtra that is already wrapping a different extra. This is a bug in Terraform, please report it.") + panic("Attempted to wrap a diagnostic extra into a CheckRuleDiagnosticExtra that is already wrapping a different extra. This is a bug in OpenTF, please report it.") } c.wrapped = inner } diff --git a/internal/addrs/doc.go b/internal/addrs/doc.go index 0d29d9f456..966c634d88 100644 --- a/internal/addrs/doc.go +++ b/internal/addrs/doc.go @@ -2,14 +2,14 @@ // SPDX-License-Identifier: MPL-2.0 // Package addrs contains types that represent "addresses", which are -// references to specific objects within a Terraform configuration or +// references to specific objects within a OpenTF configuration or // state. // // All addresses have string representations based on HCL traversal syntax // which should be used in the user-interface, and also in-memory // representations that can be used internally. // -// For object types that exist within Terraform modules a pair of types is +// For object types that exist within OpenTF modules a pair of types is // used. The "local" part of the address is represented by a type, and then // an absolute path to that object in the context of its module is represented // by a type of the same name with an "Abs" prefix added, for "absolute". diff --git a/internal/addrs/module_instance.go b/internal/addrs/module_instance.go index 132083ba28..3b02b7a692 100644 --- a/internal/addrs/module_instance.go +++ b/internal/addrs/module_instance.go @@ -198,7 +198,7 @@ LOOP: // equivalent ModuleInstance address that assumes that no modules have // keyed instances. // -// This is a temporary allowance for the fact that Terraform does not presently +// This is a temporary allowance for the fact that OpenTF does not presently // support "count" and "for_each" on modules, and thus graph building code that // derives graph nodes from configuration must just assume unkeyed modules // in order to construct the graph. At a later time when "count" and "for_each" diff --git a/internal/addrs/module_package.go b/internal/addrs/module_package.go index b38805b4b9..d9a622a351 100644 --- a/internal/addrs/module_package.go +++ b/internal/addrs/module_package.go @@ -7,9 +7,9 @@ import ( tfaddr "github.com/hashicorp/terraform-registry-address" ) -// A ModulePackage represents a physical location where Terraform can retrieve +// A ModulePackage represents a physical location where OpenTF can retrieve // a module package, which is an archive, repository, or other similar -// container which delivers the source code for one or more Terraform modules. +// container which delivers the source code for one or more OpenTF modules. // // A ModulePackage is a string in go-getter's address syntax. By convention, // we use ModulePackage-typed values only for the result of successfully diff --git a/internal/addrs/module_source.go b/internal/addrs/module_source.go index d09e3a9435..869ca7e81e 100644 --- a/internal/addrs/module_source.go +++ b/internal/addrs/module_source.go @@ -54,7 +54,7 @@ var moduleSourceLocalPrefixes = []string{ // For historical reasons this syntax is a bit overloaded, supporting three // different address types: // - Local paths starting with either ./ or ../, which are special because -// Terraform considers them to belong to the same "package" as the caller. +// OpenTF considers them to belong to the same "package" as the caller. // - Module registry addresses, given as either NAMESPACE/NAME/SYSTEM or // HOST/NAMESPACE/NAME/SYSTEM, in which case the remote registry serves // as an indirection over the third address type that follows. @@ -85,7 +85,7 @@ func ParseModuleSource(raw string) (ModuleSource, error) { // parsed as one, and anything else must fall through to be // parsed as a direct remote source, where go-getter might // then recognize it as a filesystem path. This is odd - // but matches behavior we've had since Terraform v0.10 which + // but matches behavior we've had since OpenTF v0.10 which // existing modules may be relying on. // (Notice that this means that there's never any path where // the registry source parse error gets returned to the caller, @@ -142,7 +142,7 @@ func parseModuleSourceLocal(raw string) (ModuleSourceLocal, error) { // produces. // Although using backslashes (Windows-style) is non-idiomatic, we do - // allow it and just normalize it away, so the rest of Terraform will + // allow it and just normalize it away, so the rest of OpenTF will // only see the forward-slash form. if strings.Contains(raw, `\`) { // Note: We use string replacement rather than filepath.ToSlash @@ -192,12 +192,12 @@ func (s ModuleSourceLocal) ForDisplay() string { } // ModuleSourceRegistry is a ModuleSource representing a module listed in a -// Terraform module registry. +// OpenTF module registry. // // A registry source isn't a direct source location but rather an indirection // over a ModuleSourceRemote. The job of a registry is to translate the // combination of a ModuleSourceRegistry and a module version number into -// a concrete ModuleSourceRemote that Terraform will then download and +// a concrete ModuleSourceRemote that OpenTF will then download and // install. type ModuleSourceRegistry tfaddr.Module diff --git a/internal/addrs/module_source_test.go b/internal/addrs/module_source_test.go index 5d366216b2..051bf62496 100644 --- a/internal/addrs/module_source_test.go +++ b/internal/addrs/module_source_test.go @@ -311,7 +311,7 @@ func TestParseModuleSource(t *testing.T) { // just a general "this string doesn't match any of our source // address patterns" situation, not _necessarily_ about relative // local paths. - wantErr: `Terraform cannot detect a supported external module source type for boop/bloop`, + wantErr: `OpenTF cannot detect a supported external module source type for boop/bloop`, }, "go-getter will accept all sorts of garbage": { @@ -481,7 +481,7 @@ func TestParseModuleSourceRegistry(t *testing.T) { // the user provided in the input, and so for backward compatibility // we're continuing to do that here, at the expense of now making the // "ForDisplay" output case-preserving where its predecessor in the - // old package wasn't. The main Terraform Registry at registry.terraform.io + // old package wasn't. The main OpenTF Registry at registry.terraform.io // is itself case-insensitive anyway, so our case-preserving here is // entirely for the benefit of existing third-party registry // implementations that might be case-sensitive, which we must remain diff --git a/internal/addrs/move_endpoint.go b/internal/addrs/move_endpoint.go index e988765b64..e41b8fc12a 100644 --- a/internal/addrs/move_endpoint.go +++ b/internal/addrs/move_endpoint.go @@ -18,8 +18,8 @@ import ( // Its name reflects that its primary purpose is for the "from" and "to" // addresses in a "moved" statement in the configuration, but it's also // valid to use MoveEndpoint for other similar mechanisms that give -// Terraform hints about historical configuration changes that might -// prompt creating a different plan than Terraform would by default. +// OpenTF hints about historical configuration changes that might +// prompt creating a different plan than OpenTF would by default. // // To obtain a full address from a MoveEndpoint you must use // either the package function UnifyMoveEndpoints (to get an AbsMoveable) or @@ -31,7 +31,7 @@ type MoveEndpoint struct { SourceRange tfdiags.SourceRange // Internally we (ab)use AbsMoveable as the representation of our - // relative address, even though everywhere else in Terraform + // relative address, even though everywhere else in OpenTF // AbsMoveable always represents a fully-absolute address. // In practice, due to the implementation of ParseMoveEndpoint, // this is always either a ModuleInstance or an AbsResourceInstance, diff --git a/internal/addrs/parse_ref.go b/internal/addrs/parse_ref.go index 036de34c9a..79d397067c 100644 --- a/internal/addrs/parse_ref.go +++ b/internal/addrs/parse_ref.go @@ -23,10 +23,10 @@ type Reference struct { } // DisplayString returns a string that approximates the subject and remaining -// traversal of the reciever in a way that resembles the Terraform language +// traversal of the reciever in a way that resembles the OpenTF language // syntax that could've produced it. // -// It's not guaranteed to actually be a valid Terraform language expression, +// It's not guaranteed to actually be a valid OpenTF language expression, // since the intended use here is primarily for UI messages such as // diagnostics. func (r *Reference) DisplayString() string { @@ -209,7 +209,7 @@ func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { case "resource": // This is an alias for the normal case of just using a managed resource // type as a top-level symbol, which will serve as an escape mechanism - // if a later edition of the Terraform language introduces a new + // if a later edition of the OpenTF language introduces a new // reference prefix that conflicts with a resource type name in an // existing provider. In that case, the edition upgrade tool can // rewrite foo.bar into resource.foo.bar to ensure that "foo" remains @@ -346,7 +346,7 @@ func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Reserved symbol name", - Detail: fmt.Sprintf("The symbol name %q is reserved for use in a future Terraform version. If you are using a provider that already uses this as a resource type name, add the prefix \"resource.\" to force interpretation as a resource type name.", root), + Detail: fmt.Sprintf("The symbol name %q is reserved for use in a future OpenTF version. If you are using a provider that already uses this as a resource type name, add the prefix \"resource.\" to force interpretation as a resource type name.", root), Subject: rootRange.Ptr(), }) return nil, diags diff --git a/internal/addrs/parse_ref_test.go b/internal/addrs/parse_ref_test.go index fac1bdca4a..bbb1f0648d 100644 --- a/internal/addrs/parse_ref_test.go +++ b/internal/addrs/parse_ref_test.go @@ -697,7 +697,7 @@ func TestParseRef(t *testing.T) { // the "resource" prefix forces interpreting the next name as a // resource type name. This is an alias for just using a resource // type name at the top level, to be used only if a later edition - // of the Terraform language introduces a new reserved word that + // of the OpenTF language introduces a new reserved word that // overlaps with a resource type name. { `resource.boop_instance.foo`, @@ -721,17 +721,17 @@ func TestParseRef(t *testing.T) { { `template.foo`, nil, - `The symbol name "template" is reserved for use in a future Terraform version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, + `The symbol name "template" is reserved for use in a future OpenTF version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, }, { `lazy.foo`, nil, - `The symbol name "lazy" is reserved for use in a future Terraform version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, + `The symbol name "lazy" is reserved for use in a future OpenTF version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, }, { `arg.foo`, nil, - `The symbol name "arg" is reserved for use in a future Terraform version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, + `The symbol name "arg" is reserved for use in a future OpenTF version. If you are using a provider that already uses this as a resource type name, add the prefix "resource." to force interpretation as a resource type name.`, }, // anything else, interpreted as a managed resource reference diff --git a/internal/addrs/provider.go b/internal/addrs/provider.go index a1f4462b6b..c382b1d253 100644 --- a/internal/addrs/provider.go +++ b/internal/addrs/provider.go @@ -67,14 +67,14 @@ func NewProvider(hostname svchost.Hostname, namespace, typeName string) Provider // As a special case, the string "terraform" maps to // "terraform.io/builtin/terraform" because that is the more likely user // intent than the now-unmaintained "registry.terraform.io/hashicorp/terraform" -// which remains only for compatibility with older Terraform versions. +// which remains only for compatibility with older OpenTF versions. func ImpliedProviderForUnqualifiedType(typeName string) Provider { switch typeName { case "terraform": // Note for future maintainers: any additional strings we add here // as implied to be builtin must never also be use as provider names // in the registry.terraform.io/hashicorp/... namespace, because - // otherwise older versions of Terraform could implicitly select + // otherwise older versions of OpenTF could implicitly select // the registry name instead of the internal one. return NewBuiltInProvider(typeName) default: diff --git a/internal/addrs/provider_config.go b/internal/addrs/provider_config.go index 106ed380e4..2c39a4df3d 100644 --- a/internal/addrs/provider_config.go +++ b/internal/addrs/provider_config.go @@ -233,7 +233,7 @@ func ParseLegacyAbsProviderConfigStr(str string) (AbsProviderConfig, tfdiags.Dia } // ParseLegacyAbsProviderConfig parses the given traversal as an absolute -// provider address in the legacy form used by Terraform v0.12 and earlier. +// provider address in the legacy form used by OpenTF v0.12 and earlier. // The following are examples of traversals that can be successfully parsed as // legacy absolute provider configuration addresses: // @@ -244,8 +244,8 @@ func ParseLegacyAbsProviderConfigStr(str string) (AbsProviderConfig, tfdiags.Dia // // We can encounter this kind of address in a historical state snapshot that // hasn't yet been upgraded by refreshing or applying a plan with -// Terraform v0.13. Later versions of Terraform reject state snapshots using -// this format, and so users must follow the Terraform v0.13 upgrade guide +// OpenTF v0.13. Later versions of OpenTF reject state snapshots using +// this format, and so users must follow the OpenTF v0.13 upgrade guide // in that case. // // We will not use this address form for any new file formats. diff --git a/internal/addrs/provider_test.go b/internal/addrs/provider_test.go index 9754a8cd71..257ca8484e 100644 --- a/internal/addrs/provider_test.go +++ b/internal/addrs/provider_test.go @@ -414,16 +414,16 @@ func TestParseProviderSourceStr(t *testing.T) { true, }, - // We forbid the terraform- prefix both because it's redundant to - // include "terraform" in a Terraform provider name and because we use - // the longer prefix terraform-provider- to hint for users who might be + // We forbid the opentf- prefix both because it's redundant to + // include "opentf" in a OpenTF provider name and because we use + // the longer prefix opentf-provider- to hint for users who might be // accidentally using the git repository name or executable file name // instead of the provider type. - "example.com/hashicorp/terraform-provider-bad": { + "example.com/placeholderplaceholderplaceholder/opentf-provider-bad": { Provider{}, true, }, - "example.com/hashicorp/terraform-bad": { + "example.com/placeholderplaceholderplaceholder/opentf-bad": { Provider{}, true, }, From 985e81a1d06bd87da49d6496d71058ec904cf834 Mon Sep 17 00:00:00 2001 From: Elbaz Date: Mon, 21 Aug 2023 14:50:20 +0300 Subject: [PATCH 2/3] more renames --- internal/addrs/output_value.go | 2 +- internal/addrs/provider_config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/addrs/output_value.go b/internal/addrs/output_value.go index 751d61e797..56b0f0c063 100644 --- a/internal/addrs/output_value.go +++ b/internal/addrs/output_value.go @@ -17,7 +17,7 @@ import ( // // This is related to but separate from ModuleCallOutput, which represents // a module output from the perspective of its parent module. Outputs are -// referencable from the testing scope, in general terraform operation users +// referencable from the testing scope, in general opentf operation users // will be referencing ModuleCallOutput. type OutputValue struct { referenceable diff --git a/internal/addrs/provider_config.go b/internal/addrs/provider_config.go index 2c39a4df3d..d5b3b562eb 100644 --- a/internal/addrs/provider_config.go +++ b/internal/addrs/provider_config.go @@ -352,7 +352,7 @@ func (pc AbsProviderConfig) providerConfig() {} // other than the root module. Even if a valid address is returned, inheritence // may not be performed for other reasons, such as if the calling module // provided explicit provider configurations within the call for this module. -// The ProviderTransformer graph transform in the main terraform module has the +// The ProviderTransformer graph transform in the main opentf module has the // authoritative logic for provider inheritance, and this method is here mainly // just for its benefit. func (pc AbsProviderConfig) Inherited() (AbsProviderConfig, bool) { From b5cb9f61776453232ee9a910615272f0e4fb7ec9 Mon Sep 17 00:00:00 2001 From: Elbaz Date: Mon, 21 Aug 2023 15:01:03 +0300 Subject: [PATCH 3/3] more renames --- internal/addrs/provider_test.go | 10 +++++----- internal/getmodules/file_detector.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/addrs/provider_test.go b/internal/addrs/provider_test.go index 257ca8484e..9754a8cd71 100644 --- a/internal/addrs/provider_test.go +++ b/internal/addrs/provider_test.go @@ -414,16 +414,16 @@ func TestParseProviderSourceStr(t *testing.T) { true, }, - // We forbid the opentf- prefix both because it's redundant to - // include "opentf" in a OpenTF provider name and because we use - // the longer prefix opentf-provider- to hint for users who might be + // We forbid the terraform- prefix both because it's redundant to + // include "terraform" in a Terraform provider name and because we use + // the longer prefix terraform-provider- to hint for users who might be // accidentally using the git repository name or executable file name // instead of the provider type. - "example.com/placeholderplaceholderplaceholder/opentf-provider-bad": { + "example.com/hashicorp/terraform-provider-bad": { Provider{}, true, }, - "example.com/placeholderplaceholderplaceholder/opentf-bad": { + "example.com/hashicorp/terraform-bad": { Provider{}, true, }, diff --git a/internal/getmodules/file_detector.go b/internal/getmodules/file_detector.go index eb059775d4..71f0504741 100644 --- a/internal/getmodules/file_detector.go +++ b/internal/getmodules/file_detector.go @@ -64,5 +64,5 @@ type MaybeRelativePathErr struct { } func (e *MaybeRelativePathErr) Error() string { - return fmt.Sprintf("Terraform cannot detect a supported external module source type for %s", e.Addr) + return fmt.Sprintf("OpenTF cannot detect a supported external module source type for %s", e.Addr) }