Skip to content

fix: filter Sentry noise from tests and user cancellations#169

Merged
rhuanbarreto merged 1 commit intomainfrom
fix/sentry-noise-filtering
Mar 24, 2026
Merged

fix: filter Sentry noise from tests and user cancellations#169
rhuanbarreto merged 1 commit intomainfrom
fix/sentry-noise-filtering

Conversation

@rhuanbarreto
Copy link
Copy Markdown
Contributor

Summary

  • Disable Sentry in tests — Added enabled: Bun.env.NODE_ENV !== "test" to Sentry.init() so test-invoked captureException() calls never reach production Sentry (fixes CLI-1, 195 noise events)
  • Filter ExitPromptError — Added beforeSend filter that drops Inquirer Ctrl+C cancellations before they reach Sentry (fixes CLI-2)
  • Graceful SIGINT exitmain().catch() now detects ExitPromptError and exits with code 130 (POSIX SIGINT convention) instead of logging an error and exiting with code 2
  • ADR & rule updates — ARCH-002 now includes exit code 130, ARCH-005 documents Sentry test isolation, exit-code-convention rule updated

Test plan

  • bun run validate passes (599 tests, 22/22 ADR checks, build compiles)
  • Verify no new Sentry events appear from test runs in CI
  • Verify Ctrl+C during archgate init exits silently (code 130, no Sentry event)

- Disable Sentry in test environments (enabled: NODE_ENV !== "test")
  to prevent test exceptions from polluting production error tracking
- Add beforeSend filter to drop ExitPromptError events (Ctrl+C)
- Handle ExitPromptError gracefully in CLI catch block with exit 130
- Update ARCH-002 to include exit code 130 (SIGINT convention)
- Update ARCH-005 with Don't for Sentry in tests
- Update exit-code-convention rule to allow code 130

Fixes CLI-1, Fixes CLI-2
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: f0f9f83
Status: ✅  Deploy successful!
Preview URL: https://04ade83d.archgate-cli.pages.dev
Branch Preview URL: https://fix-sentry-noise-filtering.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit 2c988b6 into main Mar 24, 2026
8 checks passed
@rhuanbarreto rhuanbarreto deleted the fix/sentry-noise-filtering branch March 24, 2026 13:11
@github-actions github-actions bot mentioned this pull request Mar 24, 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