Surface run:command stderr and fail fast on command errors#286
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix command error reporting in tutorial runner
Surface Jun 3, 2026
run:command stderr and fail fast on command errors
Contributor
|
@copilot No files have been changed |
Contributor
Author
Addressed in commit |
kategengler
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run:commandmade command failures hard to diagnose because onlystdoutwas surfaced;stderrwas effectively lost in rendered output. This change ensures command errors are visible and immediately halt tutorial execution.Error visibility
stderralongsidestdouton successful command execution.captureOutputis enabled.Fail-fast behavior
execfailure, emit any availableerror.stdout/error.stderr.Operational impact
Original prompt
Create a pull request in
ember-learn/super-rentals-tutorialfor the already-implemented branchcopilot/fix-run-command-error-reporting.Context:
run:commandand ensure the tutorial stops immediately if a command errors.copilot/fix-run-command-error-reporting.Implemented change:
src/lib/plugins/run-code-blocks/directives/command.tsrun:commandnow captures and emitsstderrin addition tostdoutstdout/stderrand rethrows the error so execution halts immediatelyCommit to include:
8eb214042ffb21f62f26b27016be1b90a95b7ecdPlease open a PR from
copilot/fix-run-command-error-reportingintomainwith a concise title and description summarizing:ember newsetup problemThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: This job failed because
ember new super-rentals --lang en --strict --pnpmdid not succeed. But there is no error output and the tutorial continues. What is swallowing the error and how can we fix it?Assistant: The error is not being swallowed by
ember new. It’s being hidden by the tutorial runner’srun:commanddirective, which only captures stdout and drops stderr. The actual failure happens later, when a patch step assumessuper-rentals/index.htmlexists, but the generated app no longer has that file. So the job appears to “continue” pastember new, then fails ongit apply.Two fixes are needed:
run:commandby capturing and printingstderrfrom failed commands.index.html, because the app now appears to usedist/code/super-rentals/index.htmlno longer exists at that location afterember new --strict --pnpm. The failing patch is targetingsuper-rentals/index.html, which does not exist in the generated app.Here’s the evidence:
Error: Command failed: git applyerror: dist/code/super-rentals/index.html: No such file or directoryember newcompleted far enough for the tutorial to move on, but the nextrun:file:patchstep failed. The failing workflow job is from.github/workflows/build.yml, run26864808120, job79327181365.ember new super-rentals --lang en --strict --pnpmblock, there is a hidden patch step againstcwd=super-rentals filename=index.html, so the runner tries to apply a patch todist/code/super-rentals/index.html. That file path is now wrong.git apply, and if the file is missing it throws immediately.await exec(cmd, { cwd })and destructures only{ stdout }, so on failure it does not appendstderrinto the rendered tutorial output; it just throws. That is why users don’t see the actual command error in the tutorial output.Relevant code: