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

Use aws-sdk-go-base/tfawserr in internal packages #13036

Merged
merged 5 commits into from
Oct 5, 2020

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 27, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

After all the work on the aws-sdk-go-base/tfawserr package that was initiated by the initial versions of this PR it can now be recast as changing the internal packages to use this new package instead of implementing private helpers.
I have simplified this PR by not aliasing the isAWSErr* functions in awserr.go and moving the Plugin SDK resource helpers to a separate PR (#15477).

Once this is merged I will add a technical debt issue to replace the isAWSErr calls with calls to functions in aws-sdk-go-base/tfawserr.

Release note for CHANGELOG:

NONE

Output from acceptance testing:

An example resource:

 n/a

@ewbankkit ewbankkit requested a review from a team April 27, 2020 15:15
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 27, 2020
@bflad bflad added technical-debt Addresses areas of the codebase that need refactoring or redesign. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 28, 2020
@bflad bflad self-assigned this Apr 28, 2020
@ewbankkit

This comment has been minimized.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

This is fantastic. 🥇 🥇 🥇

@gdavison
Copy link
Contributor

gdavison commented Jun 2, 2020

This is great, @ewbankkit!

What do you think about moving these error functions to github.com/hashicorp/aws-sdk-go-base and making them the canonical versions? Possibly moving them into their own package. Then we have a single definition everywhere.

@ewbankkit

This comment has been minimized.

@ewbankkit ewbankkit changed the title Add internal 'errors' package [WIP] Add internal 'errors' package Jun 2, 2020
@ewbankkit

This comment has been minimized.

@ghost ghost added dependencies Used to indicate dependency changes. size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Jun 12, 2020
@ewbankkit

This comment has been minimized.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels Jul 19, 2020
@ewbankkit

This comment has been minimized.

@ewbankkit ewbankkit changed the title [WIP] Add internal 'errors' package Add internal 'errors' package Aug 18, 2020
@ewbankkit

This comment has been minimized.

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Sep 12, 2020
@ewbankkit

This comment has been minimized.

@bflad bflad removed the dependencies Used to indicate dependency changes. label Oct 2, 2020
Alias 'isAWSErr*' and 'isResource*Error' to functions in the internal errors package.

Change the code generator, not the generated code.

'internal/errors' -> 'internal/tfawserror'.

'tfawserr.IsAWSErr' -> 'tfawserr.IsAWSErrCodeMessageContains'.

Use 'hashicorp/aws-sdk-go-base/tfawserr' in keyvaluetags package.

Run 'make gen'.

Use 'hashicorp/aws-sdk-go-base/tfawserr' for 'isAWSErr*'.

Use 'tfawserr.ErrCodeEquals' in '[Rr]etryOnAwsCode(s)'.

Rename package for resource error functions.

Fix after rebase.
* No changes to `awserr.go` or `utils.go`
* Move addition of `internal/tfresource` package to a seperate PR
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Oct 4, 2020
@ewbankkit ewbankkit changed the title Add internal 'errors' package Use aws-sdk-go-base/tfawserr in internal packages Oct 4, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Awesome!! 🚀

@ghost
Copy link

ghost commented Oct 9, 2020

This has been released in version 3.10.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 4, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/M Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants