Repository navigation
Show restore diagnostics when aspire update fails - #22355
Conversation
Capture restore stdout and stderr in the CLI log and display them on failure while preserving rollback and exit codes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22355Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22355" |
Tests selector2 / 101 PR test projects · 4 PR jobs, from 4 changed files. Selected PR test projects (2 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the restore-diagnostic improvements.
No open issues 🎉
What changed in this PR
Makes aspire update restore failures easier to diagnose, addressing #22352 without changing DLL-lock handling, rollback behavior, or exit code 13.
Changes:
- Captures restore stdout and stderr in the CLI log and displays them after the restore status finishes on failure; successful restores remain quiet.
- Adds regression coverage for project and file-based AppHosts, including logging, failure-only display, and rollback.
- Documents the behavior and updates test construction for the file-logging dependency.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs |
Supplies the file logger when constructing the updater. |
tests/Aspire.Cli.Tests/Projects/ProjectUpdaterTests.cs |
Updates existing updater construction sites. |
tests/Aspire.Cli.Tests/Projects/ProjectUpdaterNuGetConfigurationTests.cs |
Adds four restore-diagnostic regression cases. |
src/Aspire.Cli/README.md |
Documents restore diagnostic display and logging. |
src/Aspire.Cli/Projects/ProjectUpdater.cs |
Captures restore output and displays it on failure after status completion. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #2186
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2186 targeting Updated Note This draft PR needs human review before merging. |
Description
When the post-update package restore fails,
aspire updatecurrently reports only a generic failure. This hides actionable NuGet/MSBuild errors such as access denied to a locked task assembly.Capture restore stdout and stderr in the existing CLI file log and display the captured output after the restore status finishes when restore fails. Successful restores remain quiet, and update rollback and exit code 13 are unchanged. Reuse the existing
OutputCollectorand update the CLI documentation.This fixes restore diagnostics only; it does not change DLL locking or stop shared MSBuild servers. No new dependencies.
Fixes #22352
User-facing usage
The existing command requires no new options:
aspire update --channel stagingFailure output before and after
Example for the locked task-assembly failure reported in #22352 (project/log paths abbreviated; progress and status icons omitted):
Before
After
The underlying restore stdout and stderr are now also captured in the CLI log. The generic failure summary, rollback, and exit code 13 are unchanged.
Command help is unchanged; verified from the locally built CLI:
Validation
Windows, .NET SDK 11.0.100. Revalidated on this branch based directly on current
main.Passed: 401 succeeded, 2 platform-specific skips, 0 failures. The four new regression cases cover project and file-based AppHosts, stdout/stderr logging, failure-only display, and rollback. All four failed before the fix because the output was missing.
Passed: command help rendered successfully.
git diff --checkPassed before committing.
The investigation also reproduced task DLL retention using a disposable copy and an isolated MSBuild server. Deletion failed after the build completed, succeeded after stopping only that test server, and succeeded immediately in a server-disabled control. The original worker's caller remains unproven; no shared build servers were stopped.
Checklist
<remarks />and<code />elements on your triple slash comments?