Skip to content

Fix CI: revert GroupListCommand modification, follow Result naming convention#1975

Open
Copilot wants to merge 8 commits intomainfrom
copilot/implement-generic-resource-azure
Open

Fix CI: revert GroupListCommand modification, follow Result naming convention#1975
Copilot wants to merge 8 commits intomainfrom
copilot/implement-generic-resource-azure

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

  • Understand review comment: IResourceGroupService.GetGenericResources uses subscription while other methods use subscriptionId
  • Fix IResourceGroupService.cs: rename parameter from subscription to subscriptionId for consistency
  • Build and verify

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…roup using GenericResource API

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Azure.ResourceManager GenericResource for issue 1631 Add group resource list command using GenericResource API Mar 10, 2026
Copilot AI and others added 3 commits March 10, 2026 07:37
Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
…up_resource_list tool

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI changed the title Add group resource list command using GenericResource API Fix ServerStartCommandTests tool count assertions for group_resource_list Mar 10, 2026
…lt type

- Revert GroupListCommand.cs to match main (no modification needed)
- Rename GroupResourceListCommand.Result to GroupResourceListCommandResult
  to follow the established naming convention (e.g. AccountCreateCommandResult)
- Update GroupJsonContext to remove TypeInfoPropertyName workaround

Co-authored-by: ArthurMa1978 <20514459+ArthurMa1978@users.noreply.github.com>
Copilot AI changed the title Fix ServerStartCommandTests tool count assertions for group_resource_list Fix CI: revert GroupListCommand modification, follow Result naming convention Mar 10, 2026
@ArthurMa1978 ArthurMa1978 marked this pull request as ready for review March 11, 2026 03:33
@ArthurMa1978 ArthurMa1978 requested review from a team as code owners March 11, 2026 03:33
Copy link
Contributor

Copilot AI left a comment

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 fixes CI/test playback by adopting the established JSON source-gen “unique Result type name” convention for the new group_resource_list command, avoiding the previous TypeInfoPropertyName workaround and keeping the existing group_list tool unchanged.

Changes:

  • Add group resource list (group_resource_list) command and register it under the Group area.
  • Introduce GenericResourceInfo + IResourceGroupService.GetGenericResources implementation for listing resources in a resource group.
  • Update JSON source-gen context, consolidated tool mapping, docs, and test expectations to include the new utility tool.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Expands consolidated “subscriptions and resource groups” tool to include group_resource_list.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds E2E prompts for group_resource_list.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents azmcp group resource list.
core/Microsoft.Mcp.Core/src/Models/Resource/GenericResourceInfo.cs Adds a shared model for generic resource output.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Group/UnitTests/GroupResourceListCommandTests.cs Adds unit tests for the new command behavior.
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.LiveTests/Areas/Server/ServerStartCommandTests.cs Updates tool-count assertions to account for the new utility tool.
core/Azure.Mcp.Core/src/Services/Azure/ResourceGroup/ResourceGroupService.cs Implements resource listing within a resource group.
core/Azure.Mcp.Core/src/Services/Azure/ResourceGroup/IResourceGroupService.cs Extends service contract with GetGenericResources.
core/Azure.Mcp.Core/src/Areas/Group/Options/ResourceListOptions.cs Adds options type for the new command.
core/Azure.Mcp.Core/src/Areas/Group/GroupSetup.cs Registers the new command under a resource subgroup.
core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupResourceListCommand.cs New group resource list command with uniquely named result type.
core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupJsonContext.cs Registers the new result type for source-generated JSON serialization.

Task<List<ResourceGroupInfo>> GetResourceGroups(string subscriptionId, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);
Task<ResourceGroupInfo?> GetResourceGroup(string subscriptionId, string resourceGroupName, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);
Task<ResourceGroupResource?> GetResourceGroupResource(string subscriptionId, string resourceGroupName, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);
Task<List<GenericResourceInfo>> GetGenericResources(string subscription, string resourceGroupName, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

IResourceGroupService uses subscriptionId as the parameter name for the other methods, but GetGenericResources introduces subscription. Align the parameter naming (either all subscription or all subscriptionId) to keep the public interface consistent and reduce confusion about whether IDs vs names are accepted.

Suggested change
Task<List<GenericResourceInfo>> GetGenericResources(string subscription, string resourceGroupName, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);
Task<List<GenericResourceInfo>> GetGenericResources(string subscriptionId, string resourceGroupName, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default);

Copilot uses AI. Check for mistakes.
…Command.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ourceGroupService.GetGenericResources

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

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants