-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Handle errors for unsupported dynamic block use cases #69
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
Conversation
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.
Pull Request Overview
Adds validation to prevent invalid dynamic block configurations in Terraform conversion utilities. The feature ensures that dynamic blocks cannot coexist with inline blocks for the same configuration type, which would result in invalid Terraform syntax.
- Adds new error types and messages for dynamic block validation
- Implements checks to enforce dynamic blocks as the only block type when present
- Includes comprehensive test cases for all invalid configuration scenarios
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/convert/shared.go | Defines new error variable for dynamic block validation |
internal/convert/clu2adv.go | Adds validation checks for replication_specs and regions_config dynamic blocks |
internal/convert/adv2v2.go | Adds validation checks for replication_specs and region_configs dynamic blocks |
internal/convert/convert_test.go | Enhances test framework to ensure all error messages are tested |
internal/convert/testdata/*/errors.json | Adds error messages for new validation scenarios |
internal/convert/testdata//.in.tf | Provides test cases for invalid dynamic block configurations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
for name := range errMap { | ||
unusedErrors[name] = struct{}{} | ||
} | ||
|
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.
make sure all items in errors.json are used
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
Description
Handle errors for unsupported dynamic block use cases. This is in line with the dynamic block limitations described in the documentation.
Link to any related issue(s): CLOUDP-341042
Type of change:
Required Checklist:
Further comments