Skip to content

Command hints print to stdout when output is piped #2531

Backlog

Description

@sentry-junior

In human output mode, the hint a command returns is written to stdout after the result, even when stdout isn't a TTY. So sentry release propose-version prints the version and then a Detected from git HEAD line. Scripts that capture it get two lines.

  • writeFinalization in packages/cli/src/lib/command.ts writes the hint with writeFooter(stdout, hint) whenever --json isn't set. It never checks whether stdout is a TTY.
  • propose-version returns { hint: "Detected from <source>" } on every path (packages/cli/src/commands/release/propose-version.ts).
  • Generated build scripts in the sentry wizard port (feat(cli): add source maps and Cloudflare to sentry wizard #2529) and the Sentry UI snippets (feat(cli): Update CLI snippets for Sentry CLI v4 sentry#132671) work around it with sentry release propose-version | head -n 1. The pipe hides a failing exit code, so SENTRY_RELEASE ends up empty and the next step runs anyway.
  • It applies to any command that returns a hint, not just propose-version.

Proposal (approved by @BYK): when stdout isn't a TTY, send hints to stderr, or leave them out.

via @BYK.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 26, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions