-
Notifications
You must be signed in to change notification settings - Fork 11
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
helper/resource: Deprecate non-testing constants, functions, and types #96
Conversation
The initial creation of the `terraform-plugin-testing` Go module was a migration of some existing packages within the `terraform-plugin-sdk` Go module. The `helper/resource` package itself contained multiple abstractions, some related to testing resources (the parts we want in this Go module) and some related to developing resources (the parts we do not want in this Go module). Version 1.0.0 with compatibility promises shipped before this extraneous code was pruned, so it is being deprecated in adherence to our versioning policy. It will not be included in any future major version of this Go module. Each constant, function, method, and type includes a Go documentation deprecation comment with an explicit action for the developer. This is generally either copying the code or continuing to use the `terraform-plugin-sdk` Go module for effected usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Is it worth adding to the migration docs (website/docs/plugin/testing/migrating.mdx
) along the lines of:
- Change all instances of the following Go import statements in `*.go` files:
- `github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource` to `github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry` where `resource.NotFoundError`, `resource.UnexpectedStateError`, `resource.TimeoutError`, `resource.StateRefreshFunc`, `resource.StateChangeConf `, `resource.RetryContext `, `resource.RetryFunc`, `resource.RetryError`, `resource.RetryableError` and `resource.NonRetryableError` are being used.
- `github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource` to `github.com/hashicorp/terraform-plugin-sdk/v2/helper/id` where `resource.UniqueIdPrefix`, `resource.UniqueId`, `resource.UniqueIDSuffixLength` and `resource.PrefixedUniqueId` are being used.
Yeah, that's definitely a good call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
The initial creation of the
terraform-plugin-testing
Go module was a migration of some existing packages within theterraform-plugin-sdk
Go module. Thehelper/resource
package itself contained multiple abstractions, some related to testing resources (the parts we want in this Go module) and some related to developing resources (the parts we do not want in this Go module). Version 1.0.0 with compatibility promises shipped before this extraneous code was pruned, so it is being deprecated in adherence to our versioning policy. It will not be included in any future major version of this Go module.Each constant, function, method, and type includes a Go documentation deprecation comment with an explicit action for the developer. This is generally either copying the code or continuing to use the
terraform-plugin-sdk
Go module for effected usage.