DI Refactor: Azure.Mcp.Tools.AzureMigrate#1909
Conversation
Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
|
@conniey - I've validated it. Is this still a WIP or has it been completed? |
Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Refactors Azure Migrate tool commands to use constructor dependency injection instead of resolving services from CommandContext during execution.
Changes:
- Injected
IPlatformLandingZoneGuidanceServiceintoGetGuidanceCommandvia constructor and removedcontext.GetService<T>()usage. - Injected
IPlatformLandingZoneServiceandAzureMigrateProjectHelperintoRequestCommandvia constructor and adjusted helper usage accordingly. - Updated unit tests and added a server changelog entry for PR #1909.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AzureMigrate/tests/Azure.Mcp.Tools.AzureMigrate.UnitTests/PlatformLandingZone/RequestCommandTests.cs | Updates test construction of RequestCommand to pass DI dependencies directly. |
| tools/Azure.Mcp.Tools.AzureMigrate/tests/Azure.Mcp.Tools.AzureMigrate.UnitTests/PlatformLandingZone/GetGuidanceCommandTests.cs | Updates test construction of GetGuidanceCommand to pass the injected guidance service. |
| tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/RequestCommand.cs | Switches RequestCommand to constructor injection and threads helper into create-project action handler. |
| tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/PlatformLandingZone/GetGuidanceCommand.cs | Switches GetGuidanceCommand to constructor injection and removes service resolution from context. |
| servers/Azure.Mcp.Server/changelog-entries/1773163668700.yaml | Adds changelog entry documenting the DI refactor. |
…pendencies in RequestCommandTests Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
|
Hi @copilot. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates. |
Hi @conniey. We've noticed that new changes have been pushed to this pull request. Because it is set to automatically merge, we've reset the approvals to allow the opportunity to review the updates.
* Initial plan * DI refactor: inject services via constructor in AzureMigrate commands Co-authored-by: conniey <10136526+conniey@users.noreply.github.com> * Add changelog entry for AzureMigrate DI refactor Co-authored-by: conniey <10136526+conniey@users.noreply.github.com> * Add PR number to changelog entry Co-authored-by: conniey <10136526+conniey@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: conniey <10136526+conniey@users.noreply.github.com>
IPlatformLandingZoneGuidanceServiceintoGetGuidanceCommandvia constructorIPlatformLandingZoneServiceandAzureMigrateProjectHelperintoRequestCommandvia constructorHandleCreateMigrateProjectActionAsyncto acceptAzureMigrateProjectHelperas parameternull!inRequestCommandTestswith a realAzureMigrateProjectHelperinstance backed by mockedISubscriptionServiceandITenantServiceOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.