Skip to content

Migrate AKS tools to new tool design#2868

Open
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateAksToNewToolDesign
Open

Migrate AKS tools to new tool design#2868
alzimmermsft wants to merge 2 commits into
microsoft:mainfrom
alzimmermsft:MigrateAksToNewToolDesign

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Migrates AKS tools to new design where Register and Bind options are based on Option attributes.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

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

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 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 ClusterGet and NodepoolGet options to POCOs using [Option] attributes and ISubscriptionOption instead of System.CommandLine option registration/binding.
  • Updated AKS get commands to derive from SubscriptionCommand<,> and accept ISubscriptionResolver for subscription resolution.
  • Updated corresponding unit tests to use SubscriptionCommandUnitTestsBase and 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.

Comment thread tools/Azure.Mcp.Tools.Aks/src/Commands/Cluster/ClusterGetCommand.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants