Skip to content

Fix Slack and MS Teams notifiers not reading URL from dashboard config#37

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

Fix Slack and MS Teams notifiers not reading URL from dashboard config#37
dc-larsen wants to merge 1 commit intomainfrom
fix/slack-msteams-notifier-url-config-key

Conversation

@dc-larsen
Copy link
Contributor

Summary

  • SlackNotifier and MSTeamsNotifier both read self.config.get('webhook_url') but notifications.yaml defines param names as slack_webhook_url and msteams_webhook_url. Same class of bug as Fix webhook notifier not reading URL from dashboard config #34.
  • MS Teams was also missing its auto-enablement block in NotificationManager.load_from_config(), so it couldn't load via dashboard config or env var at all.
  • Env var fallback paths were unaffected.

Root cause

Notifier Config key used Param name in notifications.yaml
SlackNotifier self.config.get('webhook_url') slack_webhook_url
MSTeamsNotifier self.config.get('webhook_url') msteams_webhook_url

Additionally, the manager's load_from_config() had enablement blocks for slack, webhook, ms_sentinel, jira, sumologic, and github_pr, but none for msteams.

Changes

  • slack_notifier.py: self.config.get('webhook_url') -> self.config.get('slack_webhook_url')
  • ms_teams_notifier.py: self.config.get('webhook_url') -> self.config.get('msteams_webhook_url')
  • manager.py: Added msteams auto-enablement block + imported get_msteams_webhook_url

Reproduction

from socket_basics.core.notification.slack_notifier import SlackNotifier
from socket_basics.core.notification.ms_teams_notifier import MSTeamsNotifier

# Before fix: both return empty/falsy
s = SlackNotifier({"slack_webhook_url": "https://hooks.slack.com/test"})
print(s.webhook_url)  # Before: '' | After: 'https://hooks.slack.com/test'

m = MSTeamsNotifier({"msteams_webhook_url": "https://outlook.office.com/webhook/test"})
print(m.webhook_url)  # Before: '' | After: 'https://outlook.office.com/webhook/test'

Testing

  • 7 new tests in tests/test_slack_notifier_params.py (direct params, env var, precedence, manager flow)
  • 7 new tests in tests/test_msteams_notifier_params.py (direct params, env var, precedence, manager flow)
  • Full suite: 112/112 passed

Context

Found while testing v1.1.1 for a customer. The webhook version of this bug was fixed in #34. This PR completes the fix across all webhook-based notifiers.

Same config key mismatch as #34 (webhook). Both notifiers read
self.config.get('webhook_url') but notifications.yaml defines param
names as 'slack_webhook_url' and 'msteams_webhook_url'. Dashboard
config values were silently dropped.

Also adds missing MS Teams auto-enablement block in
NotificationManager.load_from_config(), which prevented the notifier
from loading via dashboard config or env var at all.

Env var fallback paths (INPUT_SLACK_WEBHOOK_URL,
INPUT_MSTEAMS_WEBHOOK_URL) were unaffected.
@dc-larsen dc-larsen requested a review from a team as a code owner February 27, 2026 19:36
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