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: enum type validation patch #37209

Merged
merged 1 commit into from
May 1, 2024
Merged

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented May 1, 2024

Description

This enhancement adds patches to migrate validation functions for enum types to the enum.Validate function.

Due to a gopatch limitation, the field which the validation function is assigned to (ValidateFunc) cannot be migrated to the proper field (ValidateDiagFunc). The generated patches include a comment indicating that this step will need to be done manually once the patch is applied, at least until the underlying gopatch limitation is addressed.

Related section in the AWS SDK migration guide:

Relations

Relates #32976

This enhancement adds patches to migrate validation functions for enum types to the `enum.Validate` function.

Due to a `gopatch` limitation, the field which the validation function is assigned to (`ValidateFunc`) cannot be migrated to the proper field (`ValidateDiagFunc`). The generated patches include a comment indicating that this step will need to be done manually once the patch is applied, at least until the underlying `gopatch` limitation is addressed.

Related section in the AWS SDK migration guide:
- https://hashicorp.github.io/terraform-provider-aws/aws-go-sdk-migrations/#validation-functions
@jar-b jar-b added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label May 1, 2024
Copy link

github-actions bot commented May 1, 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.

@jar-b jar-b added the enhancement Requests to existing resources that expand the functionality or scope. label May 1, 2024
@github-actions github-actions bot added the size/S Managed by automation to categorize the size of a PR. label May 1, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 1, 2024
@jar-b jar-b changed the title awssdkpatch: enum type validation awssdkpatch: enum type validation patch May 1, 2024
@jar-b jar-b merged commit 3c35893 into main May 1, 2024
77 checks passed
@jar-b jar-b deleted the f-awssdkpatch-enum-types branch May 1, 2024 20:54
@github-actions github-actions bot added this to the v5.48.0 milestone May 1, 2024
# Step 4: Migrate enum validation
#
# This will only be partially correct. The enum.Validate function implements
# ValidateDiagFunc, while StringInSliace implements ValidateFunc. Due to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# ValidateDiagFunc, while StringInSliace implements ValidateFunc. Due to
# ValidateDiagFunc, while StringInSlice implements ValidateFunc. Due to

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching these - too quick on the merge 🤦 . I just came across another patch to add and will fix as part of that PR.

#
# This will only be partially correct. The enum.Validate function implements
# ValidateDiagFunc, while StringInSliace implements ValidateFunc. Due to
# limitiations with how gopatch handles multiple matches within an elision, we
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# limitiations with how gopatch handles multiple matches within an elision, we
# limitations with how gopatch handles multiple matches within an elision, we

Copy link

github-actions bot commented May 2, 2024

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

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 2, 2024
Copy link

github-actions bot commented Jun 2, 2024

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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. enhancement Requests to existing resources that expand the functionality or scope. size/S 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