Skip to content

Make nested option containers trimming-safe - #3376

Open
Larry Osterman (LarryOsterman) wants to merge 5 commits into
mainfrom
larryosterman-option-container-trimming-safety
Open

Make nested option containers trimming-safe#3376
Larry Osterman (LarryOsterman) wants to merge 5 commits into
mainfrom
larryosterman-option-container-trimming-safety

Conversation

@LarryOsterman

Copy link
Copy Markdown
Member

What does this PR do?

Trimmed, self-contained Azure MCP Server builds can remove properties from nested option containers because recursive discovery reflects over PropertyInfo.PropertyType, which does not inherit the top-level DynamicallyAccessedMembers contract. This causes options such as --retry-max-retries to disappear from CLI and MCP learn-mode schemas even though they remain available in untrimmed builds.

This change introduces [OptionContainer<TContainer>] so every nested container type explicitly carries the linker requirements for public properties and a public parameterless constructor. OptionDescriptor propagates that annotated type through recursive discovery, OptionBinder uses it for nested construction, and the incorrect trimming suppressions are removed. Existing retry option containers are migrated to the generic attribute, with authoring documentation updated accordingly.

Regression coverage publishes and executes a self-contained trimmed test application, verifies all nested retry options remain discoverable, and binds --retry-max-retries 7. Validation also exercised the packaged trimmed Azure MCP executable through CLI help, CLI learn mode, and an MCP namespace learn request.

GitHub issue number?

N/A

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

The MCP tool-specific checklist sections are not applicable because this changes shared option binding infrastructure without adding, renaming, or changing individual tool descriptions.

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Pull request overview

This PR hardens option discovery and binding for trimmed/self-contained builds by making nested option container types explicitly carry the linker requirements needed to preserve public properties and a public parameterless constructor.

Changes:

  • Introduces OptionContainerAttribute<TContainer> (plus IOptionContainerMetadata) and updates OptionDescriptor and OptionBinder to use the annotated container type during recursive discovery and nested instantiation.
  • Migrates existing retry-policy nested option containers across tool option POCOs to [OptionContainer<RetryPolicyOptions>(Prefix = "retry")].
  • Adds a trimmed publish + execution regression test via a small publishable test app and a new test that validates nested retry options are discoverable and bindable when trimmed.

Reviewed changes

Copilot reviewed 222 out of 222 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/UpdateWorkbooksOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ShowWorkbooksOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/ListWorkbooksOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/DeleteWorkbookOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Workbooks/src/Options/Workbook/CreateWorkbookOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/HostpoolListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.VirtualDesktop/src/Options/Hostpool/BaseHostPoolOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/SyncGroup/SyncGroupCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/StorageSyncService/StorageSyncServiceCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/ServerEndpoint/ServerEndpointCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerUnregisterOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/RegisteredServer/RegisteredServerGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointTriggerChangeDetectionOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.StorageSync/src/Options/CloudEndpoint/CloudEndpointCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Table/TableListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Blob/Container/ContainerCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobUploadOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Blob/BlobGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Storage/src/Options/Account/AccountCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.SreAgent/src/Options/BaseSreAgentOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.SreAgent/src/Options/Agents/AgentsListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Sql/src/Options/BaseSqlOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Speech/src/Options/BaseSpeechOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.SignalR/src/Options/Runtime/RuntimeGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ServiceBus/src/Options/Topic/BaseTopicOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ServiceBus/src/Options/Queue/BaseQueueOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Service/ServiceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeSourceGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseRetrieveOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Knowledge/KnowledgeBaseGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexQueryOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Search/src/Options/Index/IndexGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResourceHealth/src/Options/ServiceHealthEvents/ServiceHealthEventsListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResourceHealth/src/Options/AvailabilityStatus/AvailabilityStatusGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/Resources/RecoveryResourceGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCheckReadinessOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/Resources/RecoveryJobResourceGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Jobs/RecoveryJobGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Resources/GoalResourceGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Runs/Resources/DrillRunResourceGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Runs/DrillRunGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/Resources/DrillResourceGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Drills/DrillGetOption.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Redis/src/Options/ResourceListOptions.cs Migrates retry nested container to generic OptionContainer<T>; normalizes file header encoding.
tools/Azure.Mcp.Tools.Redis/src/Options/ResourceCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Postgres/src/Options/Server/BaseServerOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Policy/src/Options/Assignment/PolicyAssignmentListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceLogQueryOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/WorkspaceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/WebTests/WebTestsCreateOrUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/TableType/TableTypeListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/TableListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/ResourceLogQueryOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/Metrics/BaseMetricsOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/HealthModels/HealthModelGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Monitor/src/Options/ActivityLog/ActivityLogListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductListOptions.cs Migrates retry nested container to generic OptionContainer<T>; normalizes file header encoding.
tools/Azure.Mcp.Tools.Marketplace/src/Options/Product/ProductGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeValidateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/SubnetSize/SubnetSizeAskOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/Sku/SkuGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/ImportJob/ImportJobCancelOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/FileSystemCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoimportJob/AutoimportJobCancelOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ManagedLustre/src/Options/FileSystem/AutoexportJob/AutoexportJobCancelOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestRun/LoadTestRunCreateOrUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTestResource/TestResourceCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.LoadTesting/src/Options/LoadTest/LoadTestCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/TableSchemaOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/TableListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/SampleOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/QueryOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/DatabaseListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Kusto/src/Options/ClusterGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.KeyVault/src/Options/BaseKeyVaultOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.IoTHub/src/Options/IoTHub/IoTHubGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.IoTHub/src/Options/Device/IoTHubDeviceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Insights/src/Options/InsightsGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Grafana/src/Options/Workspace/WorkspaceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FunctionApp/src/Options/FunctionApp/FunctionAppGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/ResourceGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiModelsListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiEmbeddingsCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiCompletionsCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/OpenAiChatCompletionsCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexSchemaOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FoundryExtensions/src/Options/Models/KnowledgeIndexListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Snapshot/SnapshotCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/PrivateEndpointConnection/PrivateEndpointConnectionGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetUsageDataOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetProvisioningRecommendationOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/Informational/FileShareGetLimitsOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.FileShares/src/Options/FileShare/FileShareCheckNameAvailabilityOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/Namespace/NamespaceDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/EventHub/EventHubDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventHubs/src/Options/ConsumerGroup/ConsumerGroupDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/ItemQueryOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemVectorSearchOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemTextSearchOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemListRecentOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/Item/ItemGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/CosmosListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Cosmos/src/Options/Container/ContainerSchemaInferOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ContainerApps/src/Options/ContainerApp/ContainerAppListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Communication/src/Options/BaseCommunicationOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AzureMigrate/src/Options/PlatformLandingZone/RequestOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Authorization/src/Options/RoleAssignmentListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/WebappChangeStateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Settings/AppSettingsUpdateOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Diagnostic/DetectorDiagnoseOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Webapp/Deployment/DeploymentGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/Database/DatabaseAddOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppService/src/Options/BaseAppServiceOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/RecommendationListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/Lock/KeyValueLockSetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueSetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppConfig/src/Options/KeyValue/KeyValueDeleteOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.AppConfig/src/Options/Account/AccountListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Advisor/src/Options/Recommendation/RecommendationListOptions.cs Migrates retry nested container to generic OptionContainer<T>; normalizes file header encoding.
tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryRepositoryListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
tools/Azure.Mcp.Tools.Acr/src/Options/Registry/RegistryListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
servers/Template.Mcp.Server/Template.Mcp.Server.slnx Adds trimmed option container app project to solution for build visibility.
servers/Fabric.Mcp.Server/Fabric.Mcp.Server.slnx Adds trimmed option container app project to solution for build visibility.
servers/Azure.Mcp.Server/docs/new-command.md Updates authoring guidance to use OptionContainer<TContainer>.
servers/Azure.Mcp.Server/changelog-entries/option-container-trimming.yaml Adds changelog entry for trimmed nested option preservation fix.
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Adds trimmed option container app project to solution for build visibility.
Microsoft.Mcp.slnx Adds trimmed option container app project to root solution for build visibility.
docs/option-conversion.md Updates option conversion guidance to use OptionContainer<TContainer>.
core/Microsoft.Mcp.Core/tests/TrimmedOptionContainerApp/TrimmedOptions.cs Defines a minimal options type with a nested retry container using the generic attribute.
core/Microsoft.Mcp.Core/tests/TrimmedOptionContainerApp/TrimmedOptionContainerApp.csproj Adds a publishable trimmed test app project used by regression test.
core/Microsoft.Mcp.Core/tests/TrimmedOptionContainerApp/Program.cs Validates nested retry options are present and bind in a trimmed executable.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.Tests/Options/OptionBinderTrimmedTests.cs Publishes and executes the trimmed test app to prevent regressions under trimming.
core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Core.Tests/Options/OptionBinderTests.cs Migrates unit tests to use OptionContainer<TContainer> and adds mismatch validation coverage.
core/Microsoft.Mcp.Core/src/Options/OptionDescriptor.cs Propagates annotated container types during recursive descriptor discovery; validates attribute type matches property type.
core/Microsoft.Mcp.Core/src/Options/OptionContainerAttribute`1.cs Introduces generic option container attribute with trimming annotations.
core/Microsoft.Mcp.Core/src/Options/OptionContainerAttribute.cs Removes the non-generic option container attribute.
core/Microsoft.Mcp.Core/src/Options/OptionBinder.cs Uses the annotated parent container type for nested option instantiation under trimming.
core/Microsoft.Mcp.Core/src/Options/IOptionContainerMetadata.cs Adds internal metadata interface to unify container prefix and annotated container type.
core/Azure.Mcp.Core/src/Areas/Subscription/Options/SubscriptionListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs Migrates retry nested container to generic OptionContainer<T>.
core/Azure.Mcp.Core/src/Areas/Group/Options/BaseGroupOptions.cs Migrates retry nested container to generic OptionContainer<T>.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/Microsoft.Mcp.Core/src/Options/OptionDescriptor.cs
Comment thread core/Microsoft.Mcp.Core/src/Options/OptionContainerAttribute`1.cs Outdated
Copilot AI and others added 2 commits August 26, 2026 21:36
Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com>
Restore compilation after the option container metadata interface removal.
[DynamicallyAccessedMembers] cannot be applied to tuple elements, so the
previous helper failed to compile with CS1031. Split container discovery into
GetOptionContainerAttribute, GetOptionContainerPrefix and an annotated
GetOptionContainerType so the trimming contract is expressed on a supported
dataflow location.

Also:
- Name the generic attribute in option validation exception messages.
- Update AGENTS.md to the generic [OptionContainer<RetryPolicyOptions>] form.
- Stop forcing SelfContained on the trimmed fixture so ordinary solution
  builds stay framework-dependent; the test supplies publish settings.
- Bound the trimmed publish test with a timeout and kill the process tree so
  a stalled publish fails instead of hanging the test run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants