Repository navigation
Expose container unique-key policies in info output - #319
Merged
Mike Krüger (mkrueger) merged 6 commits intoDec 3, 2026
Merged
Conversation
Mike Krüger (mkrueger)
requested review from
a team
and
a balanced review from Copilot
November 30, 2026 13:13
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Tests do not cover missing or empty paths in individual unique-key constraints on both data-plane and ARM routes, leaving whole-policy rejection and prevention of partial metadata exposure unverified.
1 open issue
What changed in this PR
Addresses #310 by exposing observed container unique-key policies in structured CLI and MCP info output across data-plane and Azure Resource Manager connections.
Changes:
- Adds shared policy models that preserve constraint grouping and distinguish empty policies from unavailable metadata.
- Updates resource readers and
infooutput to includeuniqueKeyPolicy. - Adds mocked-backend regression tests and documents the new field.
| File | Description |
|---|---|
| docs/mcp.md | Documents policy availability across both connection routes. |
| docs/commands.md | Explains constraint grouping and empty-versus-null semantics. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/DataPlaneCosmosResourceOperations.cs | Reads raw container JSON to preserve policy presence information. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ContainerUniqueKeyView.cs | Models the paths belonging to one constraint. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ContainerUniqueKeyPolicyView.cs | Parses complete policies and rejects incomplete metadata. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ContainerSettingsView.cs | Adds the nullable unique-key policy field. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ArmCosmosResourceOperations.cs | Extracts policy metadata from the ARM resource model. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/InfoCommand.cs | Projects policies into structured output. |
| CosmosDBShell.Tests/CommandTests/InfoCommandTests.cs | Tests CLI/MCP policy output and failed data-plane reads. |
Review effort: Balanced
Code coverage overviewLanguages: C# C# / code-coverage/dotnet
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Vsevolod Kukol (sevoku)
approved these changes
Dec 3, 2026
Mike Krüger (mkrueger)
enabled auto-merge (squash)
December 3, 2026 10:34
Mike Krüger (mkrueger)
added a commit
that referenced
this pull request
Dec 3, 2026
Fix portable contract inventory validation for #319. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Require unavailable unique-key policy and throughput replacement status fields in the Windows emulator contract. Add regression checks for missing or fabricated metadata. Fix #319 CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vsevolod Kukol (sevoku)
approved these changes
Dec 3, 2026
Mike Krüger (mkrueger)
deleted the
dev/mkrueger/fix/310-info-unique-key-policy
branch
December 3, 2026 15:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #310.
Summary
uniqueKeyPolicyin structured CLI and MCPinfooutput on both data-plane and Azure Resource Manager connections.