Show discovered AppHosts in Aspire pane#17506
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17506Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17506" |
687dd0e to
12997e9
Compare
|
vs code extension tests failing? |
12997e9 to
0d8fa08
Compare
Fixed! |
Done
I wasn't able to reproduce this issue with my recent changes. If you're still seeing this with the latest changes, could you share your setup/environment so I can try to repro?
Done |
When an AppHost stops, the noAppHosts context key now considers workspace candidates. This ensures the panel shows idle AppHosts instead of the empty welcome view after a running AppHost is stopped.
733545a to
0e312f9
Compare
The _updateWorkspaceContext change (0e312f9) added !hasWorkspaceCandidates to the noAppHosts condition, meaning the panel stays visible when idle AppHosts are discovered. Two tests asserted noAppHosts=true after describe exit, but the legacy format candidate is treated as buildable (toAppHostCandidate defaults null status to 'buildable'), so workspace candidates persist and noAppHosts is correctly false. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
adamint
left a comment
There was a problem hiding this comment.
Code review (Opus 4.7-xhigh + Opus 4.8 + GPT-5.5; all three reviewers independently agreed on finding #1). 6 issues total — 1 critical regression, 2 high-severity (stuck-state and unhandled rejection), 2 medium (data-flow correctness, command-palette gating), 1 low (context-menu regression on a transient state).
Fix microsoft#1: Rename command IDs in package.json menus and walkthrough so they target the new aspire-vscode.runAppHostCommand and aspire-vscode.debugAppHostCommand registrations introduced in this PR. Without this the editor title bar, explorer context menu, and Get Started walkthrough Run/Debug buttons silently no-op. Fix microsoft#2: Wrap vscode.debug.startDebugging in try/catch in AppHostLaunchService.launch so a 'false' return value (debug adapter rejected) or thrown error clears the launching state. Otherwise the tree item is stuck showing the 'Starting...' spinner forever and the user cannot retry. Fix microsoft#3: Make AspireAppHostTreeProvider.runAppHost async and await launch so launch failures surface via showErrorMessage instead of being dropped as unhandled promise rejections. Fix microsoft#4: In workspace mode with multiple candidate AppHost paths, match running AppHosts to candidates by directory equivalence (isMatchingAppHostPath) rather than exact path. This is the same matching used elsewhere in AppHostDataRepository when correlating 'aspire ps' output to candidate paths, so canonicalization differences (case, separators, trailing slashes) no longer cause a running AppHost to display as idle. Fix microsoft#5: Introduce aspire.noRunningAppHosts context key so the Open Dashboard palette command is only enabled when at least one AppHost is actually running. Previously the palette appeared when only idle candidates were known and then silently no-oped. Fix microsoft#6: Widen the workspaceResources contextValue regex in package.json so the read-only 'Open AppHost Source' and 'Copy AppHost Path' actions appear on bare 'workspaceResources' items, not only on 'workspaceResources:hasAppHost'. The destructive 'Stop AppHost' menu remains gated on :hasAppHost. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Brings 43 release-branch commits forward onto main now that 13.4.0 has shipped. This PR replaces the original automated merge (microsoft#17804) which had to be closed so that conflict resolution and post-merge cleanups could be made on a non-protected branch. Conflict resolution summary (33 files): * Equivalent backports (took main's commit identity): ChannelUpdateWorkflowTests, LoggingHelpersTests, the four extension test files, AspireEditorCommandProvider, appHostDiscovery. * Release-only forwards (preserved): microsoft#17732 / microsoft#17756 Foundry hosted-agent protocol selection and cross-compute-environment endpoint references, microsoft#17573 stabilize PrebuiltAppHostServer staging globalPackagesFolder path, microsoft#17743 staging-identity CLI darc feed routing. * Main-only forwards (preserved): microsoft#17506 Show discovered AppHosts in Aspire pane, microsoft#17547 Localize Aspire skills metadata errors, microsoft#17801 VS Code v1.12.0, microsoft#17297 Aspire CLI npm package release integration, microsoft#17576 TerminalRun IAsyncDisposable, microsoft#17721 / microsoft#17723 VS Code telemetry, microsoft#17671 ATS baseline fix (re-applied manually on top of Foundry source taken from release). * Hybrid (manually spliced): docs/contributing.md - kept main's restructured layout and inserted release's staging-validation paragraph; HostedAgentBuilder- Extension - took release base then re-applied microsoft#17671 asHostedAgent rename; UpdateCommandTests - took main and injected microsoft#17743's OverrideCliInformationalVersionConfigKey block. Post-merge cleanups included in this PR: * eng/Versions.props: revert StabilizePackageVersion to false (was flipped to true on release/13.4 by microsoft#17520 for shipping 13.4.0; main must stay in preview mode). * .github/workflows/generate-api-diffs.yml: retarget back to main (was pointed at release/13.4 by microsoft#17696 release prep). * .github/workflows/backmerge-release.yml: update from release/13.3 to release/13.4 (was stale - missed the 13.4 release-time bump). * .github/workflows/milestone-assignment.yml: audited - already correct (main -> 13.5, release/13.4 -> 13.4.x); no change. This merge commit must be preserved - do not squash on merge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


PR Summary
What it does
Displays idle (non-running) AppHosts discovered via
aspire lsin the VS Code Aspire pane tree view, with right-click Run/Debug/Open Source/Copy Path context menu actions.Demo
aspire-discovered-apphost-demo.mp4
Key changes
AppHostLaunchService.ts(new)AspireAppHostTreeProvider.tsAppHostDataRepository.tsworkspaceAppHostCandidatePathsfromaspire lsoutputAspireEditorCommandProvider.tsAppHostLaunchServiceinstead of inline launch logicpackage.jsonrunWorkspaceAppHost,debugWorkspaceAppHost,openAppHostSource,copyAppHostPath), menu contributions with when-clause regex patternsstrings.ts/package.nls.jsonaspire-vscode.xlfNew tests
appHostLaunchService.test.ts(8 tests)launch()calls debug API with correct args;isLaunching()/clearLaunching()state tracking;onDidChangeLaunchingStateevent fires on launch and clear; no-op when already launching; concurrent launches of different AppHostsappHostTreeView.test.ts(4 new tests)WorkspaceAppHostItem; multiple running AppHosts frompsappear in multi-candidate mode; resource commands resolve to the owning AppHost;describeresources used as fallback whenpsresources are missing/emptyaspireEditorCommandProvider.test.ts(1 new test)packageManifest.test.ts(existing test fixed)Fixes #17458