Skip to content

feat: Add webhook notifications for scan completion (Slack, Discord, …#393

Open
Somil450 wants to merge 5 commits into
utksh1:mainfrom
Somil450:feature/webhook-notifications
Open

feat: Add webhook notifications for scan completion (Slack, Discord, …#393
Somil450 wants to merge 5 commits into
utksh1:mainfrom
Somil450:feature/webhook-notifications

Conversation

@Somil450
Copy link
Copy Markdown

Description

Resolves #375

This PR introduces automated webhook notifications (Slack, Discord, and Custom JSON endpoints) that trigger upon scan completion, removing the need for users to manually monitor the dashboard for long-running tasks.

Changes Included

  • Backend:
    • Added new /api/v1/settings/webhooks endpoints to persist webhook configurations securely in the SQLite settings table (making them available for background executor tasks).
    • Created notifications.py to construct payloads for Discord and Slack, leveraging httpx and an exponential backoff retry mechanism for reliability.
    • Integrated notify_scan_completion in executor.py to fire asynchronously at the end of every task execution.
  • Frontend:
    • Added a new Webhook_Endpoints section to the Settings page.
    • Included a TEST_ENDPOINTS button to quickly transmit a mock payload and verify connectivity.
  • Dependencies: Added httpx>=0.28.1 to requirements.txt for asynchronous webhook requests.

Verification

  • Configured mock Slack, Discord, and Custom endpoints in the frontend UI.
  • Tested the UI TEST_ENDPOINTS button successfully transmitted mock payloads.
  • Launched dummy scan tasks and verified that real completion notifications (including target, status, duration, and severity counts) were successfully delivered in the background.
  • Verified that failed webhook deliveries attempt to retry securely in the background without blocking the core scan pipeline.

@utksh1 utksh1 added area:backend Backend API, database, or service work area:frontend Frontend React/UI work type:feature Feature work category bonus label level:advanced 55 pts difficulty label for advanced contributor PRs labels May 28, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Thanks for the feature work here. I’m not merging this version yet.\n\nRequested changes:\n- Remove the unrelated generated file from this PR. A 3000+ line repository dump should not be bundled into a webhook feature change.\n- Fix the failing CI jobs: and .\n- Keep focused. Right now it shows broad churn for a small schema addition, which makes review harder and increases regression risk.\n- Add the webhook tests in the project’s normal backend test location/pattern and make sure they cover payload formatting plus failure/retry handling.\n\nThe feature itself is useful, but the patch needs to be tighter and pass CI before it can be approved.

@Somil450
Copy link
Copy Markdown
Author

Hi @utksh1, thanks for the review! I've removed the extraneous issues.json file, cleaned up the formatting in routes.py and models.py to keep the diff strictly focused on the webhook feature, and properly integrated the test cases into testing/backend/unit/test_webhooks.py with full coverage for payload formatting and retry handling. The CI checks should be passing now!

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Re-reviewed latest state. This branch is now conflicting and still has too much unrelated surface for a webhook notification feature, including requirements/model/settings/plugin metadata churn. Please rebase, keep the diff focused on server-side webhook configuration/delivery, and add backend tests for payload formatting, delivery failure, and retry/error handling.

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

Labels

area:backend Backend API, database, or service work area:frontend Frontend React/UI work level:advanced 55 pts difficulty label for advanced contributor PRs type:feature Feature work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Webhook and Slack/Discord Notifications for Scan Completion

3 participants