Skip to content

Cosmos: Cutover remaining ContainerClient operations#4287

Merged
simorenoh merged 4 commits into
release/azure_data_cosmos-previewsfrom
cutover-container-ops
Apr 30, 2026
Merged

Cosmos: Cutover remaining ContainerClient operations#4287
simorenoh merged 4 commits into
release/azure_data_cosmos-previewsfrom
cutover-container-ops

Conversation

@simorenoh

@simorenoh simorenoh commented Apr 27, 2026

Copy link
Copy Markdown
Member

Route ContainerClient::read(), replace(), and delete() through CosmosDriver instead of the legacy CosmosRequest +
ContainerConnection pipeline, following the pattern established in #4147 and #4128.

  • Add replace_container factory to CosmosOperation
  • Rewrite read(), replace(), delete() to use CosmosOperation +
    driver.execute_operation()
  • Remove unused link field from ContainerClient
  • Remove unused CosmosResponse import

@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label Apr 27, 2026
@simorenoh simorenoh linked an issue Apr 27, 2026 that may be closed by this pull request
@simorenoh simorenoh marked this pull request as ready for review April 27, 2026 23:52
@simorenoh simorenoh requested a review from a team as a code owner April 27, 2026 23:52
Copilot AI review requested due to automatic review settings April 27, 2026 23:52
@simorenoh

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

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.

Pull request overview

This PR completes the cutover of the remaining ContainerClient control-plane operations (read, replace, delete) to execute via CosmosDriver (using CosmosOperation) instead of the legacy CosmosRequest + ContainerConnection gateway pipeline, aligning container CRUD with prior driver migrations.

Changes:

  • Add CosmosOperation::replace_container(ContainerReference) factory method in the driver models.
  • Route ContainerClient::{read,replace,delete} through driver.execute_operation(...) and bridge the driver response back into SDK response types.
  • Remove the unused ContainerClient.link field and clean up an unused import.

Reviewed changes

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

File Description
sdk/cosmos/azure_data_cosmos_driver/src/models/cosmos_operation.rs Adds a new container replace operation factory (replace_container).
sdk/cosmos/azure_data_cosmos/src/clients/container_client.rs Reworks container read/replace/delete to use the driver execution path; removes unused link field and an unused import.

Comment thread sdk/cosmos/azure_data_cosmos_driver/src/models/cosmos_operation.rs
@simorenoh simorenoh linked an issue Apr 28, 2026 that may be closed by this pull request
@simorenoh simorenoh linked an issue Apr 28, 2026 that may be closed by this pull request
@simorenoh

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread sdk/cosmos/azure_data_cosmos/src/clients/container_client.rs

@FabianMeiswinkel FabianMeiswinkel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@simorenoh simorenoh merged commit fa05c31 into release/azure_data_cosmos-previews Apr 30, 2026
16 checks passed
@simorenoh simorenoh deleted the cutover-container-ops branch April 30, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Cosmos: Cutover remaining ContainerClient operations Cosmos: SDK to Driver migration Spec

5 participants