Skip to content

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

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

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

Conversation

@mkrueger

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

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 a single fullTextPolicy object with defaultLanguage and fullTextPaths. No separate fullTextPolicyDetails field is emitted.
  • An absent policy is reported as fullTextPolicy: null; failed or unsupported metadata reads return an error instead. Configured policies without paths return an empty fullTextPaths array.
  • Output contract change: fullTextPolicy was previously a path array. Fixed JSON consumers should now iterate fullTextPolicy.fullTextPaths.

Validation

  • Shell and test projects build successfully with no warnings or errors.
  • All 249 selected full-text policy readback and bulk command regression tests pass, including CLI JSON/MCP results across data-plane/ARM backends.

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 d89c483 dev/mkrueger/fix/313... 104f974 +/-
76% 77% +1%
View coverage of the 10 most impacted files.
File main d89c483 dev/mkrueger/fix/313... 104f974 +/-
D:\a\CosmosDBSh...\RmDbCommand.cs 73% 28% -45%
D:\a\CosmosDBSh...ainerCommand.cs 68% 24% -44%
D:\a\CosmosDBSh...sourceFacade.cs 77% 69% -8%
D:\a\CosmosDBSh...urceProvider.cs 65% 68% +3%
D:\a\CosmosDBSh...ceOperations.cs 57% 66% +9%
D:\a\CosmosDBSh...\InfoCommand.cs 14% 28% +14%
D:\a\CosmosDBSh...ceOperations.cs 5% 19% +14%
D:\a\CosmosDBSh...SettingsView.cs 0% 73% +73%
D:\a\CosmosDBSh...ngPolicyView.cs 0% 100% +100%
D:\a\CosmosDBSh...xtPolicyView.cs 0% 100% +100%

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


Updated December 01, 2026 10:25 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed - it's now in the fullTextPolicy object but it's not longer an array.

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

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

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 4, 2026 09: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 active review issues remain for the full-text policy metadata changes.

No open issues 🎉

Review effort: Balanced

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve complete full-text policy metadata in info across backends

3 participants