Added escalation email function with the help of Github Copilot#183
Open
Aulakh1881 wants to merge 16 commits intoramfam101:developfrom
Open
Added escalation email function with the help of Github Copilot#183Aulakh1881 wants to merge 16 commits intoramfam101:developfrom
Aulakh1881 wants to merge 16 commits intoramfam101:developfrom
Conversation
Added support for escalation alerts in notification messages.
Added support for Telegram notifications and escalation handling.
There was a problem hiding this comment.
Pull request overview
Adds an “escalation after N minutes” capability for monitors so that, if a monitor remains down long enough, additional notification channels can be alerted. This extends the monitor model (DB + types + validation), updates notification message building, and adds a Create Monitor UI section + translations.
Changes:
- Add escalation configuration fields (
escalateAfterMinutes,escalationNotifications) and astatusChangedAttimestamp to support time-based escalation. - Add a new notification message type (
escalation_alert) and route escalation notifications viaNotificationsService. - Update the Create Monitor form + English locale strings to configure escalation rules.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/validation/monitorValidation.ts | Accepts escalation-related fields in create/edit monitor validation. |
| server/src/types/notificationMessage.ts | Adds escalation_alert notification message type. |
| server/src/types/monitor.ts | Adds statusChangedAt, escalateAfterMinutes, escalationNotifications to the monitor shape. |
| server/src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts | Adds an additional “escalation check” notification path during monitor jobs. |
| server/src/service/infrastructure/statusService.ts | Persists statusChangedAt whenever status changes. |
| server/src/service/infrastructure/notificationsService.ts | Adds escalation routing logic and introduces a Telegram provider path. |
| server/src/service/infrastructure/notificationProviders/email.ts | Adds email subject handling for escalation_alert. |
| server/src/service/infrastructure/notificationMessageBuilder.ts | Adds escalation-specific message building logic. |
| server/src/repositories/monitors/MongoMonitorsRepository.ts | Maps escalation fields + statusChangedAt between Mongo docs and entities. |
| server/src/db/models/Monitor.ts | Adds schema fields for escalation + statusChangedAt. |
| server/package-lock.json | Updates lockfile (adds pg, bumps super-simple-scheduler, and other dependency changes). |
| client/src/Validation/monitor.ts | Adds Zod validation for escalation fields on the client. |
| client/src/Types/Monitor.ts | Adds escalation fields to client monitor type. |
| client/src/Pages/CreateMonitor/index.tsx | Adds an “Escalation Rules” section to the Create Monitor form. |
| client/src/locales/en.json | Adds translations for escalation rules + Telegram configuration strings. |
| client/src/Hooks/useMonitorForm.ts | Adds default form values for escalation fields. |
Files not reviewed (1)
- server/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
server/src/service/infrastructure/notificationsService.ts:55
NotificationsServicenow requires atelegramProviderconstructor parameter, but the service wiring needs to be updated accordingly (e.g.,server/src/config/services.tscurrently constructsnew NotificationsService(...)without this argument). As-is, this change will break compilation/runtime initialization.
constructor(
notificationsRepository: INotificationsRepository,
monitorsRepository: IMonitorsRepository,
webhookProvider: INotificationProvider,
emailProvider: INotificationProvider,
slackProvider: INotificationProvider,
discordProvider: INotificationProvider,
pagerDutyProvider: INotificationProvider,
matrixProvider: INotificationProvider,
teamsProvider: INotificationProvider,
telegramProvider: INotificationProvider,
settingsService: ISettingsService,
logger: ILogger,
notificationMessageBuilder: INotificationMessageBuilder
) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
server/src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts
Show resolved
Hide resolved
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.
(Please remove this line only before submitting your PR. Ensure that all relevant items are checked before submission.)
Describe your changes
Briefly describe the changes you made and their purpose.
Write your issue number after "Fixes "
Fixes #123
Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.
<div>Add</div>, use):npm run formatin server and client directories, which automatically formats your code.Created escalation automation feature with the help of Github Copilot, as described in the assignment requirements.