Migrate AKS tools to new tool design#2868
Open
alzimmermsft wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the AKS tool commands and options to the newer attribute-driven option model (via [Option] attributes) and aligns AKS commands with the shared SubscriptionCommand<,> base in Azure.Mcp.Core.
Changes:
- Converted
ClusterGetandNodepoolGetoptions to POCOs using[Option]attributes andISubscriptionOptioninstead ofSystem.CommandLineoption registration/binding. - Updated AKS
getcommands to derive fromSubscriptionCommand<,>and acceptISubscriptionResolverfor subscription resolution. - Updated corresponding unit tests to use
SubscriptionCommandUnitTestsBaseand removed AKS-specific command/option base types.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Nodepool/NodepoolGetCommandTests.cs | Switches tests to the subscription-aware command unit test base for the new command shape. |
| tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.Tests/Cluster/ClusterGetCommandTests.cs | Updates tests for the new options-binding model and subscription resolver injection. |
| tools/Azure.Mcp.Tools.Aks/src/Options/Nodepool/NodepoolGetOptions.cs | Replaces JSON-property-based options with [Option] attribute-based options for nodepool get. |
| tools/Azure.Mcp.Tools.Aks/src/Options/Cluster/ClusterGetOptions.cs | Replaces JSON-property-based options with [Option] attribute-based options for cluster get. |
| tools/Azure.Mcp.Tools.Aks/src/Options/BaseAksOptions.cs | Removes the AKS-specific options base class (no longer needed with the new option model). |
| tools/Azure.Mcp.Tools.Aks/src/Options/AksOptionDefinitions.cs | Removes legacy System.CommandLine option definitions used by the previous design. |
| tools/Azure.Mcp.Tools.Aks/src/GlobalUsings.cs | Removes the AKS tool’s global System.CommandLine import (no longer used by migrated commands). |
| tools/Azure.Mcp.Tools.Aks/src/Commands/Nodepool/NodepoolGetCommand.cs | Migrates nodepool get command to SubscriptionCommand<,> and options POCO binding. |
| tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs | Migrates cluster get command to SubscriptionCommand<,> and options POCO binding (adds custom validation). |
| tools/Azure.Mcp.Tools.Aks/src/Commands/BaseAksCommand.cs | Removes the AKS-specific command base type in favor of the shared subscription base. |
| core/Azure.Mcp.Core/src/Commands/Subscription/SubscriptionCommand`2.cs | Refactors subscription command base to a primary-constructor pattern for resolver injection. |
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.
What does this PR do?
Migrates AKS tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline