Skip to content

Add Discord webhook support to monitor#147

Merged
hidai25 merged 1 commit intohidai25:mainfrom
zeel2104:feat/discord-monitor-webhook
Apr 1, 2026
Merged

Add Discord webhook support to monitor#147
hidai25 merged 1 commit intohidai25:mainfrom
zeel2104:feat/discord-monitor-webhook

Conversation

@zeel2104
Copy link
Copy Markdown
Contributor

Description

Adds Discord webhook support to evalview monitor, matching the existing Slack alert flow for regressions, recoveries, and performance spikes.

Related Issue

Fixes #80

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test improvements
  • CI/CD improvements

Changes Made

  • Added DiscordNotifier in evalview/core/discord_notifier.py with send_regression_alert(), send_recovery_alert(), and performance alert support.
  • Added --discord-webhook support to evalview monitor with the same priority chain as Slack: CLI flag > config > env var.
  • Added config support for monitor.discord_webhook and environment variable fallback via EVALVIEW_DISCORD_WEBHOOK.
  • Updated monitor flow to support Slack and Discord webhook notifications in parallel.
  • Added tests for Discord webhook resolution, Discord notifier payloads, and monitor config defaults.

Testing

Ran the focused monitor/config test suite after setting writable local temp directories for pytest on Windows.

Test Configuration

  • Python Version: 3.12.4
  • OS: Windows

Tests Added/Modified

  • Unit tests added/updated
  • Integration tests added/updated
  • All tests pass locally
  • Test coverage maintained or improved

Manual Testing Steps

  1. Configure a Discord webhook using --discord-webhook, monitor.discord_webhook, or EVALVIEW_DISCORD_WEBHOOK.
  2. Run evalview monitor against a test suite with baselines.
  3. Verify regression and recovery alerts are delivered to Discord in the same scenarios as Slack.

Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have run black to format my code
  • I have run ruff and fixed any linting issues
  • I have run mypy and fixed any type errors
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Documentation

  • I have updated the documentation (README, CONTRIBUTING, etc.)
  • I have added docstrings to new functions/classes
  • I have updated the CHANGELOG.md (if applicable)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this with multiple agent frameworks (if applicable)

Dependencies

  • I have checked that no new dependencies were added unnecessarily
  • If dependencies were added, I have updated pyproject.toml
  • I have verified that the new dependencies are compatible with Python 3.9+

Breaking Changes

None.

Screenshots (if applicable)

N/A

Additional Notes

This change reuses the existing monitor alert structure so Discord support behaves consistently with Slack while using Discord's webhook payload format (content).

Reviewer Notes

Please pay special attention to:

  • webhook priority resolution for CLI/config/env
  • parity between Slack and Discord notifier behavior
  • monitor command support for sending alerts to both channels

By submitting this pull request, I confirm that:

  • I have read and followed the CONTRIBUTING.md guidelines
  • I agree to the project's CODE_OF_CONDUCT.md
  • My contribution is my own work and I have the right to contribute it

@hidai25
Copy link
Copy Markdown
Owner

hidai25 commented Apr 1, 2026

Nicely done @zeel2104 ! The implementation mirrors the Slack notifier cleanly — webhook
resolution, payload format, and test coverage all look solid. Love that you added the
_build_notifiers() helper to keep things DRY.

Two tiny style nits for a follow-up (not blocking):

  • List[tuple[str, Any]] → List[Tuple[str, Any]] to match our Python 3.9 type annotation
    convention
  • Dashboard mode uses notifier[1] indexing while scrolling mode unpacks for label,
    notifier — would be nice to be consistent

Merging — thanks for the contribution!

@hidai25 hidai25 merged commit 27425a7 into hidai25:main Apr 1, 2026
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.

Add Discord webhook support to evalview monitor

2 participants