From dfcbef269d8190e42500f2b613f233eb30e5318b Mon Sep 17 00:00:00 2001 From: Damon Date: Thu, 22 Jan 2026 15:46:21 +0100 Subject: [PATCH 1/2] OP-3720: added error-alert and deliver-email-service to send mails when errors occur in dump jobs --- CHANGELOG.md | 14 ++++++ config/delta/rules.js | 21 +++++++++ config/error-alert/config.json | 8 ++++ .../20260122120000-add-mail-folders.sparql | 44 +++++++++++++++++++ docker-compose.dev.yml | 11 +++++ docker-compose.yml | 22 ++++++++++ 6 files changed, 120 insertions(+) create mode 100644 config/error-alert/config.json create mode 100644 config/migrations/2026/20260122120000-add-mail-folders.sparql diff --git a/CHANGELOG.md b/CHANGELOG.md index ed379e3..75531fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,18 @@ # Changelog +## unreleased +### General +- [OP-3720]: Delta background job having errors/getting stuck, send an email + +### Deploy instructions +#### For error-alert and deliver-email-service +Per environment a specfic configuration for the email service + +#### Deploy instructions +``` +drc restart migrations deltanotifier +drc up -d error-alert deliver-email-service +``` + ## 1.38.0 (2026-01-08) ### General - [OP-3590]: OP is now master of "aantal houders" of mandates diff --git a/config/delta/rules.js b/config/delta/rules.js index 966c2ba..33289e8 100644 --- a/config/delta/rules.js +++ b/config/delta/rules.js @@ -178,6 +178,27 @@ export default [ ignoreFromSelf: true, optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] } + }, + { + match: { + predicate: { + type: 'uri', + value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' + }, + object: { + type: 'uri', + value:'http://open-services.net/ns/core#Error' + } + }, + callback: { + url: 'http://error-alert/delta', + method:'POST' + }, + options: { + resourceFormat: 'v0.0.1', + gracePeriod: 1000, + ignoreFromSelf: true + } } /* Commenting ldes rules until ready to go to qa/prod. In the meantime, we override the configuration on dev. diff --git a/config/error-alert/config.json b/config/error-alert/config.json new file mode 100644 index 0000000..3675795 --- /dev/null +++ b/config/error-alert/config.json @@ -0,0 +1,8 @@ +{ + "creators": [ + "http://lblod.data.gift/services/delta-producer-background-jobs-initiator/organizations", + "http://lblod.data.gift/services/delta-producer-background-jobs-initiator/public", + "http://lblod.data.gift/services/delta-producer-background-jobs-initiator/organizations-public-info", + "http://lblod.data.gift/services/delta-producer-background-jobs-initiator/worship-posts" + ] +} diff --git a/config/migrations/2026/20260122120000-add-mail-folders.sparql b/config/migrations/2026/20260122120000-add-mail-folders.sparql new file mode 100644 index 0000000..0a16764 --- /dev/null +++ b/config/migrations/2026/20260122120000-add-mail-folders.sparql @@ -0,0 +1,44 @@ +INSERT DATA { + GRAPH { + a ; + "cf9cb7e4-9a00-4855-9ee0-e8e3bbeba9e9"; + ; + ; + ; + ; + ; + . + + a ; + "891c67e5-4719-47f8-aec2-d898ba2c09e8"; + "inbox"; + "Your incoming mail goes here.". + + a ; + "786a8cb0-4452-40f5-b8d8-046dd2d63281"; + "outbox"; + "Your outgoing mail goes here.". + + a ; + "a6fb03f9-11be-4401-9d8f-b4dc0e9df5ee"; + "sentbox"; + "Your sent mail goes here.". + + + a ; + "a430a848-e595-49fa-bc11-f5579605877f"; + "sending"; + "Your mail goes here while being sent.". + + a ; + "0cb108a9-1c0d-4c0a-bf53-60e304116e47"; + "drafts"; + "Your draft goes here.". + + a ; + "70c0baba-17a0-11eb-adc1-0242ac120002"; + "failbox"; + "Your email that failed while sending goes here.". + + } +} \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 3231ca2..126092a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -95,6 +95,17 @@ services: BASE_URL: "http://localhost/ldes/" kbo-data-sync: restart: "no" + error-alert: + environment: + EMAIL_FROM: 'test@domain.net' + EMAIL_TO: '123@domain.com' + restart: "no" + deliver-email-service: + environment: + EMAIL_CRON_PATTERN: "*/5 * * * *" + WELL_KNOWN_SERVICE: "test" + FROM_NAME: "Your Name" + restart: "no" # use this to test acmidm # tlsproxy: # image: caddy:2 diff --git a/docker-compose.yml b/docker-compose.yml index 5deb77c..8a8ee05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -626,6 +626,28 @@ services: restart: always logging: *default-logging + error-alert: + image: lblod/loket-error-alert-service:1.0.0 + volumes: + - ./config/error-alert:/config/ + links: + - db:database + labels: + - "logging=true" + restart: always + logging: *default-logging + + deliver-email-service: + image: redpencil/deliver-email-service:1.0.0 + environment: + MAILBOX_URI: "http://data.lblod.info/id/mailboxes/1" + links: + - db:database + labels: + - "logging=true" + restart: always + logging: *default-logging + roles: image: lblod/select-role-service:0.1.0 labels: From ada6e3c781038e4925e5217721bf05f460ee3592 Mon Sep 17 00:00:00 2001 From: Damon Date: Thu, 22 Jan 2026 16:21:20 +0100 Subject: [PATCH 2/2] edit changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75531fc..b20bca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ### Deploy instructions #### For error-alert and deliver-email-service -Per environment a specfic configuration for the email service +Per environment a specfic configuration for the email service similar to loket config. +Ask colleague for specfic credentials. #### Deploy instructions ```