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

internal/keyvaluetags: Allow KeyValueTags type passthrough in New(), add unit testing, and fix potential panic #19011

Merged
merged 2 commits into from
Apr 20, 2021

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 20, 2021

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

Reference: #18726 (comment)

The current behavior is to return an empty KeyValueTags if the type is unrecognized in New() in preference over panicking or requiring all consumers to implement error handling. This augments New() to accept the named KeyValueTags in addition to its underlying map[string]*TagData type, preventing confusing behavior on an otherwise easy to miss resource/service implementation detail.

Added unit testing to cover various New() type scenarios. Fixed panic discovered while implementing the unit testing.

…add unit testing, and fix potential panic

Reference: #18726 (comment)

The current behavior is to return an empty `KeyValueTags` if the type is unrecognized in `New()` in preference over panicking or requiring all consumers to implement error handling. This augments `New()` to accept the named `KeyValueTags` in addition to its underlying `map[string]*TagData` type, preventing confusing behavior on an otherwise easy to miss resource/service implementation detail.

Added unit testing to cover various `New()` type scenarios. Fixed panic discovered while implementing the unit testing.
@bflad bflad requested a review from a team as a code owner April 20, 2021 14:36
@ghost ghost added size/L Managed by automation to categorize the size of a PR. 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 20, 2021
Copy link
Contributor

@ewbankkit ewbankkit 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 fdaa221 into main Apr 20, 2021
@bflad bflad deleted the f-keyvaluetags-New-KeyValueTags branch April 20, 2021 23:43
@github-actions github-actions bot added this to the v3.38.0 milestone Apr 20, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 3.38.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!

@github-actions
Copy link

github-actions bot commented Jun 1, 2021

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 issues.
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 Jun 1, 2021
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. size/L Managed by automation to categorize the size of a PR. 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.

2 participants