Skip to content

Refactor Azure.Mcp.Tools.EventHubs for dependency injection#1986

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-azure-mcp-tools-eventhubs
Draft

Refactor Azure.Mcp.Tools.EventHubs for dependency injection#1986
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-azure-mcp-tools-eventhubs

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

  • Refactor NamespaceGetCommand to inject IEventHubsService via constructor
  • Refactor NamespaceDeleteCommand to inject IEventHubsService via constructor
  • Refactor NamespaceUpdateCommand to inject IEventHubsService via constructor
  • Refactor ConsumerGroupDeleteCommand to inject IEventHubsService via constructor
  • Refactor ConsumerGroupGetCommand to inject IEventHubsService via constructor
  • Refactor ConsumerGroupUpdateCommand to inject IEventHubsService via constructor
  • Update unit tests for all 6 commands to pass service via constructor
  • Build succeeds with 0 warnings, all 93 unit tests pass
  • Add changelog entry with PR number (Refactor Azure.Mcp.Tools.EventHubs for dependency injection #1986)
Original prompt

This section details on the original issue you should resolve

<issue_title>DI Refactor: Azure.Mcp.Tools.EventHubs</issue_title>
<issue_description>## Summary

Refactor Azure.Mcp.Tools.EventHubs to use constructor dependency injection instead of resolving services via context.GetService<T>() in ExecuteAsync.

This is a sub-issue of #158.

Instructions

Follow the algorithm described in tools/di-refactor-plan.md with {ToolArea} = EventHubs.

An example PR is: #1815
</issue_description>

<agent_instructions>After creating PR, re-evaluate Step 5. Step 5 includes executing New-ChangeLogEntry.ps1 to generate CHANGELOG entry.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@conniey
Copy link
Member

conniey commented Mar 10, 2026

@copilot There are no files changed

Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot There are no files changed

Done! Commit 87bb556 refactors all 6 remaining commands (NamespaceGetCommand, NamespaceDeleteCommand, NamespaceUpdateCommand, ConsumerGroupDeleteCommand, ConsumerGroupGetCommand, ConsumerGroupUpdateCommand) to accept IEventHubsService via constructor injection instead of calling context.GetService<IEventHubsService>() in ExecuteAsync. Unit tests updated accordingly — all 93 tests pass.

Copilot AI changed the title [WIP] Refactor Azure.Mcp.Tools.EventHubs for dependency injection Refactor Azure.Mcp.Tools.EventHubs for dependency injection Mar 10, 2026
@@ -0,0 +1,3 @@
changes:
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Step 5 includes executing New-ChangeLogEntry.ps1 to generate CHANGELOG entry. There is no PR number in this yml file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added pr: 1986 to the changelog entry in commit 5ed7d72.

Co-authored-by: conniey <10136526+conniey@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.

DI Refactor: Azure.Mcp.Tools.EventHubs

2 participants