Skip to content

Conversation

lantoli
Copy link
Collaborator

@lantoli lantoli commented Aug 20, 2025

Description

Update clu2adv command so it doesn't produce deprecated attributes.

  • Remove use_replication_spec_per_shard from data source.
  • Remove default_read_concern and fail_index_key_too_long from advanced_configuration if exists. This applies to both commands clu2adv and adv2v2.
  • num_shards and root disk_size_gb are not being produced so nothing to do there.
  • computed attributes (e.g. replication_specs.#.id) are not produced either.

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

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 Aug 20, 2025
@lantoli lantoli marked this pull request as ready for review August 20, 2025 12:47
@Copilot Copilot AI review requested due to automatic review settings August 20, 2025 12:47
@lantoli lantoli requested a review from a team as a code owner August 20, 2025 12:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the clu2adv and adv2v2 commands to remove deprecated MongoDB Atlas attributes from generated Terraform configurations, improving compatibility and preventing the output of attributes that are no longer supported.

  • Removes use_replication_spec_per_shard from data source configurations
  • Filters out deprecated fail_index_key_too_long and default_read_concern attributes from advanced_configuration blocks
  • Introduces a specialized function to handle advanced configuration processing with deprecation filtering

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/convert/const.go Adds constants for deprecated attributes and removes unused constant
internal/convert/clu2adv.go Implements advanced config filtering and removes deprecated data source attribute
internal/convert/adv2v2.go Updates to use new advanced config filtering function
internal/convert/testdata/clu2adv/dynamic_regions_config_auto_scaling.in.tf Test data showing deprecated attributes to be filtered
internal/convert/testdata/clu2adv/data_sources.out.tf Expected output without deprecated data source attribute
internal/convert/testdata/clu2adv/adv_config_bi_connector_pinned_fcv.in.tf Test data with deprecated advanced config attributes
internal/convert/testdata/adv2v2/adv_config_bi_connector_pinned_fcv.in.tf Test data with deprecated advanced config attributes for adv2v2 conversion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@AgustinBettati AgustinBettati 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 lantoli merged commit 97d04dc into main Aug 21, 2025
7 checks passed
@lantoli lantoli deleted the CLOUDP-339568_remove branch August 21, 2025 06:12
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.

4 participants