Skip to content

feat(webhooks): add Slack and Discord delivery format presets#243

Merged
parth0025 merged 1 commit into
stagingfrom
feat/webhook-slack-discord-presets
Jun 16, 2026
Merged

feat(webhooks): add Slack and Discord delivery format presets#243
parth0025 merged 1 commit into
stagingfrom
feat/webhook-slack-discord-presets

Conversation

@parth0025

Copy link
Copy Markdown
Collaborator

S2-01 / S2-03 (phase 1) β€” Slack & Discord webhook presets

Lets an outgoing webhook target a Slack or Discord incoming webhook directly, with no transform/middleware service.

  • New format field on the webhook (json default Β· slack Β· discord), declared on the strict webhooks schema, validated on create/update, and returned in the (masked) hook responses.
  • The dispatcher renders each task event into the target shape before signing/sending:
    • Slack β†’ { text, blocks } (Block Kit: event + task key/name, status Β· priority Β· due context line)
    • Discord β†’ { embeds: [...] } (title + status/priority/due fields)
    • json (and anything unknown) β†’ the raw envelope unchanged
  • The transformer (formatForTarget) is a pure function in webhookRules.js, covered by unit tests; the HMAC signature now covers exactly the bytes sent.

Usage: POST /api/v2/webhooks with { name, url: <slack/discord incoming-webhook URL>, events, format: "slack" }.

Verification

  • Full jest suite passes (incl. new format-preset tests); webhooks module runtime-loads with STORAGE_TYPE set; transformer output spot-checked.

Note: this is backend-only (webhooks have no settings UI yet) β€” a webhook is configured via the API. A "Send to Slack/Discord" UI toggle can come with the webhooks settings page later.

πŸ€– Generated with Claude Code

A webhook can now set format=slack or format=discord (default json) so it
can target a Slack or Discord incoming webhook directly β€” the dispatcher
renders each task event into Slack Block Kit or a Discord embed instead
of raw JSON, no transform service needed. format is validated on
create/update, declared on the webhooks schema, and the transformer is a
pure function covered by unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e20efd4-a31c-42d2-b626-22d9ad68a5e8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • πŸ” Trigger review
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/webhook-slack-discord-presets

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

@parth0025 parth0025 merged commit 16639f8 into staging Jun 16, 2026
4 checks passed
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