-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
autoflex: wire up option functions, add IgnoreFieldNames
option
#36437
Conversation
Community NoteVoting for Prioritization
For Submitters
|
Thank you for your contribution! 🚀 A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored. For additional information refer to the AWS SDK for Go Versions page in the contributor guide. |
66740fd
to
31a345f
Compare
399f866
to
2a07d8e
Compare
2a07d8e
to
c71a7b8
Compare
This change implements AutoFlex options, allowing custom options to be passed to `flex.Expand` or `flex.Flatten`. The changes include: - Adding a new `AutoFlexOptions` struct, which stores all configurable options - Embedding the `AutoFlexOptions` struct into the `autoExpand` and `autoFlatten` flexer structs - Adjusting the `AutoFlexOptionsFunc` signature to accept a pointer to `AutoFlexOptions` As a first use case, the `IgnoreFieldNames` option was added. This option is a slice of strings, with a default value of `[]string{"Tags"}`. This replaces the previously hardcoded logic which skipped processing of any fields named `Tags`, and instead makes this configurable. Test cases have been added to exercise the behavior with default options and overrides to remove defaults and add custom values.
c71a7b8
to
d3e5c8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% go test ./internal/framework/flex
ok github.com/hashicorp/terraform-provider-aws/internal/framework/flex 0.817s
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! |
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. |
Description
This change implements AutoFlex options, allowing custom options to be passed to
flex.Expand
orflex.Flatten
. The changes include:AutoFlexOptions
struct, which stores all configurable optionsAutoFlexOptions
struct into theautoExpand
andautoFlatten
flexer structsAutoFlexOptionsFunc
signature to accept a pointer toAutoFlexOptions
As a first use case, the
IgnoreFieldNames
option was added. This option is a slice of strings, with a default value of[]string{"Tags"}
. This replaces the previously hardcoded logic which skipped processing of any fields namedTags
, and instead makes this configurable. Test cases have been added to exercise the behavior with default options and overrides to remove defaults and add custom values.Relations
Relates #36332
Depends on hashicorp/terraform-plugin-framework#961
Depends on #36992
References
Output from Acceptance Testing