Fix webhook notifier not reading URL from dashboard config#34
Open
Fix webhook notifier not reading URL from dashboard config#34
Conversation
WebhookNotifier.__init__ read self.config.get('url') but the param
resolved from notifications.yaml and app_config uses the key
'webhook_url'. This caused dashboard-configured webhook URLs to be
silently ignored, logging "no webhook URL configured" at send time
even though the notifier loaded successfully.
Aligns the config key with the parameter name, matching the pattern
used by JiraNotifier and other notifiers. Env var fallback
(INPUT_WEBHOOK_URL) is unaffected.
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
WebhookNotifier.__init__usedself.config.get('url')but the parameter key fromnotifications.yamliswebhook_url. Dashboard-configured webhook URLs were silently dropped.INPUT_WEBHOOK_URL) was unaffected, which is why this wasn't caught in earlier testing.JiraNotifier(self.config.get('jira_url')).Root cause
app_config.get('webhook_url')manager.py:82params['webhook_url']notifications.yamlname fieldself.config.get('url')webhook_notifier.py:22The constructor looked for
'url'but received'webhook_url', soself.urlresolved toNone.Reproduction
Customer context
Customer configured webhook URL via the Socket dashboard ("Generic webhook URL for notifications"). Logs showed notifier loaded (
enabled via app_config:webhook_url) but then loggedWebhookNotifier: no webhook URL configuredat send time. Jira notifier worked correctly because its config keys are consistent.Testing
tests/test_webhook_notifier_params.pycovering:INPUT_WEBHOOK_URL)app_config