Skip to content

Add experimental CLI-managed C# AppHost mode with shared closure cache#18101

Draft
danegsta wants to merge 18 commits into
mainfrom
danegsta/virtual-apphost-design
Draft

Add experimental CLI-managed C# AppHost mode with shared closure cache#18101
danegsta wants to merge 18 commits into
mainfrom
danegsta/virtual-apphost-design

Conversation

@danegsta

Copy link
Copy Markdown
Member

Description

Adds an experimental CLI-managed C# AppHost mode that mirrors the polyglot AppHost pattern: a thin single-file apphost.cs declares integration packages in aspire.config.json, and the Aspire CLI synthesizes/restores/builds a generated Aspire.csproj module under .aspire/modules/ plus an integration closure cache under .aspire/integrations/apphosts/<hash>/. The single-file AppHost then probes integration assemblies from that cache at runtime via the same ASPIRE_INTEGRATION_LIBS_PATH / ASPIRE_INTEGRATION_PROBE_MANIFEST_PATH env vars that the prebuilt polyglot AppHost server already uses.

The goal is to move the C# AppHost toward the polyglot model (user code + CLI-orchestrated package restore) without a full server/RPC rework. Build and restore now work the same way for both modes; only the runtime hosting differs.

Approach

  • New CSharpCliManagedAppHostModuleGenerator writes .aspire/modules/Aspire.csproj + Aspire.targets from the integration list in aspire.config.json, with closure-emission MSBuild properties/targets injected so build produces the same closure-*.txt files the polyglot path consumes.
  • New IntegrationClosureRestorer owns the CLI-managed restore loop: generate module project, run dotnet restore/dotnet build, read closure files, materialize integration-package-probe-manifest.json and the libs path next to the AppHost. Wired into RestoreCommand and consumed by DotNetAppHostProject to attach env vars to the launched AppHost.
  • New shared IntegrationClosureBuilder static helper owns the MSBuild closure contract (file-name constants, AddClosureProperties / AddClosureTargets XML emission, closure file reader + project.assets.json fingerprinting). Both PrebuiltAppHostServer (polyglot) and IntegrationClosureRestorer (CLI-managed) delegate to it so the two consumers cannot drift on the contract. A ClosureFileMissingBehavior enum bridges divergent error semantics (polyglot throws, CLI-managed warns + returns null).
  • New CLI template cs-managed-empty-apphost (behind the CSharpCliManagedAppHost feature flag in KnownFeatures) scaffolds an apphost.cs + aspire.config.json pair. The generated csproj is intentionally absent — aspire run/aspire restore produce the module project lazily.
  • New playground sample playground/CliManagedCSharpAppHost exercises the end-to-end flow with a Redis integration.

Non-obvious bits worth a careful look

  • DotNetAppHostProject branches on isCliManagedSingleFileAppHost to take the new CLI-managed configuration path, which (unlike normal CliBundle AppHosts) always injects DCP/Dashboard env vars because the single-file AppHost doesn't ship per-RID NuGet metadata for them.
  • The CLI-managed module project is the same Aspire.csproj shape the polyglot AppHost server emits, but it lives next to the AppHost (.aspire/modules/Aspire.csproj) so its obj/project.assets.json is at .aspire/modules/obj/ rather than under the closure restore directory. The shared closure reader takes the assets-file path as a parameter for exactly this reason.
  • appsettings.json content is intentionally NOT shared between the two consumers — it's hashed into the closure manifest as a cache-invalidation signal, and the two paths emit different shapes (polyglot adds a "Logging" block + insertion-ordered AtsAssemblies; CLI-managed only emits sorted AtsAssemblies). The shared reader takes it as opaque input.
  • This is behind the CSharpCliManagedAppHost feature flag and the playground sample uses it to opt in.

Fixes # (issue)

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

