-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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/framework/flex: support set of enum expansion #36789
Conversation
This change enables expansion of sets of strin enum types with AutoFlex. ```console % go test ./internal/framework/flex/... -run=TestExpandSetOfStringEnum --- FAIL: TestExpandSetOfStringEnum (0.00s) --- FAIL: TestExpandSetOfStringEnum/empty_value (0.00s) panic: reflect.Set: value of type []string is not assignable to type []flex.testEnum [recovered] panic: reflect.Set: value of type []string is not assignable to type []flex.testEnum goroutine 6 [running]: testing.tRunner.func1.2({0x1014e13a0, 0x140006ba040}) /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1631 +0x1c4 testing.tRunner.func1() /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1634 +0x33c panic({0x1014e13a0?, 0x140006ba040?}) /opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x124 reflect.Value.assignTo({0x1014dca40?, 0x140006c20a8?, 0x18?}, {0x100ffa971, 0xb}, 0x1014daf40, 0x0) /opt/homebrew/Cellar/go/1.22.2/libexec/src/reflect/value.go:3356 +0x20c reflect.Value.Set({0x1014daf40?, 0x1400000ee58?, 0x0?}, {0x1014dca40?, 0x140006c20a8?, 0x2?}) /opt/homebrew/Cellar/go/1.22.2/libexec/src/reflect/value.go:2325 +0xcc github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoExpander.setOfString({}, {0x101587de0, 0x101a3f100}, {{0x101a3f100, 0x0, 0x0}, {0x101589b78, 0x101a3f100}, 0x 2}, {0x1014daf40?, ...}) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/auto_expand.go:550 +0x4fc github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoExpander.set({}, {0x101587de0, 0x101a3f100}, {0x10158be50, 0x14000498b40}, {0x1014daf40?, 0x1400000ee58?, 0x8 ef00?}) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/auto_expand.go:507 +0x344 github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoExpander.convert({}, {0x101587de0, 0x101a3f100}, {0x101566840?, 0x14000498b40?, 0x140006b6d08?}, {0x1014daf40 ?, 0x1400000ee58?, 0x140006b6e10?}) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/auto_expand.go:93 +0x49c github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvert({0x101587de0, 0x101a3f100}, {0x101566840, 0x14000498b40}, {0x1014daf80, 0x1400000ee58}, {0x101583 f88, 0x101a3f100}) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/autoflex.go:54 +0x214 github.com/hashicorp/terraform-provider-aws/internal/framework/flex.Expand({0x101587de0, 0x101a3f100}, {0x101566840, 0x14000498b40}, {0x1014daf80, 0x1400000ee58}, {0x0, 0x0, 0x14000 05df18?}) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/auto_expand.go:35 +0xb0 github.com/hashicorp/terraform-provider-aws/internal/framework/flex.runAutoExpandTestCases.func1(0x140000a96c0) /Users/jaredbaker/development/terraform-provider-aws/internal/framework/flex/auto_expand_test.go:898 +0x8c testing.tRunner(0x140000a96c0, 0x140004b52d0) /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1689 +0xec created by testing.(*T).Run in goroutine 4 /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1742 +0x318 FAIL github.com/hashicorp/terraform-provider-aws/internal/framework/flex 0.303s FAIL ``` After: ```console % go test ./internal/framework/flex/... -run=TestExpandSetOfStringEnum ok github.com/hashicorp/terraform-provider-aws/internal/framework/flex 0.480s ```
Community NoteVoting for Prioritization
For Submitters
|
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 🚀.
This functionality has been released in v5.45.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 enables expansion of sets of string enum types with AutoFlex.
After:
Relations
Relates #36557 (Added a similar enhancement for lists, but without tests 🙈 )
Relates #36731 (Fix depends on this)