Skip to content

feat(cli): Authenticate headless installs with setup codes - #1873

Merged
evanpurkhiser merged 1 commit into
git/feat-cli-add-headless-authentication-bootstrap-commandfrom
git/feat-cli-authenticate-headless-installs-with-setup-codes
Nov 4, 2026
Merged

evanpurkhiser merged 1 commit into
git/feat-cli-add-headless-authentication-bootstrap-commandfrom
git/feat-cli-authenticate-headless-installs-with-setup-codes

Conversation

@evanpurkhiser

@evanpurkhiser evanpurkhiser commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Depends on #1872. Let headless installs authenticate immediately when SENTRY_SETUP_CODE is supplied. The installer hands authentication to the same bootstrap implementation used by an existing CLI and propagates failures.

https://linear.app/getsentry/issue/VDY-338

Validation on the complete stack: typing, lint, and focused authentication/setup tests pass. The full test run has 21 unrelated failures reproduced on unchanged upstream main in the installer musl-detection, time-range, and zip-writer suites.

Native GitHub Stack: #1874, ordered #1870 → #1871 → #1872 → #1873.

Native bootstrap and shell installation passed against local OAuth redemption using internally generated codes. The shell test used a local artifact mirror for the unreleased binary.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 4, 2026 8:54pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

VDY-338

@evanpurkhiser
evanpurkhiser changed the base branch from main to git/feat-cli-bootstrap-account-credentials-from-setup-codes November 3, 2026 18:44
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from 077228e to fa0808c Compare November 3, 2026 18:53
@evanpurkhiser
evanpurkhiser changed the base branch from git/feat-cli-bootstrap-account-credentials-from-setup-codes to git/feat-cli-add-headless-authentication-bootstrap-command November 3, 2026 18:53
@evanpurkhiser
evanpurkhiser added this pull request to stack #1874 November 3, 2026 18:53
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from fa0808c to 99eafe3 Compare November 3, 2026 19:10
Comment thread packages/cli/src/commands/cli/setup.ts Resolved
Comment thread packages/cli/src/commands/cli/setup.ts Resolved
@evanpurkhiser
evanpurkhiser requested a review from BYK November 4, 2026 18:38
@evanpurkhiser
evanpurkhiser marked this pull request as ready for review November 4, 2026 18:38
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 4, 2026
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from 99eafe3 to ae8723f Compare November 4, 2026 18:42
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from ae8723f to a66913c Compare November 4, 2026 19:08

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/commands/cli/setup.ts Resolved
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from a66913c to 93ce7d3 Compare November 4, 2026 19:29

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 93ce7d3. Configure here.

Comment thread packages/cli/src/commands/cli/setup.ts Resolved
evanpurkhiser added a commit that referenced this pull request Nov 4, 2026
The CLI needs to redeem Sentry's short-lived setup codes without opening
a browser. Add the setup-code OAuth exchange, validate the issuing
instance, and redact setup codes from diagnostics. Redemption sends the
code once and refuses redirects.

Backend dependency: getsentry/sentry#129325.
Codes are generated internally by Sentry for specific clients; the
generated onboarding instructions flow follows separately.

https://linear.app/getsentry/issue/VDY-337

Validation on the complete stack: typing, lint, and focused
authentication/setup tests pass. The full test run has 21 unrelated
failures reproduced on unchanged upstream main in the installer
musl-detection, time-range, and zip-writer suites.

Native GitHub Stack:
[#1874](https://github.com/getsentry/toolkit/stack/1874), ordered #1870
→ #1871 → #1872 → #1873.

Native bootstrap and shell installation passed against local OAuth
redemption using internally generated codes. The shell test used a local
artifact mirror for the unreleased binary.
evanpurkhiser added a commit that referenced this pull request Nov 4, 2026
Setup codes need to authenticate the CLI without disturbing other stored
accounts. Add bootstrap credential handling using the existing
host-scoped account storage, validate responses before replacing a
login, and preserve credentials when redemption fails.

Depends on #1870. Command and installer entry points follow separately.

https://linear.app/getsentry/issue/VDY-337

Validation on the complete stack: typing, lint, and focused
authentication/setup tests pass. The full test run has 21 unrelated
failures reproduced on unchanged upstream main in the installer
musl-detection, time-range, and zip-writer suites.

Native GitHub Stack:
[#1874](https://github.com/getsentry/toolkit/stack/1874), ordered #1870
→ #1871 → #1872 → #1873.

Native bootstrap and shell installation passed against local OAuth
redemption using internally generated codes. The shell test used a local
artifact mirror for the unreleased binary.
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from 93ce7d3 to 86e0951 Compare November 4, 2026 20:42
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-authenticate-headless-installs-with-setup-codes branch from 86e0951 to 1f7620e Compare November 4, 2026 20:54
@evanpurkhiser
evanpurkhiser enabled stacked auto-merge (squash) November 4, 2026 20:55
@evanpurkhiser
evanpurkhiser merged commit 9b9248c into main Nov 4, 2026
32 checks passed
@evanpurkhiser
evanpurkhiser deleted the git/feat-cli-authenticate-headless-installs-with-setup-codes branch November 4, 2026 21:07
evanpurkhiser added a commit that referenced this pull request Nov 4, 2026
Allow an installed CLI to authenticate non-interactively with
`SENTRY_SETUP_CODE=... sentry auth bootstrap`. Depends on #1871. Expose
the bootstrap helper through the existing authentication command group
with JSON output, instance selection, and explicit replacement consent.

https://linear.app/getsentry/issue/VDY-337

Validation on the complete stack: typing, lint, and focused
authentication/setup tests pass. The full test run has 21 unrelated
failures reproduced on unchanged upstream main in the installer
musl-detection, time-range, and zip-writer suites.

Native GitHub Stack:
[#1874](https://github.com/getsentry/toolkit/stack/1874), ordered #1870
→ #1871 → #1872 → #1873.

Native bootstrap and shell installation passed against local OAuth
redemption using internally generated codes. The shell test used a local
artifact mirror for the unreleased binary.

This branch was previously deployed

1 inactive deployment
Preview — 1f7620ea Deployed Nov 4, 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