feat(alerting): add Sentry integration configuration to dashboard#1038
feat(alerting): add Sentry integration configuration to dashboard#1038
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.
LGTM — Clean, well-structured addition that follows established codebase patterns consistently.
The verifySentry backend mutation mirrors the existing verifyGithubToken/verifyTrello/verifyJira pattern (protectedProcedure + wrapIntegrationCall + input validation). The Zod enum expansion across upsert/updateTriggers/delete is correct and minimal. The frontend AlertingTab follows the same conventions as SCMTab (mutation/query patterns, ProjectSecretField usage, query invalidation). Sentry credential roles and the 'alerting' category were already pre-registered in integrationRoles.ts, so no migration or schema changes are needed. Test coverage is thorough across all new code paths. All CI checks pass.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
projects.integrationstRPC endpoints to accept'alerting'as a valid category (previously only'pm'and'scm')verifySentrymutation tointegrationsDiscoveryrouter that validates an API token + org slug against the Sentry APIAlertingTabcomponent with organization slug field, credential fields (SENTRY_API_TOKEN,SENTRY_WEBHOOK_SECRET), inline verification, copyable webhook URL, save and delete integrationCard: https://trello.com/c/69c29137d68698a9e8549cbb
Changes
Backend (
src/api/routers/projects.ts)integrations.upsert,integrations.updateTriggers, andintegrations.deleteto acceptz.enum(['pm', 'scm', 'alerting'])instead ofz.enum(['pm', 'scm'])Backend (
src/api/routers/integrationsDiscovery.ts)verifySentrymutation: accepts{ apiToken, organizationSlug }, raw-fetcheshttps://sentry.io/api/0/organizations/{slug}/with Bearer auth, returns{ id, name, slug }on success, wraps errors viawrapIntegrationCall()per existing patternFrontend (
web/src/components/projects/integration-form.tsx)IntegrationCategorytype to include'alerting'TabButtonto the tab barAlertingTabcomponent following SCM tab patterns:ProjectSecretFieldforSENTRY_API_TOKENwith inline verification (shows org name on success)ProjectSecretFieldforSENTRY_WEBHOOK_SECRET(optional)<BASE_URL>/sentry/webhook/<projectId>projects.integrations.upsertwithcategory: 'alerting',provider: 'sentry'projects.integrations.deletewithcategory: 'alerting'alertingIntegrationdata viafindIntegrationByCategory(integrations, 'alerting')for pre-populationTests
tests/unit/api/routers/projects.test.ts: Added tests foralertingcategory inupsertanddelete, plus rejection of unknown categoriestests/unit/api/routers/integrationsDiscovery.test.ts: Added fullverifySentrytest suite (success, missing fields, 401 error, network failure, URL-encoding, UNAUTHORIZED, empty input validation)Test plan
Notes
project_integrations.categoryis a TEXT column, not a DB enumSENTRY_API_TOKEN,SENTRY_WEBHOOK_SECRET) and the'alerting'category were already pre-registered insrc/config/integrationRoles.tssentry.io) is supported; self-hosted support can be added later via an optionalbaseUrlfield🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details