Surface dotnet new post-action output under --verbose for new command - #755
Surface dotnet new post-action output under --verbose for new command#755Zach Teutsch (zateutsch) wants to merge 4 commits into
Conversation
The final scaffold step of 'winapp new' runs dotnet new, whose post-creation actions (restore, package add, etc.) were buffered behind a spinner and only dumped after completion, making post-action failures hard to diagnose. Under --verbose, stream the scaffold's dotnet output live so those post actions are visible as they run. Output is still captured so a non-zero exit surfaces a concise failure detail. Adds optional line callbacks to the injection-safe ArgumentList RunDotnetCommandAsync overload. Fixes #753 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5fc9fa39-42fe-4531-9fa3-037d80c1f5c9
Build Metrics ReportBinary Sizes
Test Results✅ 4579 passed, 5 skipped out of 4584 tests in 575.3s (+3 tests, -38.5s vs. baseline) Test Coverage✅ 89.2% line coverage, 82.4% branch coverage · ✅ +0.1% vs. baseline CLI Startup Time51ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 755Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 755Run Updated 2026-08-14 21:20:34 UTC · commit |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5fc9fa39-42fe-4531-9fa3-037d80c1f5c9
There was a problem hiding this comment.
Pull request overview
Streams dotnet new post-action diagnostics during verbose scaffolding while preserving buffered failure details.
Changes:
- Adds live stdout/stderr callbacks to buffered dotnet execution.
- Uses callbacks for verbose
winapp newscaffolding. - Adds tests, fake-service support, and troubleshooting guidance.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
IDotNetService.cs |
Defines optional line callbacks. |
DotNetService.cs |
Captures and forwards process output. |
NewCommand.cs |
Streams verbose scaffold diagnostics. |
NewCommandHandlerTests.cs |
Tests verbose output and failure details. |
FakeDotNetService.cs |
Replays buffered output through callbacks. |
SKILL.md |
Documents verbose troubleshooting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
FakeDotNetService replays lines synchronously after the run completes, so it cannot catch a regression where the real OutputDataReceived/ErrorDataReceived callbacks stop firing live or stderr stops being forwarded. Add a DotNetService process test whose child emits stdout and stderr, then blocks on stdin, verifying both callbacks fire while the run task is still pending and the same text remains in the returned buffers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5fc9fa39-42fe-4531-9fa3-037d80c1f5c9
Summary
Surfaces
dotnet newpost-creation action output (restore, package add, etc.) under--verbosefor thewinapp newcommand. Previously this output was buffered silently behind a spinner and only dumped after the command finished, which madedotnet newfailures during scaffolding hard to diagnose.Fixes #753.
Problem
The final scaffold step of
winapp newrunsdotnet new, whose post-creation actions (NuGet restore,package add, etc.) can fail. That output was captured behind a Spectre spinner and surfaced only after completion, so a user hitting a restore failure had no live insight into whatdotnetwas actually doing.Change
--verbose(Debug log level), the scaffold step now streamsdotnet new's stdout/stderr live vialogger.LogDebug, plus logs the invokeddotnetargs and the exit code.onOutputLine/onErrorLinecallbacks to the injection-safeArgumentListoverload ofRunDotnetCommandAsync(and threaded them throughRunDotnetProcessAsync). Output is still captured to buffers, so the failure-detail message (stderr??stdout) is preserved.Why this approach
The scaffold needs both (a) the injection-safe
ArgumentListform (args include a user-derived project name / output path) and (b) captured stdout/stderr for the failure detail. The existingRunDotnetStreamingAsynctakes a rawstring(not injection-safe) and returns no buffers, so adding tee-style callbacks to the bufferedArgumentListpath was the smallest correct reuse.Testing
dotnet buildclean (0 warnings / 0 errors).WinApp.Cli.Tests— 60/60NewCommandHandlerTestspass, including 2 new tests:Handler_Verbose_StreamsScaffoldPostActionOutput— verifies post-creation output streams live under--verbose.Handler_ScaffoldFails_SurfacesPostActionErrorDetail— verifies the underlying dotnet error detail is surfaced on failure.Docs
plugins/winapp/skills/winapp-setup/SKILL.mdwith a--verbosediagnose example and a troubleshooting row.docs/cli-schema.json, npm forwarding, andversion.jsonare intentionally untouched.Notes
--verbose+--jsonremains a rejected conflict, so streamed Debug lines never pollute JSON output.dotnet newargs continue to useProcessStartInfo.ArgumentList; streamed lines are passed as a structured{Output}logging argument (no format-string/injection risk).