Skip to content

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

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

Mike Krüger (mkrueger) wants to merge 1 commit 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

container.ReadContainerAsync(Arg.Any<ContainerRequestOptions>(), Arg.Any<CancellationToken>())
.Returns(
_ => Task.FromResult(metadata),
_ => Task.FromException<ContainerResponse>(new CosmosException("metadata unavailable", (HttpStatusCode)failureStatus.Value, 0, "test", 0)));
containers.GetIfExistsAsync("Items", Arg.Any<CancellationToken>())
.Returns(
_ => Task.FromResult(containerResponse),
_ => Task.FromException<NullableResponse<CosmosDBSqlContainerResource>>(new RequestFailedException(failureStatus.Value, "metadata unavailable")));
@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main 3628267 dev/mkrueger/fix/313... 9f9c18d +/-
76% 77% +1%
View coverage of the 9 most impacted files.
File main 3628267 dev/mkrueger/fix/313... 9f9c18d +/-
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.

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.

Preserve complete full-text policy metadata in info across backends

2 participants