Skip to content

Comments

Fix webhook notifier not reading URL from dashboard config#34

Open
dc-larsen wants to merge 1 commit intomainfrom
fix/webhook-notifier-url-config-key
Open

Fix webhook notifier not reading URL from dashboard config#34
dc-larsen wants to merge 1 commit intomainfrom
fix/webhook-notifier-url-config-key

Conversation

@dc-larsen
Copy link
Contributor

Summary

  • WebhookNotifier.__init__ used self.config.get('url') but the parameter key from notifications.yaml is webhook_url. Dashboard-configured webhook URLs were silently dropped.
  • Env var path (INPUT_WEBHOOK_URL) was unaffected, which is why this wasn't caught in earlier testing.
  • Aligns with the pattern already used by JiraNotifier (self.config.get('jira_url')).

Root cause

Step Key used Source
Manager enablement check app_config.get('webhook_url') manager.py:82
Parameter resolution params['webhook_url'] notifications.yaml name field
Notifier constructor self.config.get('url') webhook_notifier.py:22

The constructor looked for 'url' but received 'webhook_url', so self.url resolved to None.

Reproduction

from socket_basics.core.notification.webhook_notifier import WebhookNotifier

# Simulates dashboard config flow (app_config -> params)
n = WebhookNotifier({"webhook_url": "https://hooks.example.com/endpoint"})
print(n.url)  # Before fix: None | After fix: https://hooks.example.com/endpoint

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 logged WebhookNotifier: no webhook URL configured at send time. Jira notifier worked correctly because its config keys are consistent.

Testing

  • 7 new tests in tests/test_webhook_notifier_params.py covering:
    • Direct param reading from dashboard config
    • Empty config (no URL)
    • Env var fallback (INPUT_WEBHOOK_URL)
    • Param precedence over env var
    • Full manager flow with app_config
    • Full manager flow with env var
    • Manager precedence (app_config over env)
  • Full suite: 98/98 passed

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.
@dc-larsen dc-larsen requested a review from lelia February 24, 2026 23:15
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