Skip to content

Simplify Aspire.Cli process code using .NET 11 Process APIs - #17079

Merged
Eric Erhardt (eerhardt) merged 12 commits into
mainfrom
eerhardt/simplify-cli-process-apis
Oct 1, 2026
Merged

Eric Erhardt (eerhardt) merged 12 commits into
mainfrom
eerhardt/simplify-cli-process-apis

Conversation

@eerhardt

@eerhardt Eric Erhardt (eerhardt) commented May 14, 2026 •

Copy link
Copy Markdown
Member

Description

.NET 11 adds System.Diagnostics.Process APIs that cover most of the process plumbing Aspire.Cli used to write by hand (see https://devblogs.microsoft.com/dotnet/process-api-improvements-in-dotnet-11/). This PR moves the CLI onto those APIs and deletes the custom code they replace. Net change vs main: 48 files, +803 / -3,924 lines.

ProcessExecution uses Process.Start directly; IsolatedProcess is gone

  • Deletes IsolatedProcess (all platforms), WindowsConsoleProcessJob, and nearly all of WindowsProcessInterop. Only SetConsoleCtrlHandler remains, and Program.cs still uses it.
  • ProcessExecutionFactory.CreateProcessStartInfo maps the CLI launch options onto ProcessStartInfo:
    • Stdin: always the null handle, so children see EOF (aspire init/add/restore can hang silently when stdin is a TTY (macOS) #16791). Detached children also get null stdout/stderr.
    • Windows, IsolateConsole / KillOnParentExit / Detached:
      • CreateNoWindow = IsolateConsole gives the child its own hidden console for targeted CTRL+C.
      • KillOnParentExit replaces the hand-rolled kill-on-close job, assigned atomically at creation.
      • InheritedHandles = [] means the child inherits only the std handles.
    • Unix, detached: StartDetached (setsid) replaces the DCP fork-process launcher, as Use DCP fork-process for Unix detached start #18678 anticipated. The child stays a direct child, so its PID and exit code are observable, and no bundle/layout lease is needed.
  • ProcessExecution reads output with Process.ReadAllLinesAsync, so WaitForExitAsync doesn't wait on pipes a grandchild holds open.
  • AgentTelemetryUploader uses Process.StartAndForget.
  • I checked with a real DCP binary: dcp stop-process-tree still delivers CTRL+C to a child started with CreateNoWindow + KillOnParentExit + InheritedHandles = [].

One-shot commands

  • RunAndCaptureText[Async]: the agent CLI version probes (Claude Code, Copilot, OpenCode, VS Code, Playwright), UpdateCommand, CertificateHelpers (5-second timeout), OpenSSL and macOS security calls, GitRepository, NpmRunner, DeprecatedWorkloadCheck, and the Deno version check.
  • Process.Run(..., silent: true): WSL PowerShell trust and the macOS trust commands.
  • ReadAllLinesAsync: DotNetSdkInstaller streams dotnet --list-sdks.
  • Removed launches:
    • CliDownloader no longer runs ldd --version. It detects musl from RuntimeInformation.RuntimeIdentifier (via IEnvironment), which NativeAOT sets to the publish RID.
    • DotNetBasedAppHostServerProject reuses IDotNetCliRunner.GetNuGetConfigPathsAsync instead of its own dotnet nuget config paths launch.
  • Deleted helpers: CertificateProcessRunner and ProcessOutputReader, with their tests.

Sites that keep custom code

Each has a comment explaining why the new APIs don't fit:

  • DotNetSdkInstaller and UnixCertificateManager.RunCertUtil: kill the whole process tree on cancel. The runtime helpers only kill the root process.
  • ProcessCaptureRunner (PeerInstallProbe): caps output at 1 MiB per stream, kills the tree on timeout, and bounds the post-exit drain.
  • MacOSCertificateManager find-certificate: captures stdout only.

Follow-up

#20618 tracks routing the remaining direct Process launches through IProcessExecutionFactory. Those call sites already bypassed the factory on main.

Behavior changes to review

  • Captured text no longer goes through BOM detection. Output is decoded with the configured or default encoding.
  • On cancellation or timeout:
    • git and the Deno check now kill only the root process (previously the whole tree);
    • npm now kills the root process (previously nothing was killed).
  • Isolated Windows children get CREATE_NO_WINDOW instead of CREATE_NEW_CONSOLE | SW_HIDE. Both give the child its own hidden console.
  • Non-detached Unix children get /dev/null stdin instead of a closed pipe. Both read as EOF.
  • Detached Unix children are started with setsid directly instead of through DCP fork-process.
  • ProcessExecution stdout and stderr line callbacks are now serialized rather than concurrent.
  • On Unix, environment variables whose names differ only by case (e.g. http_proxy / HTTP_PROXY) are passed through to children instead of being collapsed.
  • AppHostServerSessionTests now uses ping instead of cmd /c pause as its long-running Windows command. pause exits right away on EOF stdin, so the "still running" assertions raced under load.

Validation

  • Aspire.Cli and Aspire.Cli.Tests build with 0 warnings on 11.0.100-rc.1.26425.128.
  • New tests in ProcessExecutionTests / ProcessExecutionDetachedTests:
    • Windows launch-option mapping;
    • CTRL+C delivered through the child's own console;
    • valid null stdin;
    • a shared stdout/stderr handle;
    • output callbacks that throw;
    • a Unix detached child in a new session.
  • Targeted runs on Windows (quarantined and outerloop excluded):
    • DotNetSdkInstaller, UnixCertificateManager, MacOSCertificateManager and ProcessExecutionDetached tests: 46 passed, 7 skipped (non-Windows).
    • AppHostServerProject, ScaffoldCache, ChannelResolution, AppHostServerSession and CliDownloader tests: 45 passed, 1 failed. The failure is a Verify snapshot line-ending mismatch caused by CRLF files in my local checkout; this PR doesn't touch that snapshot.
  • Linux and macOS coverage (StartDetached, certificate managers) comes from CI.

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

Use the new .NET 11 Preview 4 Process APIs to simplify process creation
and output capture throughout src/Aspire.Cli:

- Process.RunAndCaptureTextAsync for start+capture+wait patterns
- Process.RunAndCaptureText for synchronous equivalents
- Process.Run for fire-and-check-exit-code patterns
- Process.ReadAllLinesAsync for line-by-line multiplexed streaming
- File.OpenNullHandle() + StandardOutputHandle/StandardErrorHandle
  for null-device redirection
- ProcessStartInfo.InheritedHandles for controlled handle inheritance

The biggest win is DetachedProcessLauncher, where ~490 lines of
platform-specific P/Invoke (Windows) and pipe-close workarounds (Unix)
are replaced by a single cross-platform implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eerhardt Eric Erhardt (eerhardt) added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label May 14, 2026
@github-actions

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 -- 17079

Or

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

@davidfowl

Copy link
Copy Markdown
Collaborator

I love this but lets not make anyone have to install .NET 11 previews to work on aspire 😄

@eerhardt

Copy link
Copy Markdown
Member Author

I love this but lets not make anyone have to install .NET 11 previews to work on aspire 😄

Agreed. This is mostly exploratory and probably won't be merged anytime soon. Maybe when .NET 11 releases?

@adamsitnik Adam Sitnik (adamsitnik) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Eric Erhardt (@eerhardt) big thanks for giving the new API a try so quickly!!

Preserve main's process lifecycle, cancellation, and telemetry while retaining the Process API simplifications. Cover partial certificate output capture and keep stdin non-interactive through null handles.

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

Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090
@github-actions

This comment has been minimized.

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.

Copilot review overview

🟡 Changes recommended

Several migrations drop CreateNoWindow = true, and the PR description materially misstates the current scope.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 7 Medium severity · 1 Low severity

Open (8)
What changed in this PR

Modernizes remaining Aspire CLI process execution code with .NET 11 APIs while preserving custom cancellation and stream-handling behavior.

Changes:

  • Replaces manual output capture with RunAndCaptureText[Async] and ReadAllTextAsync.
  • Uses null handles for non-interactive stdin and expands certificate process tests.
  • Adds rationale for retaining platform-specific launch behavior; the PR description remains outdated.
File Description
src/​Aspire.Cli/​Agents/​ClaudeCode/​ClaudeCodeCliRunner.cs Simplifies version capture.
src/​Aspire.Cli/​Agents/​Copilot/​CopilotCliRunner.cs Simplifies version capture.
src/​Aspire.Cli/​Agents/​OpenCode/​OpenCodeCliRunner.cs Simplifies version capture.
src/​Aspire.Cli/​Agents/​Playwright/​PlaywrightCliRunner.cs Simplifies version and installation capture.
src/​Aspire.Cli/​Agents/​VsCode/​VsCodeCliRunner.cs Simplifies version capture.
src/​Aspire.Cli/​Certificates/​CertificateGeneration/​CertificateProcessRunner.cs Uses multiplexed output reading.
src/​Aspire.Cli/​Certificates/​CertificateHelpers.cs Uses synchronous process capture.
src/​Aspire.Cli/​Commands/​UpdateCommand.cs Simplifies updated-version detection.
src/​Aspire.Cli/​DotNet/​DotNetSdkInstaller.cs Multiplexes SDK command output.
src/​Aspire.Cli/​Git/​GitRepository.cs Multiplexes Git output while preserving tree cancellation.
src/​Aspire.Cli/​Npm/​NpmRunner.cs Uses null stdin and high-level output capture.
src/​Aspire.Cli/​OpenCode/​OpenCodeCliRunner.cs Simplifies legacy OpenCode version capture.
src/​Aspire.Cli/​Processes/​IsolatedProcess.Unix.cs Documents detached-launch constraints.
src/​Aspire.Cli/​Processes/​IsolatedProcess.Windows.cs Documents retained console isolation behavior.
src/​Aspire.Cli/​Processes/​IsolatedProcess.cs Replaces closed stdin pipes with a null handle.
src/​Aspire.Cli/​Projects/​DotNetBasedAppHostServerProject.cs Simplifies NuGet configuration discovery.
src/​Aspire.Cli/​Utils/​CliDownloader.cs Simplifies musl detection.
src/​Aspire.Cli/​Utils/​EnvironmentChecker/​DeprecatedWorkloadCheck.cs Multiplexes workload command output.
tests/​Aspire.Cli.Tests/​Certificates/​CertificateProcessRunnerTests.cs Covers all output-redirection combinations.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Restore hidden-window options and conditional pipe waits where the one-shot text APIs are not equivalent. Use multiplexed byte capture with StreamReader BOM detection for paired output, and record npm process IDs immediately after launch.

Add regression coverage for UTF-8/16/32 BOMs, per-stream and default encodings, partial stream redirection, and live npm profiling.

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

Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090
@github-actions

This comment has been minimized.

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.

Use silent execution for non-interactive PowerShell certificate trust and stream SDK records with ReadAllLinesAsync. Bound OpenSSL capture and exit with process-tree cleanup, and give detached Windows children a valid null stdin handle. Add BOM, cancellation, and detached-stdin regression coverage.

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

Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090

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.

Copilot review overview

🔵 Needs a closer look

The broad cross-platform process-lifecycle and handle changes warrant final human validation despite focused regression coverage.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

@github-actions

This comment has been minimized.

@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.

@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.

Replace hand-rolled process plumbing in Aspire.Cli with the new .NET 11
System.Diagnostics.Process APIs:

- IsolatedProcess: replace the custom Windows CreateProcessW launcher,
  WindowsConsoleProcessJob and most of WindowsProcessInterop with
  Process.Start using CreateNoWindow, KillOnParentExit, InheritedHandles
  and null std handles from File.OpenNullHandle. Detached Unix launches
  still go through DCP fork-process for PID handoff and exit monitoring.
- One-shot probes (agent CLIs, update, downloader, certificates, git, npm,
  Deno, workload check, NuGet config) now use Process.RunAndCaptureText[Async]
  or Process.Run(silent: true).
- Remove CertificateProcessRunner and ProcessOutputReader.
- Comment the remaining sites that still need custom handling (tree-kill
  on cancel, capped output capture, stdout-only capture).
- Harden AppHostServerSessionTests to use a long-running command that
  does not exit on EOF stdin.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090

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.

@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.

Comment thread src/Aspire.Cli/Utils/CliDownloader.cs Resolved

@danegsta David Negstad (danegsta) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Found two process-abstraction correctness issues: one identity-environment leak in the self-update version probe and one process-tree cancellation gap in npm execution.

Comment thread src/Aspire.Cli/Npm/NpmRunner.cs Resolved

@danegsta David Negstad (danegsta) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added two process-abstraction comments: the agent version-probe family should use the injectable process-execution service, and the mutating Playwright installation path should retain centralized child-process policy.

@danegsta David Negstad (danegsta) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One additional process-abstraction issue found.

Comment thread src/Aspire.Cli/Git/GitRepository.cs Resolved

@danegsta David Negstad (danegsta) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Five additional direct-process abstraction issues found in the CLI scan.

Comment thread src/Aspire.Cli/Utils/CliDownloader.cs Resolved
- Give macOS `security verify-cert` and NSS certutil a null stdin.
- Validate the minimum SDK version before launching `dotnet --list-sdks`.
- Reuse IDotNetCliRunner.GetNuGetConfigPathsAsync in DotNetBasedAppHostServerProject
  instead of a second direct `dotnet nuget config paths` launch.
- Use IEnvironment.RuntimeIdentifier for the CLI download RID, removing the
  `ldd --version` musl probe.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d695e49d-5cf6-48f3-bc17-90538e743090
@github-actions

This comment has been minimized.

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.

Copilot review overview

🟡 Changes recommended

Runtime RID handling can request nonexistent archives, and detached Unix behavior contradicts the documented scope.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)

Comment thread src/Aspire.Cli/Utils/CliDownloader.cs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

2 / 97 PR test projects · 4 PR jobs, from 47 changed files.

Selected PR test projects (2 / 97)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Certificates/CertificateProcessRunnerTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessExecutionDetachedTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessExecutionTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/DotNet/ProcessInvocationOptionsTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Npm/NpmRunnerTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Processes/IsolatedProcessTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Processes/WindowsConsoleProcessJobTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/AppHostServerSessionTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Utils/DeprecatedWorkloadCheckTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Utils/TestEnvironment.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Agents/ClaudeCode/ClaudeCodeCliRunner.cs, src/Aspire.Cli/Agents/Copilot/CopilotCliRunner.cs, src/Aspire.Cli/Agents/OpenCode/OpenCodeCliRunner.cs, src/Aspire.Cli/Agents/Playwright/PlaywrightCliRunner.cs, src/Aspire.Cli/Agents/VsCode/VsCodeCliRunner.cs, src/Aspire.Cli/Certificates/CertificateGeneration/CertificateProcessRunner.cs, src/Aspire.Cli/Certificates/CertificateGeneration/MacOSCertificateManager.cs, src/Aspire.Cli/Certificates/CertificateGeneration/UnixCertificateManager.cs, src/Aspire.Cli/Certificates/CertificateHelpers.cs, src/Aspire.Cli/Commands/AgentTelemetryCommand.cs, src/Aspire.Cli/Commands/UpdateCommand.cs, src/Aspire.Cli/DotNet/DotNetCliRunner.cs, src/Aspire.Cli/DotNet/DotNetSdkInstaller.cs, src/Aspire.Cli/DotNet/ProcessExecution.cs, src/Aspire.Cli/DotNet/ProcessExecutionFactory.cs, src/Aspire.Cli/Git/GitRepository.cs, src/Aspire.Cli/HostEnvironment.cs, src/Aspire.Cli/IEnvironment.cs, src/Aspire.Cli/Npm/NpmRunner.cs, src/Aspire.Cli/OpenCode/OpenCodeCliRunner.cs, src/Aspire.Cli/Processes/IsolatedProcess.Unix.cs, src/Aspire.Cli/Processes/IsolatedProcess.Windows.cs, src/Aspire.Cli/Processes/IsolatedProcess.cs, src/Aspire.Cli/Processes/ProcessEnvironment.cs, src/Aspire.Cli/Processes/WindowsConsoleProcessJob.cs, src/Aspire.Cli/Processes/WindowsProcessInterop.cs, src/Aspire.Cli/Program.cs, src/Aspire.Cli/Projects/AppHostServerSession.cs, src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs, src/Aspire.Cli/Projects/GuestAppHostProject.cs, src/Aspire.Cli/Projects/IAppHostServerProject.cs, src/Aspire.Cli/Projects/IGuestProcessLauncher.cs, src/Aspire.Cli/Telemetry/AgentTelemetryUploader.cs, src/Aspire.Cli/Utils/CliDownloader.cs, src/Aspire.Cli/Utils/EnvironmentChecker/DeprecatedWorkloadCheck.cs, src/Aspire.Cli/Utils/EnvironmentChecker/TypeScriptAppHostToolingCheck.cs, src/Aspire.Cli/Utils/ProcessCaptureRunner.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit adc80d1.

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.

Copilot review overview

🔵 Needs a closer look

Cross-platform process lifetime, console, cancellation, and handle semantics warrant final human validation despite the focused regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@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

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: adc80d10c199ed03f97f2b47887b446528c4dffd
  • Installed Version: 17.0.0-pr.17079.gadc80d10
  • Status: ✅ Verified

Changes Analyzed

Change Categories

  • CLI process execution changes
  • CLI process-related test changes
  • Hosting integration changes
  • Dashboard changes
  • Template source changes
  • Client/component changes
  • VS Code extension changes
  • CI infrastructure changes

Test Scenarios Executed

Scenario 1: CLI artifact and process-probe verification

Objective: Verify the dogfood artifact matches the PR head and process-based doctor probes complete successfully.
Coverage Type: Happy path
Status: ✅ Passed

Steps:

  1. Installed the PR CLI into an isolated temporary directory.
  2. Verified the installed version contains the PR head short SHA.
  3. Ran aspire doctor --self --format json.
  4. Ran aspire doctor --format json, including discovery and probing of two older Aspire installations.

Evidence:

  • artifact-version.txt
  • install.log
  • doctor.log

Observations:

  • Both doctor commands exited with code 0.
  • Installation discovery successfully probed the PR CLI and two older peer installations.
  • The normal doctor run reported seven passing checks and one expected version-channel warning.

Scenario 2: .NET AppHost detached lifecycle

Objective: Exercise project creation, detached AppHost launch, redirected process output, dashboard child execution, discovery, and graceful shutdown.
Coverage Type: Happy path and cleanup boundary
Status: ✅ Passed

Steps:

  1. Created a fresh C# aspire-empty project from the PR package hive.
  2. Started the generated apphost.cs with aspire start.
  3. Described hidden resources and verified the dashboard was running and healthy.
  4. Stopped the AppHost with aspire stop.
  5. Verified a subsequent describe reported that no AppHost was running.
  6. Verified the recorded AppHost and dashboard PIDs no longer existed.

Evidence:

  • dotnet-new.log
  • dotnet-lifecycle.log
  • dotnet-pid-check.log

Observations:

  • Start, describe, stop, and post-stop describe all exited with code 0.
  • The detached AppHost and dashboard processes terminated cleanly.

Scenario 3: TypeScript/npm AppHost detached lifecycle

Objective: Exercise TypeScript project creation, npm-backed child processes, detached AppHost launch, resource discovery, and process-tree cleanup.
Coverage Type: Happy path and cleanup boundary
Status: ✅ Passed

Steps:

  1. Created a fresh TypeScript starter project from the PR package hive.
  2. Started the generated apphost.mts with aspire start.
  3. Described hidden resources.
  4. Stopped the AppHost.
  5. Verified a subsequent describe reported that no AppHost was running.
  6. Verified the recorded AppHost and resource PIDs no longer existed.

Evidence:

  • typescript-new.log
  • typescript-lifecycle.log
  • typescript-summary.txt
  • typescript-pid-check.log

Observations:

  • Start, describe, stop, and post-stop describe all exited with code 0.
  • The AppHost and all recorded resource processes terminated cleanly.

Scenario 4: Nonexistent AppHost

Objective: Verify invalid AppHost input fails safely without launching a process.
Coverage Type: Unhappy path
Status: ✅ Passed

Steps:

  1. Ran aspire start --apphost <nonexistent-path> --non-interactive.

Evidence:

  • invalid-apphost.log

Expected Unhappy-Path Outcome: A clear validation error and non-zero exit code.

Observations:

  • The CLI reported that the specified project does not exist.
  • The command exited with code 7.

Supplemental Source Validation

The core ProcessExecution, detached execution, factory-environment, and invocation-options test group passed:

  • Total: 27
  • Succeeded: 17
  • Skipped: 10 platform-specific Windows cases
  • Failed: 0

CI already passed the broader PR test suite, so additional local source-test execution was not treated as a smoke-test gate.

Summary

Scenario Status Notes
Artifact identity and doctor probes ✅ Passed Artifact matched PR head; peer probing completed
.NET detached lifecycle ✅ Passed Healthy dashboard; all recorded PIDs exited
TypeScript/npm detached lifecycle ✅ Passed Start/stop succeeded; all recorded PIDs exited
Nonexistent AppHost ✅ Passed Clear error and exit code 7
Core process unit tests ✅ Passed 17 passed, 10 platform skips

Overall Result

✅ PR SMOKE TESTING VERIFIED

The dogfood artifact behaved correctly across .NET and TypeScript AppHosts on macOS. The process changes successfully handled detached launch, output/resource discovery, graceful shutdown, npm-backed workloads, peer-install probing, and invalid AppHost input without leaving recorded child processes behind.

@eerhardt
Eric Erhardt (eerhardt) merged commit 9122c27 into main Oct 1, 2026
372 of 376 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 1, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_optional → internal_refactor

Triggered signals (3): cli_command_file_changed, pr_body_has_cli_flag_mention, pr_body_has_deprecation_marker — all three are proven false positives with no actual user-facing change:

  1. cli_command_file_changed — fired on src/Aspire.Cli/Commands/AgentTelemetryCommand.cs and UpdateCommand.cs matching the generic Commands/*.cs path pattern. The actual diffs are purely internal: AgentTelemetryCommand removes a dead _services field and swaps AgentTelemetryUploader.EnsureRunningAsync(_services) for the new static AgentTelemetryUploader.EnsureRunning() (this command is explicitly marked as "an implementation detail of the agent hook scripts, not a user-facing" command). UpdateCommand's SetExecutablePermission/version-probe helper swaps manual Process.Start + StandardOutput.ReadToEndAsync for Process.RunAndCaptureTextAsync(...) — same captured output, same behavior, no new option or flag. cli_command_added (the signal that would catch an actual new command) is false.

  2. pr_body_has_cli_flag_mention — matched the substring --list-sdks in the PR body prose ("DotNetSdkInstaller streams dotnet --list-sdks"). This is the CLI's own internal invocation of the dotnet executable to enumerate installed SDKs during startup checks — not a new or changed Aspire CLI-facing flag.

  3. pr_body_has_deprecation_marker — matched the substring DeprecatedWorkloadCheck in the PR body prose (listing it among classes whose internal process-launch code was simplified). This is an existing internal check class name, not a new deprecation announcement; no [Obsolete] attribute was added and no CLI behavior was deprecated.

Allowlist justification: The PR's own checklist confirms "Did you add public API? No." No api/*.cs files changed. All 48 changed files are under src/Aspire.Cli/** and tests/Aspire.Cli.Tests/**, and every non-test change is a mechanical substi

(summary truncated)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants