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

awssdkpatch: Fix aliased import substitutions #37239

Merged
merged 6 commits into from
May 8, 2024

Conversation

mattburgess
Copy link
Collaborator

@mattburgess mattburgess commented May 2, 2024

dms imports its service package with an alias. The current patch template didn't cope with templated imports. gopatch supports changing both named and unnamed imports so this converts over to using that generic solution.

On top of that, fix up the other patches so that they match aliased names rather than fully-qualified names.

Description

Relations

Relates #32976

Copy link

github-actions bot commented May 2, 2024

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added the size/S Managed by automation to categorize the size of a PR. label May 2, 2024
dlm imports its service package with an alias. The current patch
template didn't cope with templated imports. gopatch [supports](https://github.com/uber-go/gopatch/blob/main/docs/PatchesInDepth.md#changing-any-import)
changing both named and unnamed imports so this converts over to using
that generic solution.

On top of that, fix up the other patches so that they match aliased
names rather than fully-qualified names.
@terraform-aws-provider terraform-aws-provider bot added needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels May 2, 2024
@mattburgess mattburgess force-pushed the awssdkpatch-fix-aliased-imports branch from 1c47d19 to bca429e Compare May 2, 2024 21:24
@mattburgess mattburgess requested a review from jar-b May 2, 2024 21:24
@jar-b jar-b added aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. and removed needs-triage Waiting for first response or review from a maintainer. labels May 3, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

Overall LGTM - just a couple suggestions on naming of metavariables and extra condition checks in the patch template.

tools/awssdkpatch/patch.tmpl Outdated Show resolved Hide resolved
tools/awssdkpatch/patch.tmpl Outdated Show resolved Hide resolved
tools/awssdkpatch/patch.tmpl Outdated Show resolved Hide resolved
tools/awssdkpatch/main.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels May 8, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@jar-b
Copy link
Member

jar-b commented May 8, 2024

Thanks for your contribution, @mattburgess ! 👍

@jar-b jar-b merged commit e18de71 into hashicorp:main May 8, 2024
15 checks passed
@github-actions github-actions bot added this to the v5.49.0 milestone May 8, 2024
Copy link

This functionality has been released in v5.49.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. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. external-maintainer Contribution from a trusted external contributor. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants