feat(init): add debug report prompt after wizard failures#553
Closed
betegon wants to merge 1 commit into
Closed
Conversation
After any error in `sentry init`, offer the user a way to send a reproduction bundle to the Sentry team. Three-option select: - No thanks (default) - Yes — project tar.gz + error/trace metadata as Sentry attachments - Yes — also include auth token and cli.db, so the team can reproduce Sentry API calls (org detection, project creation, etc.) with the user's exact setup The bundle includes: - tar.gz of the project dir (excluding node_modules/.git/dist/etc.) - debug-report.json with error, traceId, platform, CLI env - cli.db (the local SQLite config DB) when credentials are consented Skipped silently when --yes is passed, no TTY, or telemetry is off. Falls back to a JSON dir listing attachment on Windows where tar is unavailable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Internal Changes 🔧Coverage
Other
🤖 This preview updates automatically when you update the PR. |
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.
Summary
After any error in
sentry init, prompt the user to send a reproduction bundle to the Sentry team. This makes it possible to clone the user's exact environment and re-runsentry initto reproduce the failure.selectprompt after wizard errors (skipped with--yes, no TTY, or telemetry off)Option 1 — project files + error details:
project.tar.gz: full project dir minusnode_modules,.git,dist,.next, etc. (20MB cap)debug-report.json: error message, traceId (for server log correlation), platform, CLI version/OS/archOption 2 — also include auth token and config DB:
cli.db(the local SQLite config DB with auth token, user info, caches)~/.sentry/cli.db, extract the project, and runsentry initauthenticated as the user with their exact Sentry org/project setupFalls back to a JSON directory structure attachment on Windows where
taris unavailable.Test plan
sentry initin a dir with no recognizable framework → wizard fails → debug prompt appears after errorproject.tar.gzanddebug-report.jsonattachmentsdebug-report.jsonincludesauthToken,cli.dbattachment present--yesflag → no prompt shownSENTRY_CLI_NO_TELEMETRY=1→ no prompt shownMASTRA_API_URL=http://localhost:9999) → prompt appears after connection error🤖 Generated with Claude Code