Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform: Add deprecation Go documentation comments (#171)
Reference: #165 Except in certain known provider testing use cases without replacement (yet), this deprecates various `terraform` package functionality. The `terraform` package contains legacy Terraform core logic which has been copied to terraform-plugin-sdk and terraform-plugin-testing over the years and continually exported due to the complexity of rewriting developer functionality using the machine-readable interfaces for Terraform, such as JSON state. Much of this now-deprecated `terraform` package logic should have been omitted when this Go module was created, but that step was missed, so it is left as-is with deprecation notices following the Go module versioning guidelines. In reality, the entire `terraform` package will be removed in a future major version, however this change pragmatically leaves certain functionality without deprecation notices for now until replacement functionality is available so developers will not need to silence linting tools without it being actionable yet. This change opts to not include a changelog entry here because it could be more confusing for developers, who might feel like they need to go check for usage when it likely affects only a very small (if any) portion of the population. Their usage externally would be unexpected as all of these are unintentionally part of the exported Go API having been just copied Terraform core "internal" code from some historical time and it is not likely any future changes will occur to their logic since they fall outside the intention of the Go module being acceptance testing of Terraform Providers. If/when it becomes time to deprecate the `terraform.State` type, which is externally prevalent due to `helper/resource.TestCheckFunc`, that certainly warrants a changelog entry (and maybe even website documentation and upgrade tooling) with its replacement. This change attempted to be careful and leave other somewhat prevalent functionality under the `TestCheckFunc` expected use case, such as `(terraform.State).RootModule()`, also without deprecation comments for now since there is no replacement yet. If there are other similar parts of this now-deprecated functionality which adversely affect provider acceptance testing use cases, the deprecation comments can be removed until replacement functionality is in place. To that end, if there is a valid use case for this now-deprecated functionality, developers should create a GitHub issue for tracking.
- Loading branch information