Fix notifiers reading repo/branch from wrong source#30
Merged
Conversation
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.
lelia
approved these changes
Feb 20, 2026
Collaborator
lelia
left a comment
There was a problem hiding this comment.
LGTM. Tested webhook functionality as follows:
- Created a dummy webhook at https://webhook.site
- Set value of
INPUT_WEBHOOK_URLto 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
repositoryandbranchvalues:
"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.
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
repositoryandbranchfromself.config, which never contains these fields, resulting in"Unknown"for both values in all outbound payloadsNotificationManagercorrectly populates these in thefactsdict (manager.py:279-280), and the Jira notifier already reads fromfactscorrectlyfactsinstead ofself.configTest plan
self.configonly contains init params (e.g.url), neverrepository/branchfactsdict contains correctrepositoryandbranchafterNotificationManager.notify_all()populates them