Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a notification level filtering system to control which notifications are sent to external services (Slack/Discord) or logged to the console. The filtering system has three levels: HIGH (critical alerts), MED (successful operations and moderate warnings), and LOW (informational messages).
Key changes include:
- Added NotificationLevel enum (HIGH, MED, LOW) with filtering logic in the sendNotification function
- Updated all sendNotification calls throughout the codebase to specify appropriate notification levels
- Added getNotificationLevelForAuction helper function to determine notification levels based on auction type and fill status
- Added configuration validation and documentation for the new notificationLevel config option
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/notifier.ts | Added NotificationLevel enum, implemented level-based filtering in sendNotification, and added getNotificationLevelForAuction helper function |
| src/utils/config.ts | Added notificationLevel field to AppConfig interface and validation logic |
| src/work_submitter.ts | Updated sendNotification calls to use appropriate notification levels; fixed spelling error "transfering" → "transferring" |
| src/work_handler.ts | Updated sendNotification call to use NotificationLevel.MED |
| src/pool_event_handler.ts | Updated multiple sendNotification calls to use getNotificationLevelForAuction for appropriate level assignment |
| src/liquidations.ts | Updated sendNotification call to use NotificationLevel.MED |
| src/bidder_submitter.ts | Updated sendNotification calls throughout to use getNotificationLevelForAuction and appropriate levels |
| src/bidder_handler.ts | Updated sendNotification call to use getNotificationLevelForAuction |
| src/utils/soroban_helper.ts | Adjusted transaction timeout from 6 seconds to 12 seconds; moved submitStartTime initialization |
| test/utils/notifier.test.ts | Added comprehensive test suite for notification filtering, webhook integration, and getNotificationLevelForAuction function |
| test/utils/config.test.ts | Added test for notification level validation |
| test/bidder_submitter.test.ts | Updated test expectations to include notification level parameter |
| example.config.json | Added example notificationLevel configuration |
| README.md | Added documentation for the new notificationLevel configuration option |
| start.sh | Removed extra blank lines |
| example.env | Removed example environment file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.