Skip to content

Conversation

hieunhums
Copy link
Contributor

@hieunhums hieunhums commented Jul 14, 2025

Azure Fleet Tool Implementation

This pull request introduces a new az_fleet tool with structured parameters for managing Azure Kubernetes Service (AKS) Fleets. The implementation includes specialized command execution, parameter validation, enhanced error handling, and comprehensive documentation updates to improve usability, security, and maintainability.

New az_fleet Tool Implementation

The tool provides comprehensive Azure Kubernetes Service Fleet management capabilities with support for multiple operations across different resource types:

Supported Operations and Resources:

  • fleet: list, show, create, update, delete
  • member: list, show, create, update, delete
  • updaterun: list, show, create, start, stop, delete
  • updatestrategy: list, show, create, delete

Usage Examples:

  • List fleets: operation='list', resource='fleet', args='--resource-group myRG'
  • Show fleet: operation='show', resource='fleet', args='--name myFleet --resource-group myRG'
  • Create member: operation='create', resource='member', args='--name myMember --fleet-name myFleet --resource-group myRG --member-cluster-id /subscriptions/.../myCluster'

Core Implementation Details

Fleet Executor Implementation: Added FleetExecutor in internal/azcli/fleet_executor.go to handle structured commands for az_fleet. This executor includes parameter validation, access level enforcement, and command construction capabilities.

Fleet Tool Registration: Updated internal/components/fleet/registry.go to register the az_fleet tool with structured parameters (operation, resource, args) and detailed descriptions for improved developer experience.

Testing Enhancements

Unit Tests for Executor: Added comprehensive tests in internal/azcli/fleet_executor_test.go to validate parameter extraction, access level enforcement, and command construction functionality.

Registry Tests: Enhanced tests in internal/components/fleet/registry_test.go to verify structured parameter registration and tool descriptions are properly configured.

Documentation Updates

README and Prompts: Updated README.md and prompts/azure-fleet-tools.md to reflect the new structured parameter approach. Documentation now includes practical examples and details about enhanced error handling and validation mechanisms.

Integration with Server

Server Integration: Modified internal/server/server.go to utilize the new FleetExecutor for executing az_fleet commands, ensuring seamless integration with the existing infrastructure.

Sample Usage

{
  "operation": "create",
  "resource": "updatestrategy",
  "args": "--name default --fleet-name fleet1 --resource-group fleet --stages /Users/test/github/aks-mcp/update-strategy.json"
}
{
  "operation": "list",
  "resource": "member",
  "args": "--fleet-name testhubfleet1 --resource-group hieunhu"
}
{
  "operation": "update",
  "resource": "member",
  "args": "--name akskeda-member --fleet-name testhubfleet1 --resource-group hieunhu --update-group group1"
}

These changes collectively enhance the functionality and user experience of the az_fleet tool while ensuring robust validation and security across all fleet management operations.

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 96.07843% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@f847dfc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/azcli/fleet_executor.go 96.10% 2 Missing and 1 partial ⚠️
internal/server/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #69   +/-   ##
=======================================
  Coverage        ?   29.95%           
=======================================
  Files           ?       34           
  Lines           ?     2848           
  Branches        ?        0           
=======================================
  Hits            ?      853           
  Misses          ?     1979           
  Partials        ?       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hieunhums hieunhums changed the title feat: enhance az fleet tool with structured parameters and validation Feat: enhance az fleet tool with structured parameters and validation Jul 14, 2025
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement!

@feiskyer feiskyer merged commit 58b60e7 into Azure:main Jul 15, 2025
8 checks passed
@gossion gossion mentioned this pull request Jul 15, 2025
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.

3 participants