Skip to content

Conversation

lantoli
Copy link
Collaborator

@lantoli lantoli commented Feb 24, 2025

Description

Adds optionally moved blocks. It also adds skeleton for 2e2 tests, tests that execute the plugin binary.

Link to any related issue(s): CLOUDP-302368

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@github-actions github-actions bot added the enhancement New feature or request label Feb 24, 2025
Aliases: []string{"tf"},
}
terraformCmd.AddCommand(clu2adv.Builder(), adv2.Builder())
terraformCmd.AddCommand(clu2adv.Builder())
Copy link
Collaborator Author

@lantoli lantoli Feb 24, 2025

Choose a reason for hiding this comment

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

remove skeleton for adv_cluster v1 to v2 conversion to avoid customer confusion as it won't be implemented yet

@lantoli lantoli marked this pull request as ready for review February 24, 2025 10:46
@lantoli lantoli requested a review from a team as a code owner February 24, 2025 10:46
expectedErrContains: "file must not exist: " + fileExpected,
},
"basic use": {
args: []string{"--file", fileIn, "--output", fileOut},
Copy link
Contributor

Choose a reason for hiding this comment

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

Add flag for moved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, added here: d0617be

}

resource "mongodbatlas_advanced_cluster" "forEach" {
# for_each doesn't affect moved blocks, it works in the same way
Copy link
Contributor

Choose a reason for hiding this comment

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

So this means it will handle all the dynamic values?
0 index and different keys?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, moved will move state for all the indexes (including 0 that won't do anything but won't fail)

return false
}

func fillMovedBlocks(body *hclwrite.Body, moveLabels []string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Copy link
Contributor

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

God job! Not sure if it makes sense to add a comment about uncommenting the old resource when using moved.

Copy link
Contributor

@oarbusi oarbusi left a comment

Choose a reason for hiding this comment

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

LGTM

@lantoli
Copy link
Collaborator Author

lantoli commented Feb 24, 2025

Not sure if it makes sense to add a comment about uncommenting the old resource when using moved.

@EspenAlbert added here: a3b1635

@lantoli lantoli merged commit f7830c6 into main Feb 24, 2025
7 checks passed
@lantoli lantoli deleted the CLOUDP-302368_moved branch February 24, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants