feat(webhooks): show Sentry project pairing#1371
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
Requesting changes because the new Sentry guidance overstates runtime filtering: Cascade requires and displays the organization slug, but the dispatch filter only compares the configured Sentry project slug.
Code Issues
Should Fix
- src/api/routers/webhooks.ts:111 — The API note says Cascade dispatches only payloads for
organizationSlug/projectSlug, butSentryRouterAdapterandprocessSentryWebhookboth callmatchSentryPayloadProject(..., sentryConfig?.projectSlug), and that matcher only compares payload project identifiers against the configured project slug. The organization slug is displayed and required in config, but it is not part of the payload filter. For an operator-facing guidance PR, this should be reworded to say payloads must match the configuredprojectSlugwhile showing the paired org/project separately.
Verification
npx vitest run --project unit-api tests/unit/api/routers/webhooks.test.tsnpx vitest run --project unit-core tests/unit/cli/dashboard/webhooks/webhooks.test.ts
🕵️ codex · gpt-5.5 · run details
| note: 'Configure this URL manually in your Sentry Internal Integration webhook settings.', | ||
| organizationSlug: pctx.sentryOrganizationSlug, | ||
| projectSlug: pctx.sentryProjectSlug, | ||
| note: `Configure this URL manually in your Sentry Internal Integration webhook settings. Cascade dispatches only payloads for ${pctx.sentryOrganizationSlug}/${pctx.sentryProjectSlug}; mismatched Sentry projects are filtered.`, |
There was a problem hiding this comment.
This says Cascade dispatches only payloads for organizationSlug/projectSlug, but the runtime filter only receives sentryConfig?.projectSlug in both SentryRouterAdapter and processSentryWebhook; matchSentryPayloadProject never checks organization. Please reword this so it displays the paired org/project without implying organization-level filtering, and state that the payload project must match the configured project slug.
There was a problem hiding this comment.
Fixed in 92a36c2. The API note now shows the paired Sentry org/project for setup context, but says dispatch filtering is based on the payload project matching the configured project slug.
| | `LinearRouterAdapter` | `src/router/adapters/linear.ts` | Linear team ID | | ||
| | `SentryRouterAdapter` | `src/router/adapters/sentry.ts` | CASCADE `projectId` (from URL) | | ||
|
|
||
| Sentry keeps the route shape `/sentry/webhook/:projectId`. The project ID selects the Cascade project, then the adapter filters the payload against the configured Sentry `organizationSlug` and `projectSlug`; organization-level Sentry deliveries for other projects are acknowledged but do not dispatch agents. |
There was a problem hiding this comment.
The adapter does not filter against organizationSlug; it only matches payload project identifiers against the configured projectSlug. This doc should avoid saying the org slug participates in filtering unless the runtime filter is changed to enforce it.
There was a problem hiding this comment.
Fixed in 92a36c2. The architecture doc now says the adapter filters by Sentry project identifiers matching configured projectSlug, while organizationSlug is part of the paired config/setup context.
|
@aaight address code review concerns |
|
Addressed the review concerns in 92a36c2. The Sentry guidance now displays the paired org/project for setup context, but describes runtime filtering accurately as matching the payload project against the configured project slug. 🕵️ codex · gpt-5.5 · run details |
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - verified the Sentry webhook info now comes from the central Sentry config parser, requires the API token plus non-empty organization/project slugs before display, and the API/CLI/docs now describe project-slug filtering accurately. Targeted unit tests passed locally and CI is green.
🕵️ codex · gpt-5.5 · run details
Summary
Fixes https://linear.app/issue/MNG-808
Adds Sentry project pairing to webhook guidance so operators can see exactly which Sentry organization/project is paired with a Cascade project.
Changes
SENTRY_API_TOKENexists.organizationSlugandprojectSlugin Sentry webhook API responses for dashboard/CLI consumers.cascade dashboard webhooks createandcascade dashboard webhooks listoutput with the paired Sentry project and project-filtering guidance./sentry/webhook/:projectIdremains the URL model and Sentry payloads must match the configuredprojectSlug.event_alert,metric_alert, andissuelifecycle.Verification
npx vitest run --project unit-api tests/unit/api/routers/webhooks.test.tsnpx vitest run --project unit-core tests/unit/cli/dashboard/webhooks/webhooks.test.tsnpm run lint:fixnpm run lint(passes; reports existing warnings outside this change)npm run typechecknpm test🕵️ codex · gpt-5.5 · run details