Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AA storm - email alert logic #1420

Open
wants to merge 59 commits into
base: feature/add-new-AA-storm
Choose a base branch
from

Conversation

Max-Z80
Copy link
Collaborator

@Max-Z80 Max-Z80 commented Jan 28, 2025

Description

This is the logic for deciding whether to send an email or not.

the cron run hourly
latest reports for each storm are persisted in DB
when a new report is published and has not been processed yet by the alert system then an email payload might be built depending of the report status for example

  • When a readiness trigger or
  • when an activation trigger is detected

The email payloads will then be used to create the emails and send it at the end of the process.

Setup - anticipatory action storm alerts

  • Alerts are triggered by a cron job running hourly within the alerting-node process.
  • Run docker-compose up to launch the alerting-node and alerting-db processes.
  • The system checks database entries to determine which country needs to be triggered.
  • Currently, only Mozambique is supported. To add it, connect to the psql console of alerting-db and run the following command:
INSERT INTO anticipatory_action_alerts (country, emails, prism_url)
VALUES ('Mozambique', ARRAY['email1@example.com'], 'https://prism.wfp.org');
  • country: The target country for the alert.
  • emails: A list of email addresses that will receive the alert notification.
  • prism_url: The base URL of the PRISM platform for redirection link and screenshot capture.

Notes

  • Mozambique supported only for storm alerts

How to test the feature:

  • [ ]
  • [ ]

Checklist - did you ...

Test your changes with

  • REACT_APP_COUNTRY=rbd yarn start
  • REACT_APP_COUNTRY=cambodia yarn start
  • REACT_APP_COUNTRY=mozambique yarn start
  • Add / update necessary tests?
  • Add / update outdated documentation?

Screenshot/video of feature:

image

Copy link

github-actions bot commented Jan 28, 2025

Build succeeded and deployed at https://prism-1420.surge.sh
(hash a2e8f9e deployed at 2025-02-21T10:53:59)

@ericboucher
Copy link
Collaborator

@Max-Z80 please describe a bit more what this PR does in the PR body and adapt the name to what it is actually doing. There is no real "logic" here, it is simply initializing the new alert worker. No?

@Max-Z80
Copy link
Collaborator Author

Max-Z80 commented Jan 29, 2025

@Max-Z80 please describe a bit more what this PR does in the PR body and adapt the name to what it is actually doing. There is no real "logic" here, it is simply initializing the new alert worker. No?

THere is a logic in the aa-strom-alert-worker.js. I will describe deeper this logic in the PR body

@Max-Z80 Max-Z80 marked this pull request as draft January 29, 2025 12:44
@Max-Z80 Max-Z80 force-pushed the aa-storm-feature/email-logic branch from 3b4c109 to ddd4a08 Compare January 31, 2025 13:41
@Max-Z80 Max-Z80 force-pushed the aa-storm-feature/email-logic branch from 852ba3e to 4f586c6 Compare February 3, 2025 21:23
@Max-Z80 Max-Z80 force-pushed the aa-storm-feature/email-logic branch from 4f586c6 to 4773e5b Compare February 3, 2025 21:25
@Max-Z80 Max-Z80 force-pushed the aa-storm-feature/email-logic branch 2 times, most recently from 5a9b054 to 5334a29 Compare February 10, 2025 15:19
@Max-Z80 Max-Z80 force-pushed the aa-storm-feature/email-logic branch from 5334a29 to 2a6ec4f Compare February 10, 2025 15:38
@ericboucher ericboucher marked this pull request as ready for review February 20, 2025 10:01
@ericboucher ericboucher changed the title aa storm feature / alert logic AA storm - email alert logic Feb 20, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants