feat: support Slack webhook URL as alternative to token+channel for all monitors - #126
Draft
dewanshparashar wants to merge 2 commits into
Draft
feat: support Slack webhook URL as alternative to token+channel for all monitors#126dewanshparashar wants to merge 2 commits into
dewanshparashar wants to merge 2 commits into
Conversation
…ll monitors Each monitor's Slack poster now works on an either-or config basis: - SLACK_WEBHOOK_URL env var (preferred: incoming webhooks are scoped to a single channel, less prone to abuse), or - SLACK_TOKEN + SLACK_CHANNEL (existing behavior, unchanged) If both are configured, the webhook takes precedence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dewanshparashar
force-pushed
the
feat/slack-webhook-support
branch
from
July 23, 2026 08:56
40a8a9c to
d3f1cb0
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All three monitors (retryable, batch-poster, assertion) now support either-or Slack configuration:
<MONITOR>_SLACK_WEBHOOK_URLto a Slack incoming webhook. Webhooks are scoped to a single channel, so they're less prone to abuse than a bot token.<MONITOR>_SLACK_TOKEN+<MONITOR>_SLACK_CHANNEL, unchanged.If both are configured, the webhook takes precedence. This lets us migrate monitor-by-monitor: set the webhook secret, verify alerts arrive, then drop the token/channel pair.
Changes
createSlackPoster(shared by all monitors) accepts an optionalwebhookUrlEnvVar; if neither config is present it throws an error naming both options.postSlackMessageViaWebhookinpackages/utilsposts via nativefetch(no new dependency), preserving existing behavior: GitHub CI run link appended, message sanitized,unfurl_links: false. Throws on non-2xx without leaking the webhook URL.RETRYABLE_MONITORING_SLACK_WEBHOOK_URL,BATCH_POSTER_MONITORING_SLACK_WEBHOOK_URL,ASSERTION_MONITORING_SLACK_WEBHOOK_URL..env.sample, root README, and all three package READMEs.Testing
createSlackPostertest suite from 6 to 13 tests: webhook precedence, webhook-only config, token+channel fallback, and the new error message. All 20 utils tests pass.🤖 Generated with Claude Code