feat: support SENTRY_HOST as alias for SENTRY_URL#409
Conversation
Add getConfiguredSentryUrl() helper that checks SENTRY_HOST first, then SENTRY_URL. This gives users the expected env var name while maintaining backwards compatibility. Precedence: SENTRY_HOST > SENTRY_URL > default (https://sentry.io) applySentryUrlContext() now sets/deletes both env vars to prevent SENTRY_HOST from shadowing a newly-set SENTRY_URL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update configuration, self-hosted, and development docs to document SENTRY_HOST as the primary env var with SENTRY_URL as an alias. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Init
Issue List
Other
Bug Fixes 🐛Init
Other
Internal Changes 🔧Init
Other
Other
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 104 passed | Total: 104 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 698 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 96.64% 96.64% —%
==========================================
Files 159 159 —
Lines 20784 20791 +7
Branches 0 0 —
==========================================
+ Hits 20086 20093 +7
- Misses 698 698 —
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
BYK
left a comment
There was a problem hiding this comment.
Awesome, thanks! Just curious why are making the new var tsk precedence?
|
@BYK as |
|
Okay I'm just being pedantic but URL is the more accurate one 🤣 |
|
@BYK no lol, i agree with you. but mcp was there first 😆 |
Switch from ?? (nullish coalescing) to || (logical OR) in getConfiguredSentryUrl() so that empty strings like SENTRY_HOST="" fall through instead of propagating as valid values. This restores the pre-refactor behavior where "" was treated as falsy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Summary
Adds
SENTRY_HOSTas a supported env var for configuring the Sentry instance URL. It takes precedence overSENTRY_URLso both work, but users who expectSENTRY_HOST(common in other Sentry tooling) get the behavior they want out of the box.Precedence:
SENTRY_HOST>SENTRY_URL> default (https://sentry.io)Changes
A single
getConfiguredSentryUrl()helper inconstants.tsreplaces all 8process.env.SENTRY_URLreads across 6 source files.applySentryUrlContext()now sets/deletes both env vars soSENTRY_HOSTcan't shadow a freshly-setSENTRY_URL.Test plan
SENTRY_HOSTalone and precedence overSENTRY_URLin region, code-scanner, URL parser, and URL builder testsbun run typecheckandbun run lintclean🤖 Generated with Claude Code