Rename built-in resource commands: resource-start/stop/restart -> start/stop/restart#14930
Merged
davidfowl merged 2 commits intorelease/13.2from Mar 4, 2026
Merged
Rename built-in resource commands: resource-start/stop/restart -> start/stop/restart#14930davidfowl merged 2 commits intorelease/13.2from
davidfowl merged 2 commits intorelease/13.2from
Conversation
…rt/stop/restart Rename the built-in resource command identifiers from 'resource-start', 'resource-stop', 'resource-restart' to 'start', 'stop', 'restart'. - Update KnownResourceCommands constants to use the new short names - Add internal legacy constants for backwards compatibility - Add fallback mapping in ResourceCommandService so callers using the old names (e.g. 'resource-start') are mapped to the new names - Remove the CLI ResourceCommand name-mapping layer (no longer needed) - Update Dashboard CommandViewModel, MCP tools, and Assistant descriptions - Update VS Code extension to check for both old and new command names - Update all affected tests and add backwards-compat tests
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14930Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14930" |
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the built-in lifecycle resource command identifiers across Aspire (hosting/backchannel, CLI, Dashboard, VS Code extension) from resource-start/stop/restart to start/stop/restart, while keeping backward compatibility via a server-side fallback mapping.
Changes:
- Updated
KnownResourceCommandsto use the new short command names and introduced internal legacy constants. - Added legacy-name fallback logic in
ResourceCommandService.ExecuteCommandCoreAsyncand updated tests accordingly. - Updated consumers (Dashboard, MCP tools, CLI, VS Code extension) to use/recognize the new command names.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/ResourceCommandServiceTests.cs | Adds coverage to ensure legacy command names fall back to the new names. |
| tests/Aspire.Hosting.Tests/ResourceCommandAnnotationTests.cs | Updates lifecycle command test inputs to use start/stop/restart. |
| tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelRpcTargetTests.cs | Updates expected command snapshots and assertions to new command names. |
| tests/Aspire.Cli.Tests/Mcp/ExecuteResourceCommandToolTests.cs | Updates MCP tool tests to use new command names in inputs/outputs. |
| tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs | Updates CLI parsing tests for new command names (but currently introduces a duplicate test method). |
| tests/Aspire.Cli.Tests/Backchannel/ResourceSnapshotMapperTests.cs | Updates snapshot mapping expectations to new command keys. |
| src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs | Updates XML docs for command name examples to start/stop/restart. |
| src/Aspire.Hosting/ApplicationModel/ResourceCommandService.cs | Adds legacy-name fallback mapping when executing commands. |
| src/Aspire.Hosting/ApplicationModel/KnownResourceCommands.cs | Renames lifecycle command constants to start/stop/restart and adds legacy constants. |
| src/Aspire.Dashboard/Model/ResourceViewModel.cs | Updates Dashboard-known command constants to new names. |
| src/Aspire.Dashboard/Model/Assistant/AssistantChatDataContext.cs | Updates assistant description text to reference new command names. |
| src/Aspire.Dashboard/Mcp/AspireResourceMcpTools.cs | Updates MCP descriptions/logic to use new command constants and improved message formatting. |
| src/Aspire.Cli/Mcp/Tools/ListConsoleLogsTool.cs | Updates tool description text to reference new command names. |
| src/Aspire.Cli/Commands/ResourceCommandHelper.cs | Updates parameter doc example for command name. |
| src/Aspire.Cli/Commands/ResourceCommand.cs | Removes no-longer-needed mapping to backchannel lifecycle names and uses the command name directly. |
| src/Aspire.Cli/Backchannel/IAppHostAuxiliaryBackchannel.cs | Updates doc examples for command names. |
| playground/Stress/Stress.AppHost/Program.cs | Switches hard-coded lifecycle command strings to KnownResourceCommands.*. |
| extension/src/views/AspireAppHostTreeProvider.ts | Treats both legacy and new lifecycle command names as enabling the same context actions. |
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22653578304 |
davidfowl
approved these changes
Mar 4, 2026
davidfowl
approved these changes
Mar 4, 2026
Copilot AI
pushed a commit
that referenced
this pull request
Mar 10, 2026
…rt/stop/restart (#14930) * Rename built-in resource commands: resource-start/stop/restart -> start/stop/restart Rename the built-in resource command identifiers from 'resource-start', 'resource-stop', 'resource-restart' to 'start', 'stop', 'restart'. - Update KnownResourceCommands constants to use the new short names - Add internal legacy constants for backwards compatibility - Add fallback mapping in ResourceCommandService so callers using the old names (e.g. 'resource-start') are mapped to the new names - Remove the CLI ResourceCommand name-mapping layer (no longer needed) - Update Dashboard CommandViewModel, MCP tools, and Assistant descriptions - Update VS Code extension to check for both old and new command names - Update all affected tests and add backwards-compat tests * Remove duplicate test method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rename the built-in resource command identifiers from
resource-start/resource-stop/resource-restarttostart/stop/restart.Changes:
KnownResourceCommandsconstants to use the new short namesinternallegacy constants (LegacyStartCommand,LegacyStopCommand,LegacyRestartCommand) for backwards compatibilityResourceCommandService.ExecuteCommandCoreAsync— if a caller sends a legacy name (e.g.resource-start) and no command with that name is found, it falls back to the current name (start)ResourceCommandname-mapping dictionary (no longer needed since user-facing names now match command names directly)CommandViewModel, MCP tools, and Assistant[Description]attributesgetResourceContextValueto check for both old and new command namesResourceCommandServiceTestsChecklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: