Skip to content

Feat/sentry export v2 - #40

Merged
dPeluChe merged 3 commits into
mainfrom
feat/sentry-export-v2
Jun 14, 2026
Merged

dPeluChe merged 3 commits into
mainfrom
feat/sentry-export-v2

Conversation

@dPeluChe

Copy link
Copy Markdown
Owner

Summary

Screenshots

Test plan

  • npm run build is green (0 errors, 0 warnings)
  • Touched UI was opened in the browser and the golden path still works
  • No new analytics, telemetry, third-party scripts, or backend dependencies
  • Native confirm() / alert() / prompt() not introduced (use <ConfirmDialog>)
  • GitHub-supplied HTML rendered through <SanitizedMarkdown> (DOMPurify)

Related

dPeluChe and others added 3 commits June 14, 2026 13:50
Acts on triage feedback about the Sentry "copy for agent" brief.

Export (buildSentryAgentText rewritten to the requested format):
- High-signal fields first: ISSUE (type: message), Culprit, Environment,
  Handled (no=unhandled crash), Level, Release, Events·Users, First/Last seen,
  URL, Client, then the Sentry issue link AND the event-specific link.
- Stacktrace in a code fence, crash-first, in-app frames marked "← in-app",
  consecutive duplicate frames collapsed (×N), tail truncated ("… +N frames").
- Breadcrumbs (last ~5) with timestamp + category + message (http crumbs render
  "POST /url → 500").
- Degrades gracefully before the latest event loads (env/handled show
  "unknown", no fence).

New extraction (api/sentry/events.ts):
- extractEventContext() distills environment / release / handled (mechanism
  first, then tag) / url / client (browser·os·device) / breadcrumbs / event id
  from the latest event. SentryExceptionValue gains `mechanism`.

UI:
- SentryIssueModal shows env / handled / release / client chips and passes the
  context to the copy builder.
- Issues scope orders repo groups by most-recent activity (was alphabetical);
  unmapped Sentry issues sink last.

Tests: events.test.ts (context/breadcrumbs/handled precedence) + rewritten
agentPrompt tests (format, in-app, dedup, truncation, graceful degrade) —
suite now 45 tests / 10 files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… raw JSON

Follow-up enrichment on the Sentry agent brief, all from data Sentry already
returns (no extra calls):

- Sentry processing errors (event.errors) → surfaced as a "⚠ frames may be
  minified — upload source maps" block + modal warning. This is the actionable
  half of the sourcemap pain: it names exactly what Sentry couldn't symbolicate.
- Trend from the issue event series (stats) → "N in 24h · M in 14d" (growing vs
  dead). Derived from the 14d series tail, no extra request.
- Issue-level isUnhandled now drives the Handled line (more reliable than the
  per-event mechanism), plus Sentry priority.
- platform / runtime (contexts.runtime) / affected user (id·email) / SDK /
  HTTP method folded into the URL line.
- Full raw event JSON appended last, collapsed (<details>) and capped at 8KB —
  readable summary on top, complete payload for the agent below.
- Demo Sentry issues gain isUnhandled + priority so the demo brief shows them.

Types: SentryIssue gains isUnhandled/priority/stats; SentryLatestEvent gains
platform/errors/contexts/user/sdk; SentryEventContext carries the distilled
fields. Tests extended — suite now 47 tests / 10 files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Suspect commits (silent until configured):
- fetchSentrySuspectCommits hits /issues/{id}/committers/ and returns [] on any
  error (the endpoint 404s until the Sentry-side GitHub integration + commit
  tracking is set up), so it stays invisible until enabled, then lights up
  automatically.
- The modal fetches it only when a real connector is configured (retry off);
  shows "Suspect commit: <sha> <msg> — @author PR #N" and the brief gains a
  "Suspect commits (Sentry blame)" section pointing the agent where to start.

Sentry token format validation:
- validateSentryTokenFormat() — inline hint under the Auth token field: must
  start with sntryu_ (User Auth Token; flags sntrys_ org tokens specifically)
  and be ~65–75 chars. Soft warning + aria-invalid, doesn't hard-block.

Tests: token format (prefix/length/empty/org-token), suspect-commit formatting
— suite now 52 tests / 11 files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
devcompass Ready Ready Preview, Comment Jun 14, 2026 8:49pm

@dPeluChe
dPeluChe merged commit af4543c into main Jun 14, 2026
3 checks passed
@dPeluChe
dPeluChe deleted the feat/sentry-export-v2 branch June 14, 2026 20:52

This branch was successfully deployed

1 active deployment
Preview — fc96510e Deployed Jun 14, 2026 by vercel[bot]
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