Skip to content

Turn of successful githab CI notifications for Discord#154

Open
aryan-neogi wants to merge 1 commit into
pyfenn:mainfrom
aryan-neogi:fix/disable-successful-discord-notifications
Open

Turn of successful githab CI notifications for Discord#154
aryan-neogi wants to merge 1 commit into
pyfenn:mainfrom
aryan-neogi:fix/disable-successful-discord-notifications

Conversation

@aryan-neogi

Copy link
Copy Markdown
Contributor

Summary

Closes #152

This PR adds support for filtering Discord notifications based on workflow success status.

Changes

fenn/notification/services/discord.py

  • Added notify_on_success parameter (default: False)
  • Added should_notify() override to filter success notifications

fenn/notification/service.py

  • Added base should_notify() method for notification services

fenn/notification/notifier.py

  • Updated notify() to accept an is_success parameter
  • Added check to call should_notify() before sending notifications

Tests

tests/unit/notification/test_discord_service.py

Added tests covering notification filtering behavior:

  • Sends notifications on failure
  • Skips success notifications when notify_on_success=False
  • Sends success notifications when notify_on_success=True
  • Verifies should_notify() logic

Result

Discord notifications can now be configured to only send on failures, reducing notification noise while preserving existing behavior through configuration.

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.

Turn of successful githab CI notifications for Discord

1 participant