Skip to content

feat(python-cli-parity): send scan notifications to Slack bot channels - #1834

Open
John-David Dalton (jdalton) wants to merge 1 commit into
parity/2241-notification-foundationfrom
parity/2243-slack-bot
Open

John-David Dalton (jdalton) wants to merge 1 commit into
parity/2241-notification-foundationfrom
parity/2243-slack-bot

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

The Socket Python CLI can post findings to Slack channels through a bot. This PR adds bot delivery to Socket CLI using the same message as the webhook. Set SOCKET_SLACK_BOT_TOKEN and list the channels in SOCKET_SLACK_CONFIG_JSON under bot_configs.

@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces handling of Slack bot tokens in CI and outbound API calls; failures are isolated to warnings, but misconfigured tokens or channels could leak operational detail in logs if not handled carefully (tests assert tokens are not in payloads).

Overview
Adds an optional Slack bot delivery path alongside existing incoming webhooks, so CI can post filtered scan summaries to channel IDs via chat.postMessage using SOCKET_SLACK_BOT_TOKEN and bot_configs inside SOCKET_SLACK_CONFIG_JSON.

slack-webhook.mts now exports shared filtering and message formatting (filterSlackFindings, formatSlackMessage, config parsing, etc.) so webhooks and the new slack-bot.mts module reuse the same destination filters and Block Kit payload. isSlackNotificationConfigured() treats either the config JSON or a bot token as “notifications enabled.”

Diff scan and scan report output paths build one notification report, then call webhook delivery and bot delivery in sequence. Bot delivery validates xoxb- tokens, parses bot_configs, skips bad channels/config entries with warnings, and never changes scan exit behavior on API or rate-limit failures.

Documentation in report.md covers bot app setup, env vars, and behavior parity with webhook notifications.

Reviewed by Cursor Bugbot for commit ad4af8a. Configure here.

@jdalton John-David Dalton (jdalton) changed the title parity/2243 slack bot feat(python-cli-parity): send scan notifications to Slack bot channels Dec 4, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ad4af8a. Configure here.

@jdalton
John-David Dalton (jdalton) force-pushed the parity/2243-slack-bot branch 2 times, most recently from 343c0e7 to 58dc4d9 Compare December 4, 2026 06:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant