-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Convert from blocks to nested attributes in advancedClusterToV2 command #61
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
This PR implements conversion functionality for the advancedClusterToV2
command, transforming MongoDB Atlas advanced cluster configurations from blocks to nested attributes in Terraform configurations. This is part of migrating from SDKv2 schema to Terraform Plugin Framework (TPF) schema.
Key changes:
- Implements core conversion logic in
adv2v2.go
to transform block syntax to nested attribute syntax - Adds comprehensive test data covering various scenarios including basic clusters, specs, tags/labels, and advanced configurations
- Refactors shared constants from
clu2adv.go
toconst.go
for reuse
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/convert/adv2v2.go |
Core implementation of block-to-nested-attribute conversion logic |
internal/convert/const.go |
Moved shared constants from clu2adv.go and added new ones for adv2v2 functionality |
internal/convert/clu2adv.go |
Removed constants now in const.go and minor reordering of function calls |
internal/cli/clu2adv/clu2adv.go |
Fixed struct field embedding syntax |
test/e2e/testdata/adv2v2.* |
E2E test data showing input and expected output transformations |
internal/convert/testdata/adv2v2/* |
Unit test data covering various conversion scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <[email protected]>
internal/convert/adv2v2.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if updated { |
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.
nit: maybe a comment here to explain what's handling?
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.
added here: e5fa697
Description
Convert from blocks to nested attributes in advancedClusterToV2 command
Link to any related issue(s): CLOUDP-337883
Type of change:
Required Checklist:
Further comments