Skip to content

fix(npm): Show publish stderr at info level - #877

Merged
BYK merged 1 commit into
masterfrom
fix/npm-publish-stderr
Sep 21, 2026
Merged

BYK merged 1 commit into
masterfrom
fix/npm-publish-stderr

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

npm sends publish notices and warnings to stderr. Craft currently logs that stream only at Trace, so normal Info-level publish runs hide those diagnostics even when npm exits successfully.

  • Add an opt-in showStderr option to spawnProcess, matching the existing showStdout behavior.
  • Enable it for the npm target's token and OIDC publish paths (including the existing Yarn fallback).
  • Keep other subprocesses trace-only by default. Do not change stdout return values, exit-code handling, auth, or publish commands.
  • Extend the subprocess tests for default logging, visible stderr on success/failure, and the npm target tests for both auth paths.

This exposes future publish output. It cannot recover stderr from earlier runs and does not retry or verify a registry publish. The publishing image must pick up this change after merge/release before it affects runs.

Validation

  • Frozen pnpm install, 54 focused tests, typecheck, formatting, and diff checks pass.
  • Lint passes with seven existing warnings outside these files.
  • Local build and CLI version smoke test pass. The first pnpm build exited 0 but its optional Sentry upload reported HTTP 413; rebuilding with env -u SENTRY_AUTH_TOKEN pnpm build succeeded without the upload.
  • env -u SENTRY_AUTH_TOKEN pnpm test exits 1: 1,200 passed, three failed, one skipped. The three prepare-dry-run.e2e.test.ts failures report Git author was not set to the Junior identity because the fixtures set Test User. Two also encounter GitHub's unresolved test-owner/test-repo fixture. A snapshot becomes obsolete because the failing test never reaches its assertion. No runtime identity guards or fixture behavior were changed.

via David Cramer.

--

View Junior Session [Sentry]

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer marked this pull request as ready for review September 21, 2026 17:38
@BYK
BYK merged commit 05953a0 into master Sep 21, 2026
22 checks passed
@BYK
BYK deleted the fix/npm-publish-stderr branch September 21, 2026 17:40

This branch was successfully deployed

1 active deployment
false — 2b6455e8 Deployed Sep 21, 2026 by sentry-junior[bot] via Build #2930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant