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

helper/resource: Deprecate non-testing constants, functions, and types #96

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 9, 2023

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.

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.
@bflad bflad added this to the v1.2.0 milestone Mar 9, 2023
@bflad bflad requested a review from a team as a code owner March 9, 2023 16:09
Copy link
Contributor

@bendbennett bendbennett left a 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. 

@bflad
Copy link
Contributor Author

bflad commented Mar 10, 2023

Yeah, that's definitely a good call.

@bflad bflad requested a review from bendbennett March 10, 2023 13:19
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@bflad bflad merged commit 5795151 into main Mar 17, 2023
@bflad bflad deleted the bflad/deprecate-non-testing-helper-resource-bits branch March 17, 2023 17:45
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, 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 Apr 17, 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 this pull request may close these issues.

2 participants