danegsta and others added 2 commits June 10, 2026 16:42
Consolidates the MSBuild closure contract (file-name constants, project-file
XML emission, and post-build closure reader) shared by PrebuiltAppHostServer
(polyglot) and IntegrationClosureRestorer (CLI-managed C# AppHost) into a
single IntegrationClosureBuilder static helper so the two consumers cannot
drift on the contract.

ClosureFileMissingBehavior bridges divergent error semantics: the polyglot
path treats missing closure files as a hard error (Throw); the CLI-managed
path warns and returns null so RestoreCommand surfaces the failure with its
own exit code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ost-design

# Conflicts:
#	src/Aspire.Cli/Commands/RestoreCommand.cs
#	src/Aspire.Cli/DotNet/DotNetCliRunner.cs
#	src/Aspire.Cli/Projects/DotNetAppHostProject.cs
#	tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs
Copilot AI review requested due to automatic review settings June 11, 2026 00:09
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🚀 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 -- 18101

Or

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds an experimental CLI-managed C# AppHost mode behind the CSharpCliManagedAppHostEnabled feature flag. It mirrors the polyglot AppHost pattern: a thin single-file apphost.cs (using #:project .aspire/modules/Aspire.csproj instead of #:sdk Aspire.AppHost.Sdk) declares integration packages in aspire.config.json, and the Aspire CLI synthesizes, restores, and builds a generated module project under .aspire/modules/. A shared IntegrationClosureBuilder is extracted so both the polyglot PrebuiltAppHostServer and the new IntegrationClosureRestorer use the same MSBuild closure contract (file names, XML emission, and post-build reading).

Changes:

  • Extracts shared closure logic into IntegrationClosureBuilder and shared project-reference resolution into CSharpIntegrationProjectReferences, refactoring PrebuiltAppHostServer and DotNetBasedAppHostServerProject to use them.
  • Adds CSharpCliManagedAppHostModuleGenerator (module project generation), IntegrationClosureRestorer (build + closure materialization), and a new cs-managed-empty-apphost CLI template with feature-flag gating.
  • Wires CLI-managed AppHost support into DotNetAppHostProject (run/publish/add-package), RestoreCommand, DotNetCliRunner (MSBuild property pass-through), and DI registration.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Aspire.Cli/Projects/IntegrationClosureBuilder.cs New shared static helper owning MSBuild closure contract (file names, XML emission, closure reader, fingerprinting)
src/Aspire.Cli/Projects/IntegrationClosureRestorer.cs New CLI-managed restore loop: generate module, build, read closure, emit probe manifest
src/Aspire.Cli/Projects/CSharpCliManagedAppHostModuleGenerator.cs New module project + targets generator from aspire.config.json integrations
src/Aspire.Cli/Projects/CSharpIntegrationProjectReferences.cs New shared helper resolving integration references as project or package references
src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs Refactored to delegate closure logic to IntegrationClosureBuilder
src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs Refactored to use CSharpIntegrationProjectReferences.Resolve; internal visibility for helpers
src/Aspire.Cli/Projects/DotNetAppHostProject.cs CLI-managed AppHost branching in run/publish/add-package/validate paths
src/Aspire.Cli/DotNet/DotNetCliRunner.cs ProcessInvocationOptions.MSBuildProperties dictionary + pass-through in build/run/restore
src/Aspire.Cli/Commands/RestoreCommand.cs CLI-managed restore path via IntegrationClosureRestorer
src/Aspire.Cli/Templating/CliTemplateFactory.cs Register cs-managed-empty-apphost template behind feature flag
src/Aspire.Cli/Templating/CliTemplateFactory.EmptyTemplate.cs Template apply + write methods for CLI-managed C# empty AppHost
src/Aspire.Cli/Templating/KnownTemplateId.cs New CSharpCliManagedEmptyAppHost constant
src/Aspire.Cli/Templating/Templates/cs-managed-empty-apphost/* Template files: apphost.cs, aspire.config.json, .vscode/extensions.json
src/Aspire.Cli/KnownFeatures.cs New CSharpCliManagedAppHostEnabled feature flag
src/Aspire.Cli/Program.cs DI registrations for module generator and closure restorer
src/Aspire.Cli/Aspire.Cli.csproj Embedded resource config for new template
playground/CliManagedCSharpAppHost/* Playground sample exercising end-to-end flow with Redis
tests/Aspire.Cli.Tests/Projects/CSharpCliManagedAppHostModuleGeneratorTests.cs Unit tests for module generation (references, channels, feature gating)
tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs Tests for CLI-managed run/publish/add-package/CanHandle paths
tests/Aspire.Cli.Tests/Projects/PrebuiltAppHostServerTests.cs Updated to use IntegrationClosureBuilder constants
tests/Aspire.Cli.Tests/Commands/RestoreCommandTests.cs Test for CLI-managed restore flow
tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs Tests for template visibility and file-based AppHost creation
tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs DI registration updates for test service collection

Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Comment thread src/Aspire.Cli/Projects/CSharpIntegrationProjectReferences.cs Outdated
Comment thread src/Aspire.Cli/Projects/IntegrationClosureRestorer.cs Outdated
danegsta and others added 2 commits June 10, 2026 17:52
… probe manifest path

- IntegrationClosureRestorer.RestoreAsync now honors PackageSourceOverride
  by routing through the rich TryGenerateAsync overload, so a subsequent
  regenerate doesn't drop RestoreAdditionalProjectSources/RestoreConfigFile.
- CSharpIntegrationProjectReferences.Resolve takes privateProjectReferences
  (default true). CLI-managed module generator passes false so in-repo
  project refs flow into ReferenceCopyLocalPaths and the closure captures
  their outputs. Polyglot server keeps default behavior.
- IntegrationClosureLayout.ProbeManifestPath is now nullable; TryLoad
  returns null when neither artifact is present and leaves ProbeManifestPath
  null when only the libs path exists. Consumer guards the env var on a
  non-empty path so we never wire a non-existent file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two issues found by end-to-end testing of the CLI-managed C# AppHost mode:

1. Freshly-created apphost.cs failed to compile with CS0103 on
   DistributedApplication because #:project ProjectReferences only
   contribute assembly references; they don't flow source-level global
   usings. Add 'using Aspire.Hosting;' to the cs-managed-empty-apphost
   template and the playground apphost so the synthesized file-based
   project compiles out of the box, matching the classic AppHost
   Program.cs convention.

2. 'aspire restore' with a missing or unresolvable integration package
   exited correctly but only printed 'See logs at ...' with no inline
   diagnostic. RestoreCommand now wires an OutputCollector through
   IntegrationClosureRestoreOptions.BuildInvocationOptions and calls
   DisplayLines on failure so users see the raw restore output (NU1101,
   NU1605, downgrade messages, source mappings, etc.) inline. The log
   file pointer is preserved for deeper investigation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Comment thread src/Aspire.Cli/Commands/RestoreCommand.cs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 3 jobs were identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

  • Tests / NATS.Net / NATS.Net (ubuntu-latest) - Failed step 'Build test project' will be retried because the job log shows a likely transient infrastructure network failure. Matched pattern: /Unable to load the service index for source https:\/\/(?:pkgs\.dev\.azure\.com\/dnceng|dnceng\.pkgs\.visualstudio\.com)\/public\/_packaging\//i.
  • Tests / Hosting.Sdk / Hosting.Sdk (ubuntu-latest) - Failed step 'Build test project' will be retried because the job log shows a likely transient infrastructure network failure. Matched pattern: /Unable to load the service index for source https:\/\/(?:pkgs\.dev\.azure\.com\/dnceng|dnceng\.pkgs\.visualstudio\.com)\/public\/_packaging\//i.
  • Tests / Hosting.CodeGeneration.Python / Hosting.CodeGeneration.Python (ubuntu-latest) - Failed step 'Build test project' will be retried because the job log shows a likely transient infrastructure network failure. Matched pattern: /Unable to load the service index for source https:\/\/(?:pkgs\.dev\.azure\.com\/dnceng|dnceng\.pkgs\.visualstudio\.com)\/public\/_packaging\//i.

Comment thread src/Aspire.Cli/Commands/RestoreCommand.cs Outdated
danegsta and others added 2 commits June 11, 2026 13:08
Inline the generated CLI-managed module targets into Aspire.csproj instead of generating a separate Aspire.targets file, while deleting any stale targets file from older generations.

Restore the existing AppHost server project reference behavior after the shared resolver refactor so TypeScript API compatibility can still scan Aspire.Hosting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Comment thread src/Aspire.Cli/Projects/DotNetAppHostProject.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 01:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated no new comments.

danegsta and others added 2 commits June 11, 2026 18:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 01:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.

Comment on lines +126 to +127
var hash = XxHash3.Hash(Encoding.UTF8.GetBytes(appHostFullPath));
var hashFragment = Convert.ToHexString(hash)[..12].ToLowerInvariant();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This does invalidate a previous restore (but not in a way that breaks restore, it's a one-time change on a subsequent run). Main thing is that SHA256 usage is discouraged for non-crypto uses like this so that we don't eventually get yelled at for using it like MD6, SHA1, etc. before it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
"path": "apphost.cs"
},
"features": {
"csharpCliManagedAppHostEnabled": true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Any thoughts on this feature name?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 20:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.

Comment thread src/Aspire.Cli/Projects/GuestAppHostProject.cs Outdated
danegsta and others added 2 commits June 12, 2026 13:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generate AppHost-specific props and targets for CLI-managed C# AppHosts so CLI-owned builds get direct compile references and keep file AppHost build outputs under .aspire. Clear injected DirectoryBuild* properties from project references so referenced projects use their normal build conventions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 41 out of 41 changed files in this pull request and generated 2 comments.

Comment thread src/Aspire.Cli/Projects/CSharpCliManagedAppHostModuleGenerator.cs Outdated
Comment thread src/Aspire.Cli/DotNet/DotNetCliRunner.cs Outdated
danegsta and others added 2 commits June 12, 2026 15:16
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@danegsta

Copy link
Copy Markdown
Member Author

PR Testing Report

PR Information

CLI Version Verification

  • Expected Commit: 16af89a
  • Installed Version: 13.5.0-pr.18101.g16af89a0
  • Status: ✅ Verified (installed version contains short SHA 16af89a)

Changes Analyzed

Files Changed

  • CLI AppHost creation/restore/run/build plumbing under src/Aspire.Cli/
  • CLI-managed C# template under src/Aspire.Cli/Templating/Templates/cs-managed-empty-apphost/
  • Shared integration closure/cache helpers under src/Aspire.Cli/Projects/
  • CLI tests under tests/Aspire.Cli.Tests/
  • Playground sample under playground/CliManagedCSharpAppHost/

Change Categories

  • CLI changes detected — CLI-managed C# AppHost mode, restore/build/run, aspire add, closure cache, repo-local detection
  • Hosting integration changes
  • Dashboard changes
  • Client/Component changes
  • Template changes detected — new feature-flagged aspire-cs-empty template
  • Test changes detected

Test Scenarios Executed

Scenario 1: Install PR Dogfood CLI

Objective: Install the PR CLI from the Dogfood comment and verify it matches the latest PR head.
Coverage Type: Happy path
Status: ✅ Passed

Evidence:

  • Installed CLI: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/dogfood/pr-18101/bin/aspire
  • PR hive: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/hives/pr-18101/packages
  • Installed version: 13.5.0-pr.18101.g16af89a0

Scenario 2: Create CLI-managed C# AppHost

Objective: Create a new aspire-cs-empty app from the PR hive with the feature flag enabled.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Ran aspire new aspire-cs-empty with --source, --version, --localhost-tld false, --non-interactive, and --suppress-agent-init.
  2. Verified generated files include apphost.cs, aspire.config.json, nuget.config, and VS Code recommendations.
  3. Verified no user-authored .csproj exists in the new app root.

Evidence:

  • Log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/new.log
  • Generated file snapshot: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/generated-files.txt

Scenario 3: Restore CLI-managed AppHost and generated module

Objective: Verify aspire restore generates the virtual module/build files and closure cache.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Ran aspire restore --apphost apphost.cs.
  2. Verified generated .aspire/modules/Aspire.csproj.
  3. Verified generated AppHost.Directory.Build.props and AppHost.Directory.Build.targets.
  4. Verified integration closure cache files under .aspire/integrations/apphosts/<hash>/.

Evidence:

  • Log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/restore.log
  • Generated artifact snapshot: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/restore-artifacts.txt

Scenario 4: Direct dotnet build guidance

Objective: Verify direct dotnet build apphost.cs fails with the expected CLI-managed guidance after restore.
Coverage Type: Unhappy path
Status: ✅ Passed

Expected Outcome: Non-zero exit code with guidance to use aspire run, aspire restore, or aspire publish.

Observed: dotnet build apphost.cs exited 1 and emitted:

This AppHost is managed by the Aspire CLI. Use 'aspire run', 'aspire restore', or 'aspire publish' instead of direct dotnet commands.

Evidence:

  • Log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/direct-dotnet-build.log

Scenario 5: Run empty CLI-managed AppHost

Objective: Verify the generated empty AppHost builds and starts through the Aspire CLI.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Ran aspire run --detach --isolated --format Json --apphost apphost.cs.
  2. Verified detach returned dashboard URL and AppHost PID.
  3. Ran aspire describe --apphost apphost.cs and observed the dashboard resource running healthy.
  4. Stopped the AppHost with aspire stop --apphost apphost.cs.

Evidence:

  • Run log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/run-detached.log
  • Describe log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/describe.log
  • Stop log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/stop.log

Scenario 6: Add Redis integration and consume generated API

Objective: Verify aspire add persists integration package metadata in aspire.config.json, restore regenerates module references, and the AppHost can call builder.AddRedis("cache") without a #:package directive.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Ran aspire add Aspire.Hosting.Redis --apphost apphost.cs.
  2. Edited apphost.cs to add builder.AddRedis("cache"); while keeping only #:project .aspire/modules/Aspire.csproj.
  3. Ran aspire restore --apphost apphost.cs.
  4. Ran aspire run --detach --isolated --format Json --apphost apphost.cs.
  5. Ran aspire wait cache --status up --timeout 180 --apphost apphost.cs.
  6. Ran aspire describe --apphost apphost.cs and observed cache as a healthy running container.
  7. Stopped the AppHost.

Evidence:

  • Add log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/add-redis.log
  • Final AppHost: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/final-apphost.cs.txt
  • Final config: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/final-aspire.config.json.txt
  • Restore log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/restore-after-redis.log
  • Wait log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/wait-cache-up.log
  • Describe log: /var/folders/97/44fp_02d4kd90s9p6sy_jwgh0000gn/T/aspire-pr-test-XXXXXX.T4RjHI0dtM/scenario-cli-managed-cs/describe-redis-after-wait.log

Summary

Scenario Status Notes
Install PR Dogfood CLI ✅ Passed Version matched PR head short SHA
Create CLI-managed C# AppHost ✅ Passed Generated expected file-based AppHost shape
Restore generated module/closure ✅ Passed Generated module, props/targets, and closure cache
Direct dotnet build guidance ✅ Passed Failed safely with expected guidance
Run empty AppHost ✅ Passed Detached run and dashboard describe succeeded
Add Redis and consume generated API ✅ Passed AddRedis compiled/ran without #:package; cache reached Running/Healthy

Overall Result

✅ PR VERIFIED

Notes

  • aspire ps was not included as a validation scenario because this PR build's ps command does not accept --apphost or --include-hidden; explicit --apphost was used for describe, wait, and stop.
  • Known package vulnerability warnings for MessagePack appeared during restore/build output and were not caused by this PR.

danegsta and others added 2 commits June 12, 2026 16:42
Canonicalize explicit AppHost paths to the filesystem path before invoking MSBuild or matching running AppHost sockets. This keeps macOS /var and /private/var path identities consistent across run, wait, describe, and stop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rely on the existing segment-walking path resolver for Unix filesystem path canonicalization instead of hardcoding macOS firmlink prefixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 51 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 51 changed files in this pull request and generated no new comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

CLI E2E Tests failed — 114 passed, 1 failed, 2 unknown (commit c3b9ad2)

❌ Failed Tests

- Test Detail
DeployK8sWithRedis Recording · Job · CLI logs
View all recordings
- Test Detail
AddPackageInteractiveWhileAppHostRunningDetached Recording · Job · CLI logs
AddPackageWhileAppHostRunningDetached Recording · Job · CLI logs
AgentCommands_AllHelpOutputs_AreCorrect Recording · Job · CLI logs
AgentInitCommand_DefaultSelection_InstallsDefaultSkills Recording · Job · CLI logs
AgentInitCommand_MigratesDeprecatedConfig Recording · Job · CLI logs
AgentInit_NonInteractive_BundleOnlySkillsNotInCatalog Recording · Job · CLI logs
AgentMcpListResources_ExcludesResourceMarkedWithExcludeFromMcp Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost Recording · Job · CLI logs
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated Recording · Job · CLI logs
AllPublishMethodsBuildDockerImages Recording · Job · CLI logs
AspireAddAndStartWorkAgainstLegacyAppHostTs Recording · Job · CLI logs
AspireAddPackageVersionToDirectoryPackagesProps Recording · Job · CLI logs
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost Recording · Job · CLI logs
AspireInit_ExistingAppHostDir_RecreatesNuGetConfigKeepsFiles Recording · Job · CLI logs
AspireInit_SolutionFile_BuildsAgainstChannelHive Recording · Job · CLI logs
AspireStartUpdatesStaleTypeScriptAppHostPath Recording · Job · CLI logs
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps Recording · Job · CLI logs
AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent Recording · Job · CLI logs
Banner_DisplayedOnFirstRun Recording · Job · CLI logs
Banner_DisplayedWithExplicitFlag Recording · Job · CLI logs
Banner_NotDisplayedWithNoLogoFlag Recording · Job · CLI logs
CertificatesClean_RemovesCertificates Recording · Job · CLI logs
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate Recording · Job · CLI logs
CertificatesTrust_WithUntrustedCert_TrustsCertificate Recording · Job · CLI logs
ConfigSetGet_CreatesNestedJsonFormat Recording · Job · CLI logs
CreateAndRunAspireStarterProject Recording · Job · CLI logs
CreateAndRunAspireStarterProjectWithBundle Recording · Job · CLI logs
CreateAndRunEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunJavaEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunJsReactProject Recording · Job · CLI logs
CreateAndRunPolyglotAppHostWithDevLocalhostUrls Recording · Job · CLI logs
CreateAndRunPythonReactProject Recording · Job · CLI logs
CreateAndRunTypeScriptEmptyAppHostProject Recording · Job · CLI logs
CreateAndRunTypeScriptStarterProject Recording · Job · CLI logs
CreateJavaAppHostWithViteApp Recording · Job · CLI logs
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain Recording · Job · CLI logs
DashboardRunWithAgentMcpListTracesReturnsNoTraces Recording · Job · CLI logs
DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost Recording · Job · CLI logs
DashboardRunWithOtelTracesReturnsNoTraces Recording · Job · CLI logs
DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost Recording · Job · CLI logs
DeployK8sBasicApiService Recording · Job · CLI logs
DeployK8sWithExternalHelmChart Recording · Job · CLI logs
DeployK8sWithGarnet Recording · Job · CLI logs
DeployK8sWithMongoDB Recording · Job · CLI logs
DeployK8sWithMySql Recording · Job · CLI logs
DeployK8sWithPostgres Recording · Job · CLI logs
DeployK8sWithRabbitMQ Recording · Job · CLI logs
DeployK8sWithRedis Recording · Job · CLI logs
DeployK8sWithSqlServer Recording · Job · CLI logs
DeployK8sWithValkey Recording · Job · CLI logs
DeployTypeScriptAppToKubernetes Recording · Job · CLI logs
DescribeCommandResolvesReplicaNames Recording · Job · CLI logs
DescribeCommandShowsRunningResources Recording · Job · CLI logs
DetachFormatJsonProducesValidJson Recording · Job · CLI logs
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance Recording · Job · CLI logs
DoPublishAndDeployListStepsWork Recording · Job · CLI logs
DocsCommand_RendersInteractiveMarkdownFromLocalSource Recording · Job · CLI logs
DoctorCommand_DetectsDeprecatedAgentConfig Recording · Job · CLI logs
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain Recording · Job · CLI logs
DoctorCommand_WithSslCertDir_ShowsTrusted Recording · Job · CLI logs
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted Recording · Job · CLI logs
DotNetRunFileBasedAppHostUsesAspireCliBundle Recording · Job · CLI logs
DotNetRunProjectAppHostUsesAspireCliBundle Recording · Job · CLI logs
GatewayWithoutExternalEndpoint_FailsPublishWithGuidance Recording · Job · CLI logs
GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain Recording · Job · CLI logs
GlobalMigration_HandlesCommentsAndTrailingCommas Recording · Job · CLI logs
GlobalMigration_HandlesMalformedLegacyJson Recording · Job · CLI logs
GlobalMigration_PreservesAllValueTypes Recording · Job · CLI logs
GlobalMigration_SkipsWhenNewConfigExists Recording · Job · CLI logs
GlobalSettings_MigratedFromLegacyFormat Recording · Job · CLI logs
IngressWithoutExternalEndpoint_FailsPublishWithGuidance Recording · Job · CLI logs
InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory Recording · Job · CLI logs
InteractiveCSharpInitCreatesExpectedFiles Recording · Job · CLI logs
InvalidAppHostPathWithComments_IsHealedOnRun Recording · Job · CLI logs
JavaScriptHostingApisRunFromTypeScriptAppHost Recording · Job · CLI logs
LatestCliCanStartStableChannelAppHost Recording · Job · CLI logs
LatestCliCanStartStableChannelTypeScriptAppHost Recording · Job · CLI logs
LegacySettingsMigration_AdjustsRelativeAppHostPath Recording · Job · CLI logs
LogsCommandShowsResourceLogs Recording · Job · CLI logs
OtelLogsReturnsStructuredLogsFromStarterApp Recording · Job · CLI logs
OtelLogsReturnsStructuredLogsFromStarterAppIsolated Recording · Job · CLI logs
ProcessCommandCallbackReceivesCliArguments Recording · Job · CLI logs
PsCommandListsRunningAppHost Recording · Job · CLI logs
PsFormatJsonOutputsOnlyJsonToStdout Recording · Job · CLI logs
PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts Recording · Job · CLI logs
PublishWithConfigureEnvFileUpdatesEnvOutput Recording · Job · CLI logs
PublishWithDockerComposeServiceCallbackSucceeds Recording · Job · CLI logs
PublishWithoutOutputPathUsesAppHostDirectoryDefault Recording · Job · CLI logs
ResourceCommand_FailedExec_ShowsLogPathAndLogHasEntries Recording · Job · CLI logs
ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput Recording · Job · CLI logs
RestoreGeneratesSdkFiles Recording · Job · CLI logs
RestoreGeneratesSdkFiles_WithConfiguredToolchain Recording · Job · CLI logs
RestoreRefreshesGeneratedSdkAfterAddingIntegration Recording · Job · CLI logs
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes Recording · Job · CLI logs
RunFromParentDirectory_UsesExistingConfigNearAppHost Recording · Job · CLI logs
RunReportsSyntaxErrorsForDotNetAppHost Recording · Job · CLI logs
RunReportsSyntaxErrorsForTypeScriptAppHost Recording · Job · CLI logs
SecretCrudOnDotNetAppHost Recording · Job · CLI logs
SecretCrudOnTypeScriptAppHost Recording · Job · CLI logs
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels Recording · Job · CLI logs
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets Recording · Job · CLI logs
StartReportsSyntaxErrorsForDotNetAppHost Recording · Job · CLI logs
StartReportsSyntaxErrorsForTypeScriptAppHost Recording · Job · CLI logs
StopAllAppHostsFromAppHostDirectory Recording · Job · CLI logs
StopJavaPolyglotAppHostUsingApphostDirectory Recording · Job · CLI logs
StopNonInteractiveSingleAppHost Recording · Job · CLI logs
StopTypeScriptPolyglotAppHostUsingApphostDirectory Recording · Job · CLI logs
StopWithNoRunningAppHostExitsSuccessfully Recording · Job · CLI logs
TerminalAttachFrontend_ShowsViteHelpAndDetaches Recording · Job · CLI logs
TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback Recording · Job · CLI logs
TypeScriptAppHostWithVite_AllowsDifferentGuestPkgManager Recording · Job · CLI logs
UnAwaitedChainsCompileWithAutoResolvePromises Recording · Job · CLI logs
UpdateToStable_CSharpEmptyAppHost_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_CSharpSingleFileInit_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel Recording · Job · CLI logs
UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel Recording · Job · CLI logs

📹 Recordings uploaded automatically from CI run #27450820891

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.

3 participants