Skip to content

fix(cli): Skip the first-install login in CI - #2925

Merged
BYK merged 1 commit into
mainfrom
fix/cli-setup-skip-login-in-ci
Dec 5, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/cli-setup-skip-login-in-ci

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

CI jobs often run in a PTY (Buildkite does), so the installer's -t 1 && -t 2 check and setup's isatty(0/1/2) check both pass there. On a fresh curl install with no credentials, sentry cli setup then starts an OAuth device login and waits about ten minutes for the code to expire. Reported in oven-sh/bun#50046 (oven-sh/bun#50046).

Before, in a CI job with a PTY, the install step prints a device code and hangs until it expires:

Installed sentry v4.x to ~/.local/bin/sentry
Open https://sentry.io/oauth/device/ and enter code ABCD-EFGH

After, the install step prints one line and the job continues:

Installed sentry v4.x to ~/.local/bin/sentry
Skipped login in CI. Set SENTRY_AUTH_TOKEN to authenticate.

The detection reuses the existing isCi() in src/lib/ci.ts, which telemetry and upload flags already use: any marker in CI_ENV_VARS set to something other than "", false, or 0. This adds CIRCLECI and BITBUCKET_BUILD_NUMBER to that list; both providers also set CI=true, so other callers see no real change.

  • sentry cli setup: in CI, skips the login and prints the hint, with or without a TTY. A stored login or SENTRY_AUTH_TOKEN still skips silently, as before. Local terminals still get the login.
  • install: no longer hands setup /dev/tty in CI, which keeps older pinned v4 versions from logging in there too. It keeps a bash copy of CI_ENV_VARS.

via @BYK.

--

View Session [Sentry]

CI jobs often run in a PTY, so the installer's and `sentry cli setup`'s
TTY checks passed there and setup started an OAuth device login that
waited ten minutes for its code to expire.

`sentry cli setup` now skips that login when isCi() matches and prints
a hint to set SENTRY_AUTH_TOKEN. The installer no longer hands setup the
controlling terminal in CI, which also covers older pinned versions.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from BYK December 5, 2026 02:39
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Dec 5, 2026 2:39am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Dec 5, 2026 2:39am UTC

Request Review

@BYK
BYK added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit 6e23549 Dec 5, 2026
38 checks passed
@BYK
BYK deleted the fix/cli-setup-skip-login-in-ci branch December 5, 2026 04:10
github-actions Bot pushed a commit to Fields-Education/sentry-mcp that referenced this pull request Dec 5, 2026
…ackages (getsentry#2926)

The installer now handles three kinds of host better:

- **glibc older than 2.28** (CentOS 7, Amazon Linux 2, Ubuntu 18.04).
The v4 binary can't run there. The installer now stops before any
download and points to the 3.8.2 pin. Node 20, which the npm fallback
needs, has the same glibc requirement, so the old npm hint didn't help
these hosts either.
- **musl.** The installer used to require `libstdc++`, `libgcc_s` and
`libatomic` before it downloaded anything. Builds from 4.1.0 no longer
link `libatomic`, and arm64 builds only need `libgcc_s`. Now the
installer asks `ldd` which libraries the downloaded binary is missing,
then prints the exact `apk add` line for them.
- **Piped to `sh`.** This used to fail with a syntax error. A POSIX
guard at the top now tells the user to pipe the installer to bash, or to
run `apk add bash` first.

Installer error reports now include the tags `registry.status`,
`registry.curl_exit` and `libc.version`. `check-installer-libc.sh` gains
an `old-glibc` case (CentOS 7 and Amazon Linux 2 images), and the Alpine
case now covers the `sh` guard and the printed `apk add` line.

Before and after, on CentOS 7:

```
before: Failed to fetch latest stable version from Sentry's release registry. Retry or install a specific version with --version <version>.
after:  Sentry CLI v4 needs glibc 2.28 or later, and this system has glibc 2.17. To install the last v3 release (sentry-cli) instead, run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.8.2 sh
```

This touches the same files as getsentry#2925, but the two merge
cleanly. The `run_setup` and TTY handoff lines are unchanged.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Acefa2ca64f280f1e22c4160633ae292c -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Acefa2ca64f280f1e22c4160633ae292c)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acefa2ca64f280f1e22c4160633ae292c/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <126780+BYK@users.noreply.github.com>

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — 9c399a24 Deployed Dec 5, 2026 by vercel[bot]
Preview – sentry-local — 9c399a24 Deployed Dec 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant