Skip to content

feat(webapp): notify customers of incidents via BetterStack webhook#4088

Closed
kathiekiwi wants to merge 1 commit into
mainfrom
feature/incident-notifications
Closed

feat(webapp): notify customers of incidents via BetterStack webhook#4088
kathiekiwi wants to merge 1 commit into
mainfrom
feature/incident-notifications

Conversation

@kathiekiwi

Copy link
Copy Markdown
Collaborator

When we publish a status report on BetterStack, customers shouldn't have to be subscribed to find out. This adds an inbound webhook that proactively notifies customers across Slack, email, and Discord.

Fires only on incident updates we publish — not on monitor auto-alerts. Each channel no-ops unless configured.

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b229cd3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 039a8b55-8a1a-41ac-8ee3-477da6ed34ff

📥 Commits

Reviewing files that changed from the base of the PR and between 1531c94 and b229cd3.

📒 Files selected for processing (17)
  • .server-changes/incident-notifications.md
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/routes/webhooks.v1.betterstack-incidents.ts
  • apps/webapp/app/services/betterstack/incidentWebhook.ts
  • apps/webapp/app/utils/redactUrl.ts
  • apps/webapp/app/v3/alertsWorker.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverDiscord.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverEmail.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverSlack.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/fanout.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/messages.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/recipients.server.ts
  • apps/webapp/app/v3/tracer.server.ts
  • apps/webapp/server.ts
  • apps/webapp/test/incidentNotifications.test.ts
  • internal-packages/emails/emails/incident-notification.tsx
  • internal-packages/emails/src/index.tsx
✅ Files skipped from review due to trivial changes (1)
  • .server-changes/incident-notifications.md
🚧 Files skipped from review as they are similar to previous changes (16)
  • apps/webapp/app/v3/services/alerts/incidentNotifications/fanout.server.ts
  • apps/webapp/app/utils/redactUrl.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/recipients.server.ts
  • internal-packages/emails/emails/incident-notification.tsx
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverDiscord.server.ts
  • internal-packages/emails/src/index.tsx
  • apps/webapp/app/routes/webhooks.v1.betterstack-incidents.ts
  • apps/webapp/server.ts
  • apps/webapp/app/v3/tracer.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverSlack.server.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/messages.ts
  • apps/webapp/test/incidentNotifications.test.ts
  • apps/webapp/app/v3/alertsWorker.server.ts
  • apps/webapp/app/services/betterstack/incidentWebhook.ts
  • apps/webapp/app/v3/services/alerts/incidentNotifications/deliverEmail.server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (24)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp

Walkthrough

A Better Stack incident webhook route was added to validate incoming incident updates, normalize the payload, and enqueue incident fanout work. New Slack, Discord, and email delivery paths were added through Redis worker jobs, along with shared message builders, recipient pagination, and an incident email template. The PR also adds incident-notification environment settings, a changelog entry, tests, and URL query redaction used in server logging and tracing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description summarizes the change but omits required template sections like Closes #, checklist, testing, changelog, and screenshots. Add the template sections, including Closes #, checklist items, testing steps, changelog, and screenshots or placeholders where applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, specific, and accurately summarizes the main BetterStack incident-notification change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/incident-notifications

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@kathiekiwi kathiekiwi force-pushed the feature/incident-notifications branch from 378b7e5 to 9236ca1 Compare July 1, 2026 12:20
@kathiekiwi kathiekiwi marked this pull request as ready for review July 1, 2026 12:27
coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@kathiekiwi kathiekiwi force-pushed the feature/incident-notifications branch from 9236ca1 to 052bbe5 Compare July 1, 2026 12:46
devin-ai-integration[bot]

This comment was marked as resolved.

@kathiekiwi kathiekiwi force-pushed the feature/incident-notifications branch from 052bbe5 to 1531c94 Compare July 1, 2026 13:39
devin-ai-integration[bot]

This comment was marked as resolved.

When a status report is published on the status page, an inbound BetterStack
webhook fans the update out over Slack, email, and Discord. Fires only on published incident
updates, not monitor auto-alerts. Deduped per update; each channel no-ops
unless its own config is present.
@kathiekiwi kathiekiwi force-pushed the feature/incident-notifications branch from 1531c94 to b229cd3 Compare July 1, 2026 14:22
@kathiekiwi kathiekiwi closed this Jul 1, 2026
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