Repository navigation
Preserve full-text policy metadata in container info - #315
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Mike Krüger (mkrueger) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mike Krüger (mkrueger)
requested review from
a team
and
a balanced review from Copilot
November 30, 2026 12:03
Contributor
There was a problem hiding this comment.
🟢 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
fullTextPolicyDetailsto structured CLI and MCP output while preserving the existingfullTextPolicypath 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"))); |
Code coverage overviewLanguages: C# C# / code-coverage/dotnet
View coverage of the 9 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
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 #313.
Container
infonow exposes the observed default language and all full-text path/language entries on both data-plane and Azure Resource Manager connections.fullTextPolicyDetails. The existingfullTextPolicyfield keeps its path-array shape.fullTextPolicyDetails: null; failed or unsupported metadata reads return an error instead.