Skip to content

Conversation

bambriz
Copy link
Member

@bambriz bambriz commented Jul 18, 2025

Description

Previously, Client ID was only included in the headers when doing database account operations. It will now be included in every request/response.

@Copilot Copilot AI review requested due to automatic review settings July 18, 2025 21:24
@bambriz bambriz requested a review from a team as a code owner July 18, 2025 21:24
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

This PR extends the inclusion of Client ID headers to all Cosmos DB requests, whereas previously it was only added to database account operations. The change ensures consistent client identification across all API calls.

  • Adds client_id=self.client_id parameter to all base.GetHeaders() calls in both sync and async client connections
  • Adds comprehensive test coverage to verify Client ID is included in request headers
  • Updates changelog to document this enhancement

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
_cosmos_client_connection_async.py Updates all async operation methods to include client_id parameter in headers
_cosmos_client_connection.py Updates all sync operation methods to include client_id parameter in headers
test_headers_async.py Adds async test to verify Client ID presence in request headers
test_headers.py Adds sync test to verify Client ID presence in request headers
CHANGELOG.md Documents the Client ID header enhancement
Comments suppressed due to low confidence (2)

sdk/cosmos/azure-cosmos/tests/test_headers_async.py:227

  • The test only verifies Client ID inclusion for read_item operations. Since the PR claims to add Client ID to 'all requests', consider testing other operation types (create, update, delete, query) to ensure comprehensive coverage.
            await self.container.read_item(item="id-1", partition_key="pk-1")

sdk/cosmos/azure-cosmos/tests/test_headers.py:113

  • The test only verifies Client ID inclusion for read_item operations. Since the PR claims to add Client ID to 'all requests', consider testing other operation types (create, update, delete, query) to ensure comprehensive coverage.
            self.container.read_item(item="id-1", partition_key="pk-1")

Copy link
Member

@tvaron3 tvaron3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

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

Annie had a good comment but won't block on it - LGTM

bambriz added 2 commits July 24, 2025 09:15
update client connection to not pass in client id and instead have it set to headers in base.getheaders
Copy link
Member

@tvaron3 tvaron3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@xinlian12 xinlian12 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@bambriz bambriz merged commit e7736e3 into Azure:main Jul 25, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants