Skip to content

Add Discord webhook alert channel support#8184

Open
ben-m-klein wants to merge 17 commits into
graphql-hive:mainfrom
ben-m-klein:feature/discord-webhook-alerts
Open

Add Discord webhook alert channel support#8184
ben-m-klein wants to merge 17 commits into
graphql-hive:mainfrom
ben-m-klein:feature/discord-webhook-alerts

Conversation

@ben-m-klein

Copy link
Copy Markdown

Background

This is closing issue #130.

Hive supports generic webhooks and Slack/MS Teams alerts, but Discord alerts currently don't work with the generic webhook. This PR adds a Discord compatible webhook option.

Description

The implementation pattern matches the existing MS Teams alerts:

  • Adds DISCORD_WEBHOOK channel type
  • Uses discord specific webhook formatting for confirmations and alert notifications
  • UI drop down option added in alerts section
  • Adapter tests included.

Checklist

  • Input validation
  • Output encoding
  • Error handling and logging
  • Testing
Screenshot 2026-06-30 134159 Screenshot 2026-06-30 134315 Screenshot 2026-06-30 134354

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Discord Webhook integration for alerts, adding a new DISCORD_WEBHOOK channel type, implementing the DiscordCommunicationAdapter, and updating the web dashboard to support creating and displaying Discord Webhook channels. Key feedback includes correcting the pluralization logic to handle zero changes, avoiding direct usage of the global fetch API to comply with the repository style guide, improving error logging to preserve stack traces and fix a missing placeholder, and replacing a non-null assertion operator in the resolver with a safe fallback.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/services/api/src/modules/alerts/providers/adapters/discord.ts Outdated
ben-m-klein and others added 12 commits July 1, 2026 11:11
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…scord.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ookChannel.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ben-m-klein ben-m-klein force-pushed the feature/discord-webhook-alerts branch from 23e394b to f167a8b Compare July 1, 2026 18:11

@jonathanawesome jonathanawesome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution...this is clean and follows the existing MS Teams pattern nicely. 🐝

One gap to flag: Discord is now selectable as a metric-alert destination, a new feature that's currently hidden behind a feature flag, but the live notification preview in the rule form wasn't updated for it...AlertPreview in alert-notification-preview.tsx only handles SLACK / WEBHOOK / MSTEAMS_WEBHOOK and falls through to default: return null, so picking a Discord channel renders a blank preview. A DiscordPreview branch mirroring the TeamsPreview (title + severity color bar + Type/Severity/Target fields) is needed.

To repro/test locally, scripts/seed-alerts-live/README.md walks through enabling the metric-alerts feature flag and seeding a live alert (you won't need to ).

Comment thread packages/services/api/src/modules/alerts/providers/adapters/discord.ts Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/migrations/src/actions/2026.06.22T20-10-00.discord-webhook.ts Outdated
Comment thread packages/migrations/src/actions/2026.06.22T20-10-00.discord-webhook.ts Outdated
ben-m-klein and others added 3 commits July 13, 2026 16:36
…bhook.ts

Co-authored-by: jdolle <1841898+jdolle@users.noreply.github.com>
Align the enum with SLACK naming instead of DISCORD_WEBHOOK, as suggested in review.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts with latest main so the PR can run checks.

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	packages/migrations/src/run-pg-migrations.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants