Repository navigation
Commit c133708
authored
This PR addresses issue CLI-1WP, where `SeerError: Seer is not enabled
for this organization.` was being reported to Sentry for self-hosted
instances.
**Problem:**
When `sentry issue explain` or `sentry issue plan` is run against a
self-hosted Sentry instance where Seer is disabled, the CLI receives a
403 HTTP response. This is converted into a `SeerError('not_enabled')`.
Because `SeerError` extends `CliError` (not `ApiError`), and
`classifySilenced()` had no specific handling for `SeerError`, these
expected feature-gate conditions were being captured as Sentry issues,
polluting the issue tracker. For self-hosted users, Seer cannot be
enabled or trialed, making these reports unactionable noise.
**Solution:**
1. Added `"seer_unavailable_self_hosted"` to the `SilenceReason` union
type in `packages/cli/src/lib/error-reporting.ts`.
2. Modified `classifySilenced()` to return this new reason when a
`SeerError` occurs and the CLI is *not* pointed at a SaaS (sentry.io)
instance. This ensures that the error is silenced only for self-hosted
environments.
3. Added a `seer_reason` attribute to the `cli.error.silenced` metric
when a `SeerError` is silenced. This allows tracking the volume of these
events without creating Sentry issues.
4. Ensured that `SeerError`s on SaaS instances continue to be captured,
as this is an intentional signal for marketing dashboards.
5. Added unit tests to verify that `SeerError`s are silenced on
self-hosted configurations and captured on SaaS, and that the correct
metric attributes are emitted.
This change prevents expected feature-gate conditions on self-hosted
Sentry from being reported as CLI errors, while preserving the intended
capture behavior for SaaS environments.
<!-- SEER_FIXES_SENTRY_ISSUE -->
Fixes
[CLI-1WP](https://sentry.sentry.io/issues/7513541924/?seerDrawer=true)
<!-- /SEER_FIXES_SENTRY_ISSUE -->
<sub>`@sentry <feedback>`: Autofix iterates on these changes</sub>
<sub>`@sentry stop iterating`: Autofix stops iterating on this run</sub>
<sub>This PR was automatically generated by Sentry. You can [adjust this
setting](https://sentry.sentry.io/settings/projects/cli/seer/) at any
time.</sub>
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
1 parent 6f9d323 commit c133708
2 files changed
Lines changed: 71 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
153 | 161 | | |
154 | 162 | | |
155 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
156 | 167 | | |
157 | 168 | | |
158 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
348 | 366 | | |
349 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
350 | 391 | | |
351 | 392 | | |
352 | 393 | | |
| |||
571 | 612 | | |
572 | 613 | | |
573 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
574 | 633 | | |
575 | 634 | | |
576 | 635 | | |
| |||
0 commit comments