Skip to content

feat: support multiple webhook targets via alert_webhook_url array#50

Merged
eclectic-coding merged 2 commits into
mainfrom
feat/multiple-webhook-targets
May 21, 2026
Merged

feat: support multiple webhook targets via alert_webhook_url array#50
eclectic-coding merged 2 commits into
mainfrom
feat/multiple-webhook-targets

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • alert_webhook_url now accepts a string (existing behavior, unchanged) or an array of URL strings
  • All configured endpoints receive the same JSON payload when the failure threshold is exceeded
  • A failure posting to one URL is logged to Rails.logger and skipped without blocking the remaining targets
  • Single-string configs require no changes — fully backward-compatible

Implementation

All changes are in AlertWebhook:

  • webhook_urls private method normalizes the config value with Array(...).flatten.compact.select(&:present?)
  • configured? checks webhook_urls.any? instead of .present?
  • call captures the URL list before spawning the thread, then iterates in the thread

3 new specs: posts to all URLs, continues after one failure, treats an empty array as unconfigured.

Test plan

  • Single string config — existing behavior unchanged; one POST fired
  • Array config with two URLs — both endpoints receive the payload on the same alert
  • One URL in the array returns an error — error logged, second URL still receives the payload
  • Empty array — no POST fired

🤖 Generated with Claude Code

eclectic-coding and others added 2 commits May 21, 2026 16:30
alert_webhook_url now accepts a string or an array of strings. All
configured URLs receive the same payload when the failure threshold is
exceeded. A failure posting to one URL is logged and skipped without
blocking the remaining targets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit f8bfeb6 into main May 21, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feat/multiple-webhook-targets branch May 21, 2026 20:31
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