Skip to content

feat(init): add debug report prompt after wizard failures#553

Closed
betegon wants to merge 1 commit into
mainfrom
feat/init-debug-report
Closed

feat(init): add debug report prompt after wizard failures#553
betegon wants to merge 1 commit into
mainfrom
feat/init-debug-report

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented Mar 24, 2026

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-run sentry init to reproduce the failure.

  • Adds a 3-option select prompt after wizard errors (skipped with --yes, no TTY, or telemetry off)
  • Sends a Sentry event with structured metadata + attachments via the existing telemetry DSN

Option 1 — project files + error details:

  • project.tar.gz: full project dir minus node_modules, .git, dist, .next, etc. (20MB cap)
  • debug-report.json: error message, traceId (for server log correlation), platform, CLI version/OS/arch

Option 2 — also include auth token and config DB:

  • Everything above, plus cli.db (the local SQLite config DB with auth token, user info, caches)
  • With this, the team can copy the DB to ~/.sentry/cli.db, extract the project, and run sentry init authenticated as the user with their exact Sentry org/project setup

Falls back to a JSON directory structure attachment on Windows where tar is unavailable.

Test plan

  • Run sentry init in a dir with no recognizable framework → wizard fails → debug prompt appears after error
  • Select "Yes — project files and error details" → Sentry event received with project.tar.gz and debug-report.json attachments
  • Select "Yes — also include my auth token and config DB" → debug-report.json includes authToken, cli.db attachment present
  • Run with --yes flag → no prompt shown
  • Run with SENTRY_CLI_NO_TELEMETRY=1 → no prompt shown
  • Press Ctrl+C at the prompt → graceful skip, process exits cleanly
  • Simulate connection failure (MASTRA_API_URL=http://localhost:9999) → prompt appears after connection error

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (formatters) Colorize SQL in DB span descriptions by BYK in #546
  • (init) Add debug report prompt after wizard failures by betegon in #553
  • Add sentry sourcemap inject and sentry sourcemap upload commands by BYK in #547
  • Native debug ID injection and sourcemap upload by BYK in #543

Internal Changes 🔧

Coverage

  • Use informational-patch input instead of sed hack by BYK in #544
  • Make checks informational on release branches by BYK in #541

Other

  • (ci) Upgrade GitHub Actions to Node 24 runtime by BYK in #542
  • (db) DRY up database layer with shared helpers and lint enforcement by BYK in #550
  • (issue-list) Use collapse parameter to skip unused Snuba queries by BYK in #545
  • Regenerate skill files by github-actions[bot] in ec1ffe28

🤖 This preview updates automatically when you update the PR.

@betegon betegon closed this Mar 25, 2026
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