Skip to content

Include application version in Cosmos DB user agent - #210

Merged
Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/user-agent-version
Sep 14, 2026
Merged

Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/user-agent-version

Conversation

@mkrueger

Copy link
Copy Markdown
Collaborator

Include CosmosDBShell/<version> in the Cosmos DB SDK user agent, using the same display version as the version command. Prerelease labels are preserved and build metadata is excluded.

Add client-options regression coverage for Direct and Gateway connections and document the versioned user agent.

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

The user-agent version is derived from a different assembly than the version command, and the new regression test mirrors that mismatch so it may not actually enforce the stated contract.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Cosmos DB client configuration so Cosmos DB SDK requests include a versioned application identifier (CosmosDBShell/<version>) in the user agent, aligned with the shell’s displayed version semantics (prerelease preserved, build metadata excluded). It also adds regression coverage for both Direct and Gateway connection modes and documents the behavior.

Changes:

  • Set CosmosClientOptions.ApplicationName to CosmosDBShell/<displayVersion> so the Cosmos SDK user agent includes the app version.
  • Add a regression test covering both Direct and Gateway client-option creation.
  • Document the versioned user agent behavior in user-facing docs.
File summaries
File Description
README.md Documents that the shell identifies as CosmosDBShell/<version> in the Cosmos SDK user agent.
docs/connect.md Documents that both Direct and Gateway connections include the versioned user agent, with prerelease/build-metadata rules.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ShellInterpreter.cs Sets CosmosClientOptions.ApplicationName to include the display version.
CosmosDBShell.Tests/CommandTests/ConnectCommandTests.cs Adds regression coverage to verify ApplicationName includes the expected version for both connection modes.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

github-code-quality Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 9c77bd0 in the dev/mkrueger/user-ag... branch is 62%. The line coverage in commit 7271532 in the main branch is 63%.

Show a line coverage summary of the most impacted files.
File main 7271532 dev/mkrueger/user-ag... 9c77bd0 +/-
D:\a\CosmosDBSh...osmosContext.cs 100% 0% -100%
D:\a\CosmosDBSh...ponseFactory.cs 97% 92% -5%
D:\a\CosmosDBSh...l.Core\Theme.cs 76% 75% -1%
D:\a\CosmosDBSh...ThemeCommand.cs 60% 60% 0%
D:\a\CosmosDBSh...re\ThemeFile.cs 96% 96% 0%
D:\a\CosmosDBSh...lInterpreter.cs 66% 66% 0%
D:\a\CosmosDBSh...ThemeOptions.cs 100% 100% 0%
D:\a\CosmosDBSh...hemeProfiles.cs 100% 100% 0%

Updated September 11, 2026 06:40 UTC

Copilot AI review requested due to automatic review settings September 11, 2026 06:35

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.

🟢 Approval recommended

No unresolved review issues were identified.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

🟢 Approval recommended

No unresolved review issues remain.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite
@mkrueger
Mike Krüger (mkrueger) merged commit 67b8f7e into main Sep 14, 2026
13 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/user-agent-version branch September 14, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants