feat(install): add Sentry error telemetry to install script#334
Conversation
Report install failures to the CLI's existing Sentry project via the envelope API. Uses the same public write-only DSN already baked into every CLI binary. Same opt-out: SENTRY_CLI_NO_TELEMETRY=1. - report_error(): builds a minimal Sentry envelope and fires a background curl (fire-and-forget, 2s timeout, never blocks) - die(): replaces all echo+exit patterns with error reporting - ERR trap: catches unexpected set -e / pipefail exits (e.g., gunzip) - Tags: os, arch, channel, step, install.version, bash version - UUID: /proc fallback -> uuidgen -> awk pseudo-UUID
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Trace
Other
Bug Fixes 🐛Api
Formatters
Setup
Other
Internal Changes 🔧Api
Other
🤖 This preview updates automatically when you update the PR. |
BugBot correctly identified that `wait` returns the exit status of the background curl. If curl fails (e.g., no network), wait returns non-zero under set -e, retriggering the ERR trap and causing infinite recursion. Adding `|| true` suppresses the exit status.
|
Fixed in c200a07 — added |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
BugBot flagged that requested_version (from --version user input) was interpolated into the JSON envelope without escaping. Apply the same sed-based escaping to step, channel, and version tags via a local _esc() helper.
|
Fixed in 9c36ef7 — extracted a |
Summary
Add fire-and-forget error reporting to the install script via Sentry's
envelope API. Uses the CLI's existing public write-only DSN — no new
secrets or projects needed. This would have caught the macOS digest
extraction bug (#331) automatically.
Changes
report_error()— builds a minimal Sentry envelope and sends it viabackground
curl(2s timeout, never blocks installation)die()— replaces all 11echo + exit 1patterns with errorreporting + exit
ERRtrap — catches unexpectedset -e/pipefailexits like thegunzip pipeline failure that triggered fix(install): fix nightly digest extraction on macOS #331
/proc→uuidgen→awkSENTRY_CLI_NO_TELEMETRY=1(same as the CLI binary)Each error event is tagged with
os,arch,channel,step,install.version, and bash version for quick triage.