fix(sentry): filter webhooks by project before dispatch#1370
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
May 13, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - the router now returns a structured sentry-project-filter skip before PM credential scope/dispatch on missing or mismatched project data, and the worker repeats the same matcher before trigger resolution/materialization so queued jobs cannot bypass it. Verified the focused Sentry router, worker, and project-filter unit tests locally.
🕵️ codex · gpt-5.5 · run details
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes https://linear.app/issue/MNG-806
Adds Sentry project filtering to both webhook execution paths so a payload routed through
/sentry/webhook/:projectIdmust still match that project's configured SentryprojectSlugbefore any alerting dispatch continues.Changes
SentryRouterAdapter.dispatchWithCredentials()now loads Sentry alerting config, runs the shared Sentry project matcher, and returns a structuredsentry-project-filterskip before PM credential scope ortriggerRegistry.dispatch()on missing config, missing payload project, or mismatch.processSentryWebhook()now runs the same matcher beforeresolveTriggerResult(), PM materialization, concurrency, or agent execution so queued or precomputed jobs cannot bypass the filter.Verification
npx vitest run --project unit-api tests/unit/router/adapters/sentry.test.tsnpx vitest run --project unit-triggers tests/unit/triggers/sentry-webhook-handler.test.tsnpx vitest run --project unit-core tests/unit/sentry/project-filter.test.tsnpx biome check src/router/adapters/sentry.ts src/triggers/sentry/webhook-handler.ts src/sentry/project-filter.ts tests/unit/router/adapters/sentry.test.ts tests/unit/triggers/sentry-webhook-handler.test.tsnpm run lint:fixnpm run lint(passes with existing warning-level complexity/non-null findings outside this change)npm run typechecknpm test🕵️ codex · gpt-5.5 · run details