Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Unreferenced terraform Package Functionality #165

Closed
bflad opened this issue Aug 21, 2023 · 1 comment · Fixed by #171
Closed

Deprecate Unreferenced terraform Package Functionality #165

bflad opened this issue Aug 21, 2023 · 1 comment · Fixed by #171
Assignees
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Aug 21, 2023

terraform-plugin-testing version

v1.4.0

Use cases

The terraform package in this Go module contains legacy, unused functionality that has been continually passed down since the code was originally in the core codebase. This functionality is not intended for external consumption, but it has been passed down in its original exported API form. To help prevent unexpected consumption of this functionality, it should be marked as deprecated for removal. Any future major version of this Go module will remove the entire terraform package.

Proposal

Add Go documentation deprecation comments to all terraform package functionality that is not referenced by helper/resource currently.

bflad added a commit that referenced this issue Aug 28, 2023
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.

If there is a valid use case for this functionality, developers should create a GitHub issue for tracking.
@bflad bflad added this to the v1.5.0 milestone Aug 28, 2023
@bflad bflad self-assigned this Aug 28, 2023
bflad added a commit that referenced this issue Aug 29, 2023
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.
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant