Skip to content

Expose container unique-key policies in info output - #319

Merged
Mike Krüger (mkrueger) merged 6 commits into
mainfrom
dev/mkrueger/fix/310-info-unique-key-policy
Dec 3, 2026
Merged

Mike Krüger (mkrueger) merged 6 commits into
mainfrom
dev/mkrueger/fix/310-info-unique-key-policy

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #310.

Summary

  • Return the observed container uniqueKeyPolicy in structured CLI and MCP info output on both data-plane and Azure Resource Manager connections.
  • Keep paths grouped by constraint, distinguish an explicitly empty policy from unavailable metadata, and preserve errors on failed container reads.
  • Keep existing output fields unchanged and document the new field.

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

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 info output to include uniqueKeyPolicy.
  • 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

@github-code-quality

github-code-quality Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main 3fa5a1c dev/mkrueger/fix/310... ce0e164 +/-
77% 78% +1%
View coverage of the 10 most impacted files.
File main 3fa5a1c dev/mkrueger/fix/310... ce0e164 +/-
D:\a\CosmosDBSh...ThemeCommand.cs 73% 71% -2%
D:\a\CosmosDBSh...lInterpreter.cs 81% 80% -1%
D:\a\CosmosDBSh...mportCommand.cs 97% 96% -1%
D:\a\CosmosDBSh...tementParser.cs 78% 79% +1%
D:\a\CosmosDBSh...\InfoCommand.cs 14% 24% +10%
D:\a\CosmosDBSh...ceOperations.cs 28% 38% +10%
D:\a\CosmosDBSh...ceOperations.cs 71% 85% +14%
D:\a\CosmosDBSh...SettingsView.cs 0% 100% +100%
D:\a\CosmosDBSh...eyPolicyView.cs 0% 100% +100%
D:\a\CosmosDBSh...ngPolicyView.cs 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated December 03, 2026 14:57 UTC

Copilot AI balanced review requested due to automatic review settings December 1, 2026 09:51

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 active review issues were identified for the container unique-key policy output changes.

1 open issue

Review effort: Balanced

@mkrueger
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
Backport #319 to rel/1.2. Refs #310.

Source commits: 68a6833 and 847072e.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 12:26

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

There are no active review issues requiring changes to the unique-key policy output update.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Fix portable contract inventory validation for #319.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 13:24

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 active review issues remain for the changes exposing container unique-key policies in structured CLI and MCP output.

No open issues 🎉

Review effort: Balanced

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>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 14:47

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 active review issues were identified for the change exposing container unique-key policies in CLI and MCP info output.

No open issues 🎉

Review effort: Balanced

@mkrueger
Mike Krüger (mkrueger) merged commit 83f043d into main Dec 3, 2026
17 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/fix/310-info-unique-key-policy branch December 3, 2026 15:20
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.

Expose container unique-key policies in info output

3 participants