fix: stream custom build/publish command output and surface real failures#118
Open
theoephraim wants to merge 1 commit into
Open
fix: stream custom build/publish command output and surface real failures#118theoephraim wants to merge 1 commit into
theoephraim wants to merge 1 commit into
Conversation
|
The changes in this PR will be included in the next version bump.
|
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.


Problem
During a release,
@varlock/bumpyran user-definedbuildCommand/publishCommandthroughrunAsync, which buffered all child output (nothing reached CI logs live) and, on failure, threw an error containing onlystderr— discardingstdout. When a custom publish likevsce publishwrote its real error (an expired marketplaceVSCE_PAT) to stdout and exited non-zero, the actual cause was invisible — CI showed only a genericCommand failedwrapper plus bun's exit notice.This degraded every non-npm / custom publish path (vsce, ovsx, anything bespoke), making failures un-debuggable. npm publishing has its own path and was unaffected.
Fix
runStreaming(cmd, opts)inshell.ts— runs viaspawn(shell: true), tees child stdout/stderr to the parent process live so output appears in CI as it happens, while also capturing both streams. On non-zero exit it rejects withCommand failed (exit code N): <cmd>plus the captured output.buildCommand/publishCommandin the publish pipeline now userunStreaming. Internal git/npm/pack helpers (which parse captured stdout) stay on the capturing runners, includingcheckPublished.runAsync/runArgsAsyncnow includestdout(not juststderr) in their thrown errors.Tests
New
test/utils/shell.test.tsasserts a command writing its error to stdout then exiting non-zero surfaces that text in the rejected error (forrunStreaming,runAsync, andrunArgsAsync), plus stderr and exit-code coverage.bun run test→ 303 pass, 0 failtsc --noEmit,oxlint,oxfmt --checkall cleanAcceptance criteria
publishCommandsurfaces the child's actual stdout and stderrbuildCommand/publishCommandoutput streams live, not just on failureIncident reference
https://github.com/dmno-dev/varlock/actions/runs/27600876636/job/81602352962