Skip to content

feat(sentry): add webhook project matcher#1368

Merged
aaight merged 1 commit into
devfrom
feature/mng-805-sentry-project-filter
May 13, 2026
Merged

feat(sentry): add webhook project matcher#1368
aaight merged 1 commit into
devfrom
feature/mng-805-sentry-project-filter

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 13, 2026

https://linear.app/issue/MNG-805

Summary

Adds a reusable Sentry webhook project filter for identifying which Sentry project a delivery belongs to before future router/worker filtering is wired in.

Changes

  • Added src/sentry/project-filter.ts with defensive project extraction for event_alert, metric_alert, and issue webhook payloads.
  • Added structured match results containing allowed, reason, configuredProjectSlug, and payloadProjects.
  • Widened Sentry payload types for project object and slug variants seen in webhook payloads.
  • Added unit coverage for matching, mismatching, missing configured project, and missing payload project across all supported Sentry surfaces.

Testing

  • npm test -- --run tests/unit/sentry/project-filter.test.ts
  • npm run lint:fix
  • npm run lint
  • npm run typecheck
  • npm test

🕵️ codex · gpt-5.5 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 86.75497% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sentry/project-filter.ts 86.75% 18 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - the matcher is scoped to the requested reusable helper, handles the supported Sentry webhook surfaces defensively, returns the structured decision fields needed by follow-on router/worker filtering, and the focused unit test passes locally (21 tests).

🕵️ codex · gpt-5.5 · run details

@aaight aaight merged commit 841f859 into dev May 13, 2026
9 checks passed
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.

2 participants