feat(webhook): allow multiple webhook URLs per instance (fan-out) - #138
Open
samuelpc7 wants to merge 1 commit into
Open
feat(webhook): allow multiple webhook URLs per instance (fan-out)#138samuelpc7 wants to merge 1 commit into
samuelpc7 wants to merge 1 commit into
Conversation
Reviewer's GuideEnables fan-out of instance webhooks by parsing the existing single string field into multiple URLs (supporting several input formats) and sending the same payload concurrently to each URL while preserving existing global webhook behavior. Sequence diagram for webhook fan-out in ProducesequenceDiagram
participant Producer as webhookProducer
participant GlobalWebhook as p.url
participant Splitter as splitWebhookURLs
participant InstanceWebhook as webhookUrl
Producer->>GlobalWebhook: sendWebhookWithRetry(p.url, payload, ...)
activate GlobalWebhook
deactivate GlobalWebhook
Producer->>Splitter: splitWebhookURLs(webhookUrl)
activate Splitter
Splitter-->>Producer: []string urls
deactivate Splitter
loop for each url in urls
Producer->>InstanceWebhook: sendWebhookWithRetry(url, payload, ...)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Fan-out currently spawns an unbounded goroutine per URL with full retry logic; consider adding some form of concurrency limiting or a worker pool so a misconfigured instance with many URLs cannot exhaust resources.
- The special "disabled" marker is hard-coded and case-sensitive in multiple places in splitWebhookURLs; consider centralizing this into a constant and/or normalizing case so configuration is less brittle and easier to change later.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Fan-out currently spawns an unbounded goroutine per URL with full retry logic; consider adding some form of concurrency limiting or a worker pool so a misconfigured instance with many URLs cannot exhaust resources.
- The special "disabled" marker is hard-coded and case-sensitive in multiple places in splitWebhookURLs; consider centralizing this into a constant and/or normalizing case so configuration is less brittle and easier to change later.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Description
The instance
Webhookfield can now hold multiple URLs. The producer delivers theSAME event request to every address (each with its own retry). Accepted formats:
newline / comma / semicolon separated, or a JSON array. Duplicates, empty entries
and the
"disabled"marker are ignored.No schema change: the
Webhookcolumn stays astring; onlypkg/events/webhook/webhook_producer.gowas touched (newsplitWebhookURLshelper). Fully backward compatible — a single URL behaves exactly as before. The
global webhook (
config.WebhookUrl) keeps being sent in parallel.Related Issue
N/A
Type of Change
Testing
Screenshots (if applicable)
N/A — backend only.
Checklist
Additional Notes
Single-file change.
Producenow fans the same payload out to every URL returnedby
splitWebhookURLs, instead of a singlewebhookUrl.Summary by Sourcery
New Features: