Skip to content

Fix notifiers reading repo/branch from wrong source#30

Merged
dc-larsen merged 4 commits intomainfrom
fix/webhook-notifier-repo-branch
Feb 20, 2026
Merged

Fix notifiers reading repo/branch from wrong source#30
dc-larsen merged 4 commits intomainfrom
fix/webhook-notifier-repo-branch

Conversation

@dc-larsen
Copy link
Contributor

@dc-larsen dc-larsen commented Feb 12, 2026

Summary

  • Webhook, Slack, MS Teams, MS Sentinel, and SumoLogic notifiers read repository and branch from self.config, which never contains these fields, resulting in "Unknown" for both values in all outbound payloads
  • The NotificationManager correctly populates these in the facts dict (manager.py:279-280), and the Jira notifier already reads from facts correctly
  • Changed all five notifiers to read from facts instead of self.config

Test plan

  • Verified self.config only contains init params (e.g. url), never repository/branch
  • Verified facts dict contains correct repository and branch after NotificationManager.notify_all() populates them
  • Tested WebhookNotifier, SlackNotifier, and SumoLogicNotifier with mock data, all return correct repo/branch
  • Run Socket Basics scan with webhook enabled to confirm payload includes real repo/branch values

Webhook, Slack, MS Teams, MS Sentinel, and SumoLogic notifiers read
repository and branch from self.config, which never contains these
fields. The NotificationManager populates them in the facts dict
(manager.py:279-280), matching the pattern the Jira notifier already
uses correctly.

Changed all five notifiers to read from facts instead of self.config.
@dc-larsen dc-larsen requested a review from a team as a code owner February 12, 2026 14:52
@lelia lelia self-assigned this Feb 19, 2026
Copy link
Collaborator

@lelia lelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested webhook functionality as follows:

  • Created a dummy webhook at https://webhook.site
  • Set value of INPUT_WEBHOOK_URL to point at my webhook in .env
  • Ran socket-basics via Docker with the following args:
docker run --rm \
    --env-file .env \
    -v "$(pwd)":/workspace \
    socket-basics:1.0.28 \
    --workspace /workspace \
    --repo SocketDev/socket-basics \
    --branch fix/webhook-notifier-repo-branch \
    --javascript --secrets --trivy-vuln-enabled -v
  • Confirmed webhook payloads now contain repository and branch values:
  "repository": "SocketDev/socket-basics",
  "branch": "fix/webhook-notifier-repo-branch",
  "scanner": "socket-security",

One future improvement to consider is adding a small unit test to verify notifiers prefer facts over self.config for repo/branch.

@dc-larsen dc-larsen merged commit 6f427b8 into main Feb 20, 2026
4 checks passed
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.

3 participants

Comments