Skip to content

fix: Skip connection update for alias migration - #4739

Draft
jwongmongodb wants to merge 1 commit into
masterfrom
fix/stream-connection-alias-state
Draft

jwongmongodb wants to merge 1 commit into
masterfrom
fix/stream-connection-alias-state

Conversation

@jwongmongodb

@jwongmongodb jwongmongodb commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Ticket

CLOUDP-446873

Summary

  • Builds on the v2.18.0 stream workspace alias migration support from #4682, which prevents replacement when an unchanged connection moves from instance_name to workspace_name.
  • Detects the remaining alias-only connection update and updates Terraform state without calling the Atlas connection PATCH endpoint.
  • Handles an unknown Azure region in the update plan as unchanged when determining whether the transition is alias-only.
  • Updates the existing migration guide, adds unit coverage, and includes a bug-fix changelog entry.

Testing

  • go test ./internal/service/streamconnection ./internal/service/streamprocessor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Computed Azure regions can bypass the optimization, and the incorrectly named changelog file currently fails CI.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Skips unnecessary Atlas PATCH requests during stream connection alias migration.

Changes:

  • Detects alias-only state transitions.
  • Updates Terraform state without calling Atlas.
  • Adds unit coverage and a changelog entry.
File summaries
File Description
resource_stream_connection.go Bypasses PATCH for alias-only transitions.
model_stream_connection.go Adds transition detection logic.
model_alias_transition_test.go Tests transition classification.
.changelog/446873.txt Documents the bug fix.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .changelog/4739.txt
@@ -0,0 +1,3 @@
```release-note:bug
Comment on lines +33 to +36
// ID is computed and may be unknown in an update plan even though no
// connection setting changed.
planWithoutAliases.ID = state.ID
return reflect.DeepEqual(planWithoutAliases, *state)
@jwongmongodb
jwongmongodb force-pushed the fix/stream-connection-alias-state branch from 062a288 to b5b459a Compare September 16, 2026 20:48
Treats an instance_name to workspace_name transition with the same effective workspace and unchanged connection settings as a state-only update. This avoids an Atlas PATCH that active processors prohibit.
@jwongmongodb
jwongmongodb force-pushed the fix/stream-connection-alias-state branch from b5b459a to fb8f692 Compare September 16, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants