Skip to content

chore: PoC effective_replication_specs#4123

Draft
lantoli wants to merge 54 commits intomasterfrom
CLOUDP-376263_poc_effective_rep_specs
Draft

chore: PoC effective_replication_specs#4123
lantoli wants to merge 54 commits intomasterfrom
CLOUDP-376263_poc_effective_rep_specs

Conversation

@lantoli
Copy link
Copy Markdown
Member

@lantoli lantoli commented Jan 28, 2026

Description

PoC effective_replication_specs

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

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 force-pushed the CLOUDP-376263_poc_effective_rep_specs branch from 97b91c6 to 2d74302 Compare January 28, 2026 20:24
@lantoli lantoli added the not_stale Not stale issue or PR label Jan 29, 2026
@lantoli lantoli force-pushed the CLOUDP-376263_poc_effective_rep_specs branch from dcb8b91 to 2a41551 Compare January 30, 2026 14:53
  - cluster_id
  - create_date

  Changed from Optional+Computed to Optional-only:
  - backup_enabled
  - config_server_management_mode
  - encryption_at_rest_provider
  - global_cluster_self_managed_sharding
  - mongo_db_major_version
  - paused
  - pit_enabled
  - redact_client_log_data
  - replica_set_scaling_strategy
  - termination_protection_enabled
  - version_release_system
@lantoli lantoli force-pushed the CLOUDP-376263_poc_effective_rep_specs branch from 2a41551 to 1f15aed Compare January 30, 2026 17:56
@lantoli lantoli force-pushed the CLOUDP-376263_poc_effective_rep_specs branch from 011853b to f830181 Compare February 7, 2026 10:00
@lantoli lantoli force-pushed the CLOUDP-376263_poc_effective_rep_specs branch from 4e66e98 to 535fa02 Compare February 7, 2026 17:19
Copilot AI review requested due to automatic review settings February 13, 2026 12:02
Copy link
Copy Markdown
Contributor

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

This PR implements a proof-of-concept for "effective_replication_specs" as part of the v3.0.0 major version upgrade. It represents a significant architectural change to how the mongodbatlas_advanced_cluster resource handles auto-scaling and state management.

Changes:

  • Removes use_effective_fields attribute and implements its behavior as the default
  • Changes resource replication_specs children to Optional-only (not Computed)
  • Adds effective_replication_specs to data sources showing actual running configuration
  • Implements comprehensive null preservation logic for Optional-only attributes
  • Updates state upgraders to migrate from v1/v2 to v3 schema

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
internal/service/advancedcluster/schema.go Schema version bump to 3, removes use_effective_fields, changes attributes to Optional-only
internal/service/advancedcluster/resource_compatiblity.go Implements extensive null preservation logic for Optional-only attributes
internal/service/advancedcluster/resource.go Removes use_effective_fields handling, adds recalculation logic for patches
internal/service/advancedcluster/common_admin_sdk.go Adds patch recalculation to avoid unnecessary API calls, uses new API header
internal/service/advancedcluster/model_*.go Updates model conversions for new schema structure, adds sorting for deterministic ordering
internal/service/advancedcluster/move_upgrade_state.go Simplifies state upgrader by removing v2-specific logic
internal/service/advancedcluster/plan_modifier*.go Replaces complex plan modifier with simple validation for removed specs
internal/service/advancedcluster/*_test.go Updates tests with TODO markers for import and mock data issues
docs/* Comprehensive documentation updates and new upgrade guide
examples/* Updates examples to remove use_effective_fields, adds effective_replication_specs examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/service/advancedcluster/common_admin_sdk.go
Comment thread docs/resources/advanced_cluster.md Outdated
Comment thread internal/service/advancedcluster/resource_compatiblity.go
Comment thread internal/service/advancedcluster/move_upgrade_state.go
Comment thread docs/resources/advanced_cluster.md Outdated
Comment thread internal/service/advancedcluster/resource.go
lantoli and others added 27 commits February 13, 2026 16:24
# Conflicts:
#	docs/resources/advanced_cluster.md
# Conflicts:
#	internal/service/advancedcluster/model_ClusterDescription20240805.go
#	internal/service/advancedcluster/schema.go
…ffective_rep_specs

# Conflicts:
#	internal/common/conversion/type_conversion.go
#	internal/service/advancedcluster/model_to_ClusterDescription20240805.go
#	internal/service/advancedcluster/plural_data_source.go
…ffective_rep_specs

# Conflicts:
#	internal/provider/provider_sdk2.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not_stale Not stale issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants