Skip to content

Conversation

lantoli
Copy link
Collaborator

@lantoli lantoli commented Jan 30, 2025

Description

Convert free clusters with count

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

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

@lantoli lantoli marked this pull request as ready for review February 3, 2025 19:39
@lantoli lantoli requested a review from a team as a code owner February 3, 2025 19:39
return nil
}

func moveAttribute(fromAttrName, toAttrName string, fromBody, toBody *hclwrite.Body, errPrefix string) error {
Copy link
Contributor

@EspenAlbert EspenAlbert Feb 3, 2025

Choose a reason for hiding this comment

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

I like the abstraction signature and you don't need to worry about the type of the attribute!

labels[0] = advCluster
resource.SetLabels(labels)

if isFreeTier(resourceBody) {
Copy link
Contributor

Choose a reason for hiding this comment

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

cool approach of starting with one specific case.
I guess some operations might be more generally applicable, like moving instance_size, but we'll find out once we add more cases!

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, I'll go now with one with num_shards

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.

Awesome!

{
"configuration_file_error": "failed to parse Terraform config file",
"free_cluster_missing_attribute": "free cluster (because no replication_specs): attribute backing_provider_name not found"
}
Copy link
Collaborator Author

@lantoli lantoli Feb 4, 2025

Choose a reason for hiding this comment

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

errors file instead of having individual out files with just the error message, so it's easier to have multiple input files with errors and don't have many files, and have a place to see all error messages.

@lantoli lantoli merged commit 3318080 into main Feb 4, 2025
6 checks passed
@lantoli lantoli deleted the CLOUDP-297859_free_clusters_count branch February 4, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants