Skip to content

Preserve full-text policy metadata in container info - #315

Open
Mike Krüger (mkrueger) wants to merge 2 commits into
mainfrom
dev/mkrueger/fix/313-fulltext-policy
Open

Mike Krüger (mkrueger) wants to merge 2 commits into
mainfrom
dev/mkrueger/fix/313-fulltext-policy

Conversation

@mkrueger

Copy link
Copy Markdown
Collaborator

Fixes #313.

Container info now exposes the observed default language and all full-text path/language entries on both data-plane and Azure Resource Manager connections.

  • CLI JSON and MCP results include the complete policy in fullTextPolicyDetails. The existing fullTextPolicy field keeps its path-array shape.
  • An absent policy is reported as fullTextPolicyDetails: null; failed or unsupported metadata reads return an error instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 block approval of the full-text policy metadata changes.

No open issues 🎉

What changed in this PR

This PR addresses #313 by preserving complete full-text policy metadata in container info results across data-plane and Azure Resource Manager connections.

Changes:

  • Adds fullTextPolicyDetails to structured CLI and MCP output while preserving the existing fullTextPolicy path array.
  • Projects ARM full-text policy metadata, including the default language and path/language entries.
  • Adds regression tests and documentation covering backend parity, absent and empty policies, and metadata-read failures.
File Description
docs/​commands.md Documents the complete policy field, compatibility, and absence/error behavior.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​ArmCosmosResourceOperations.cs Maps ARM full-text policy metadata into the shared container settings view.
CosmosDBShell/​Azure.Data.Cosmos.Shell.Commands/​InfoCommand.cs Adds complete policy details while retaining the legacy path-array field.
CosmosDBShell.Tests/​CommandTests/​FullTextPolicyReadbackTests.cs Tests policy preservation, CLI/MCP consistency, and read failures across both backends.

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 3628267 dev/mkrueger/fix/313... cf1d057 +/-
76% 77% +1%
View coverage of the 9 most impacted files.
File main 3628267 dev/mkrueger/fix/313... cf1d057 +/-
D:\a\CosmosDBSh...urceProvider.cs 65% 68% +3%
D:\a\CosmosDBSh...sourceFacade.cs 65% 69% +4%
D:\a\CosmosDBSh...\InfoCommand.cs 14% 28% +14%
D:\a\CosmosDBSh...ceOperations.cs 5% 19% +14%
D:\a\CosmosDBSh...ceOperations.cs 51% 66% +15%
D:\a\CosmosDBSh...SettingsView.cs 0% 73% +73%
D:\a\CosmosDBSh...ngPolicyView.cs 0% 100% +100%
D:\a\CosmosDBSh...xtPolicyView.cs 0% 100% +100%
D:\a\CosmosDBSh...TextPathView.cs 0% 100% +100%

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


Updated November 30, 2026 13:30 UTC

Copilot AI balanced review requested due to automatic review settings November 30, 2026 13:21

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 full-text policy metadata changes.

No open issues 🎉

Review effort: Balanced

}

mcpTable["fullTextPolicy"] = mcpPaths;
mcpTable["fullTextPolicyDetails"] = new Dictionary<string, object?>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we really need a new entry for this? I think it's fine to break the contract, it should be just documented in the changelog and we should bump the minor version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants