Skip to content

Remove resource data from aspire ps; use aspire describe for resource streaming#17479

Open
mitchdenny wants to merge 6 commits into
mainfrom
mitchdenny/issue-17472-remove-resource-data-from-aspire-ps-use-cbf986
Open

Remove resource data from aspire ps; use aspire describe for resource streaming#17479
mitchdenny wants to merge 6 commits into
mainfrom
mitchdenny/issue-17472-remove-resource-data-from-aspire-ps-use-cbf986

Conversation

@mitchdenny
Copy link
Copy Markdown
Member

Description

aspire ps --resources overlapped heavily with aspire describe --follow --apphost <path> and emitted the full resource set per AppHost on every change, making ps behave less like its docker ps / kubectl get pods namesakes. This PR drops --resources (and --include-hidden, which only existed to filter the resource payload) so ps stays an AppHost-level summary. Consumers that need resource data should use aspire describe instead.

Highlights:

  • PsCommand: removed the --resources / --include-hidden options, AppHostDisplayInfo.Resources, the resource fetch path, and the follow-mode resource watcher plumbing (file goes from ~575 to ~290 lines).
  • Resources: removed ResourcesOptionDescription and reworded FollowOptionDescription; regenerated all 13 xlf files.
  • Tests: dropped the 7 --resources-specific tests in PsCommandTests; the remaining 28 tests pass.
  • Docs (docs/specs/cli-output-formats.md): removed the --resources example and pointed readers at aspire describe for per-resource streaming.
  • VS Code extension (AppHostDataRepository): removed the _supportsResources field and the --resources fallback branch in _fetchAppHosts; updated tests accordingly. 515 extension unit tests pass; lint clean. (2 pre-existing RPC tests fail on main too because they require a packaged dist/extension.js.)

Behavior note: the extension's global-mode tree previously nested resources under each AppHost from the ps --resources payload. With ps no longer returning resources, that nesting goes away in global mode; per-AppHost resource streaming is already available via describe --apphost, which the extension uses in workspace mode.

Fixes: #17472

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Resource snapshot streaming from 'aspire ps --resources' overlapped
heavily with 'aspire describe --follow --apphost <path>' and emitted
the full resource set per AppHost on every change. Drop --resources
(and --include-hidden, which only filtered the resource payload) so
ps stays an AppHost-level summary similar to 'docker ps'. Consumers
that need resource data should use 'aspire describe' instead.

- Remove the --resources/--include-hidden options, AppHostDisplayInfo.Resources
  and the resource fetch/follow watcher plumbing from PsCommand.
- Drop ResourcesOptionDescription from PsCommandStrings and reword
  FollowOptionDescription; regenerate xlf for all locales.
- Drop --resources tests from PsCommandTests; remaining 28 tests pass.
- Update docs/specs/cli-output-formats.md to remove the --resources example
  and point readers at 'aspire describe' for resource streaming.
- VS Code extension: drop the _supportsResources branch in
  AppHostDataRepository (and its --resources fallback path), and update
  the matching tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 22:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17479

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17479"

Copy link
Copy Markdown
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 narrows aspire ps back to an AppHost-level listing by removing the --resources and --include-hidden options and all related resource-fetch/watch plumbing, directing consumers to aspire describe for per-resource inspection and streaming.

Changes:

  • Removed ps resource-related options, payload fields, and follow-mode resource watcher logic.
  • Updated localized CLI strings to reflect the new ps --follow semantics and removed the resources option string.
  • Updated the VS Code extension and CLI output-format spec docs to no longer rely on ps --resources, and adjusted unit tests accordingly.
Show a summary per file
File Description
tests/Aspire.Cli.Tests/Commands/PsCommandTests.cs Removes ps --resources-specific tests and updates remaining coverage to match the new ps contract.
src/Aspire.Cli/Commands/PsCommand.cs Removes --resources / --include-hidden options and resource snapshot plumbing from ps (including follow-mode resource watching).
src/Aspire.Cli/Resources/PsCommandStrings.resx Removes the resources option description and updates follow description text.
src/Aspire.Cli/Resources/PsCommandStrings.Designer.cs Regenerates strongly-typed resource accessors to match updated .resx.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.zh-Hant.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.zh-Hans.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.tr.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ru.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.pt-BR.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.pl.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ko.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.ja.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.it.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.fr.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.es.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.de.xlf Updates follow description translation source; removes resources option string.
src/Aspire.Cli/Resources/xlf/PsCommandStrings.cs.xlf Updates follow description translation source; removes resources option string.
extension/src/views/AppHostDataRepository.ts Stops passing --resources to ps and removes the resources-capability fallback logic.
extension/src/test/appHostDataRepository.test.ts Updates extension tests for the new ps invocation behavior (no --resources).
docs/specs/cli-output-formats.md Removes the ps --resources example and points readers to aspire describe for resource streaming.

Copilot's findings

Files not reviewed (1)
  • src/Aspire.Cli/Resources/PsCommandStrings.Designer.cs: Language not supported
  • Files reviewed: 19/20 changed files
  • Comments generated: 3

Comment thread docs/specs/cli-output-formats.md
Comment thread extension/src/test/appHostDataRepository.test.ts
Comment thread extension/src/test/appHostDataRepository.test.ts Outdated
@mitchdenny mitchdenny marked this pull request as draft May 25, 2026 23:24
mitchdenny and others added 3 commits May 26, 2026 09:29
The previous commit removed --resources from 'aspire ps' but left the
global (multi-AppHost) view in the VS Code extension with no source
for per-AppHost resource data, since 'aspire describe --follow' is
per-AppHost (takes a single --apphost).

Add a per-AppHost describe fan-out in AppHostDataRepository: while
the panel is visible in global mode, maintain one
'aspire describe --follow --apphost <path>' stream per AppHost
discovered by 'ps', merging resources into appHost.resources so the
tree provider's existing rendering path lights up again. Streams are
reconciled on every ps update, torn down when an AppHost stops or when
leaving global mode/hiding the panel, and restarted with exponential
backoff if they exit unexpectedly.

Update the global ps-follow test to feed resources via describe instead
of ps, and add two new tests covering the fan-out reconciliation and
the mode-switch teardown.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update AppHostDataRepository tests so ps payload fixtures match the current aspire ps output shape.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mitchdenny mitchdenny marked this pull request as ready for review May 26, 2026 00:21
The 'possibly unbuildable AppHost candidates do not force global mode'
test races on Windows CI because the aspire ls exit handler awaits
getConfiguredAppHostPathFromWorkspaceRoot, which probes for the
workspace config files via vscode workspace fs. That probe can take
more than the single setTimeout(0) tick that waitForAppHostDiscovery
covers, so workspaceAppHostPath was still undefined when the assertion
ran.

Switch to the existing waitForCondition polling helper so the test
waits until the path is actually populated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

1 issue found (bug in error recovery path for global describe streams).

Comment thread extension/src/views/AppHostDataRepository.ts
Node's spawn can emit error (e.g., ENOENT when the CLI binary is
missing or its path changes) without a subsequent exit. The previous
errorCallback only cleared stream.process, leaving a zombie entry in
_globalDescribeStreams that blocked _reconcileGlobalDescribes from
recreating the stream. Drop the entry (and clear cached resources +
fire a change event so the UI reflects the removal) so the next ps
reconcile recreates it from scratch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JamesNK
Copy link
Copy Markdown
Member

JamesNK commented May 26, 2026

I tried testing it locally but it never found AppHosts. Have you tested it locally?

I debugged a bit as it looks like aspire ps is never called because _showPoll() always returns false.

@mitchdenny
Copy link
Copy Markdown
Member Author

@JamesNK are you running within the context of the workspace? If you aren't you'll need to press this button:

image

@github-actions
Copy link
Copy Markdown
Contributor

CLI E2E Tests unknown — 98 passed, 0 failed, 6 unknown (commit c223ece)

View all recordings
Status Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View recording
AddPackageWhileAppHostRunningDetached ▶️ View recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View recording
AgentInitCommand_DefaultSelection_InstallsDefaultSkills ▶️ View recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View recording
AgentMcpListStructuredLogsFromStarterAppCore ▶️ View recording
AllPublishMethodsBuildDockerImages ▶️ View recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View recording
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost ▶️ View recording
AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles ▶️ View recording
AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive ▶️ View recording
AspireStartUpdatesStaleTypeScriptAppHostPath ▶️ View recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View recording
AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent ▶️ View recording
Banner_DisplayedOnFirstRun ▶️ View recording
Banner_DisplayedWithExplicitFlag ▶️ View recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View recording
CertificatesClean_RemovesCertificates ▶️ View recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View recording
CreateAndRunAspireStarterProject ▶️ View recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View recording
CreateAndRunEmptyAppHostProject ▶️ View recording
CreateAndRunJavaEmptyAppHostProject ▶️ View recording
CreateAndRunJsReactProject ▶️ View recording
CreateAndRunPythonReactProject ▶️ View recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View recording
CreateAndRunTypeScriptStarterProject ▶️ View recording
CreateJavaAppHostWithViteApp ▶️ View recording
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ▶️ View recording
DashboardRunWithAgentMcpCore ▶️ View recording
DashboardRunWithOtelTracesReturnsNoTracesCore ▶️ View recording
DeployK8sBasicApiService ▶️ View recording
DeployK8sWithExternalHelmChart ▶️ View recording
DeployK8sWithGarnet ▶️ View recording
DeployK8sWithMongoDB ▶️ View recording
DeployK8sWithMySql ▶️ View recording
DeployK8sWithPostgres ▶️ View recording
DeployK8sWithRabbitMQ ▶️ View recording
DeployK8sWithRedis ▶️ View recording
DeployK8sWithSqlServer ▶️ View recording
DeployK8sWithValkey ▶️ View recording
DeployTypeScriptAppToKubernetes ▶️ View recording
DescribeCommandResolvesReplicaNames ▶️ View recording
DescribeCommandShowsRunningResources ▶️ View recording
DetachFormatJsonProducesValidJson ▶️ View recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View recording
DoListStepsShowsPipelineSteps ▶️ View recording
DocsCommand_RendersInteractiveMarkdownFromLocalSource ▶️ View recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View recording
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ▶️ View recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View recording
GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain ▶️ View recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View recording
GlobalMigration_PreservesAllValueTypes ▶️ View recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View recording
InteractiveCSharpInitCreatesExpectedFiles ▶️ View recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View recording
JavaScriptHostingApisRunFromTypeScriptAppHost ▶️ View recording
LatestCliCanStartStableChannelAppHost ▶️ View recording
LatestCliCanStartStableChannelTypeScriptAppHost ▶️ View recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View recording
LogLevelTrace_ProducesTraceEntriesInCliLogFile ▶️ View recording
LogsCommandShowsResourceLogs ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterAppIsolated ▶️ View recording
PsCommandListsRunningAppHost ▶️ View recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View recording
PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts ▶️ View recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View recording
ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries ▶️ View recording
ResourceCommand_FailsWhenInteractionServiceIsRequired ▶️ View recording
ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput ▶️ View recording
RestoreGeneratesSdkFiles ▶️ View recording
RestoreGeneratesSdkFiles_WithConfiguredToolchain ▶️ View recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View recording
RunPublishFailureScenarioAsync ▶️ View recording
RunReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
RunReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
SecretCrudOnDotNetAppHost ▶️ View recording
SecretCrudOnTypeScriptAppHost ▶️ View recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View recording
StartReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
StartReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
StopAllAppHostsFromAppHostDirectory ▶️ View recording
StopJavaPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopNonInteractiveSingleAppHost ▶️ View recording
StopTypeScriptPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View recording
UpdateProjectChannelToStable_CSharpEmptyAppHost_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_CSharpSingleFileInit_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_TypeScriptSingleFileInit_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_TypeScript_PreviewsStablePackagesAndPreservesChannel ▶️ View recording

📹 Recordings uploaded automatically from CI run #26430745611

@JamesNK
Copy link
Copy Markdown
Member

JamesNK commented May 26, 2026

Yes, I have the aspire app open in a workspace.

Going into global mode does make the AppHost appear in VS Code, but I would have expected it display in both modes because it's inside the workspace.

extensions-workspace.mp4

@mitchdenny
Copy link
Copy Markdown
Member Author

That is possibly a good improvement, but I don't know if that is what Adam was originally going for with this feature.

@mitchdenny
Copy link
Copy Markdown
Member Author

mitchdenny commented May 26, 2026

Either way this PR is about addressing using aspire ps vs. aspire describe

@davidfowl
Copy link
Copy Markdown
Contributor

Sounds like we regressed something.

Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

Ok. Maybe it is a regression in the previous PR.

I think the code looks good. But wait for @adamint to review and test before merge.

@mitchdenny
Copy link
Copy Markdown
Member Author

@JamesNK @davidfowl looks like it was a regression but it happened a while ago. See issue I just created with analysis. If we want to fix it we should submit another PR, I don't think we should hold this one up.

@mitchdenny
Copy link
Copy Markdown
Member Author

#17490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove resource data from aspire ps — use describe for resource streaming

4 participants