Skip to content

correctly detect vCore Cosmos DB - #355

Merged
alex-thc merged 1 commit into
mainfrom
azure_docdb_handling
Dec 9, 2025
Merged

correctly detect vCore Cosmos DB#355
alex-thc merged 1 commit into
mainfrom
azure_docdb_handling

Conversation

@alex-thc

@alex-thc alex-thc commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

New Features

  • Added support for Azure Cosmos DB with two deployment options: RU (Request Unit) and VCORE configurations.
  • Enhanced MongoDB connector to recognize and support both standard MongoDB and the new Cosmos DB VCORE variant.
  • Updated connection string validation to properly handle both Cosmos DB deployment types.

✏️ Tip: You can customize this high-level summary in your review settings.

@alex-thc
alex-thc enabled auto-merge (squash) December 9, 2025 05:42
@coderabbitai

coderabbitai Bot commented Dec 9, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

The changes expand Cosmos DB support by distinguishing between two deployment models: RU (reserved units) and VCORE (virtual cores). The flavor detection logic is updated with separate regex patterns for each variant, constants are added/renamed accordingly, and connector validation rules are updated to recognize the new FlavorCosmosDB_VCORE variant.

Changes

Cohort / File(s) Summary
Cosmos DB flavor classification
connectors/mongo/util.go
Introduces COSMOS_DB_RU_REGEX and COSMOS_DB_VCORE_REGEX to distinguish between RU and VCORE Cosmos DB deployment models; adds FlavorCosmosDB_RU and FlavorCosmosDB_VCORE constants; removes legacy COSMOS_DB_REGEX; updates GetMongoFlavor logic to return appropriate variant constant.
Connector flavor validation
internal/app/options/connectorflags.go
Updates CosmosDB.IsConnector to check for FlavorCosmosDB_RU; extends MongoDB.IsConnector to accept FlavorCosmosDB_VCORE as a valid MongoDB connector variant.
State store validation
statestores/mongo/statestore.go
Updates Setup connection string validation to accept FlavorCosmosDB_RU instead of the legacy constant.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Constant renaming impact: FlavorCosmosDB → FlavorCosmosDB_RU is a breaking API change; verify all usages across the codebase are updated
  • Flavor classification logic: Confirm regex patterns correctly distinguish between .mongo.cosmos.azure.com (RU) and .mongocluster.cosmos.azure.com (VCORE) endpoints
  • Connector acceptance rules: Ensure MongoDB connector accepting FlavorCosmosDB_VCORE doesn't introduce unintended side effects or security implications

Poem

🐰 Two Cosmos paths now shine so bright,
RU and VCORE, both treated right!
Where once was one, now two flavors dance,
Regex patterns guide them in their prance.
Connections validated with newfound glee,
Azure's mongo worlds now roam carefree! 🌙

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch azure_docdb_handling

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f3b205 and 96eb07f.

📒 Files selected for processing (3)
  • connectors/mongo/util.go (2 hunks)
  • internal/app/options/connectorflags.go (2 hunks)
  • statestores/mongo/statestore.go (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alex-thc
alex-thc merged commit 6127c38 into main Dec 9, 2025
1 of 2 checks passed
@alex-thc
alex-thc deleted the azure_docdb_handling branch December 9, 2025 05:43
@coderabbitai coderabbitai Bot mentioned this pull request Mar 27, 2026
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