From 0ced2f8a4856e5b5a80a13d0d669aa04e6452e12 Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Mon, 12 Jan 2026 15:53:35 +0100 Subject: [PATCH] Auto-commit local changes before build (2026-01-12 15:53:35) --- .last-branch | 2 +- .../src/backend/app/parsers/synology.py | 30 ++++++++++++++++--- docs/changelog.md | 10 +++++++ 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.last-branch b/.last-branch index 9a04698..fcc76fd 100644 --- a/.last-branch +++ b/.last-branch @@ -1 +1 @@ -v20260112-16-runchecks-popup-objects-no-overlap +v20260112-17-synology-abb-warning-recognize-objects diff --git a/containers/backupchecks/src/backend/app/parsers/synology.py b/containers/backupchecks/src/backend/app/parsers/synology.py index f2d7ff4..8968e26 100644 --- a/containers/backupchecks/src/backend/app/parsers/synology.py +++ b/containers/backupchecks/src/backend/app/parsers/synology.py @@ -193,11 +193,13 @@ _ABB_FAILED_RE = re.compile( # Device list lines in body, e.g. # "Apparaatlijst (back-up gelukt): DC01, SQL01" +# "Lijst met apparaten (back-up gelukt): DC01, SQL01" # "Apparaatlijst (back-up mislukt): FS01" # "Device list (backup succeeded): DC01, SQL01" +# "List of devices (backup succeeded): DC01, SQL01" # "Device list (backup failed): FS01" _ABB_DEVICE_LIST_RE = re.compile( - r"^\s*(?:Apparaatlijst|Device\s+list)\s*(?:\((?P[^)]+)\))?\s*:\s*(?P.+?)\s*$", + r"^\s*(?:Apparaatlijst|Lijst\s+met\s+apparaten|Device\s+list|List\s+of\s+devices)\s*(?:\((?P[^)]+)\))?\s*:\s*(?P.*?)\s*$", re.I, ) @@ -236,7 +238,11 @@ def _parse_active_backup_for_business(subject: str, text: str) -> Tuple[bool, Di overall_status = "Error" overall_message = "Failed" - objects: List[Dict] = [] + # Collect device/object statuses while avoiding duplicates. + # Prefer the most severe status when a device appears multiple times. + severity = {"Error": 3, "Failed": 3, "Warning": 2, "Success": 1} + device_status: Dict[str, str] = {} + for line in (text or "").splitlines(): mm = _ABB_DEVICE_LIST_RE.match(line.strip()) if not mm: @@ -245,15 +251,31 @@ def _parse_active_backup_for_business(subject: str, text: str) -> Tuple[bool, Di kind = (mm.group("kind") or "").lower() line_status = overall_status + kind_is_specific = False if "gelukt" in kind or "succeeded" in kind or "success" in kind: line_status = "Success" + kind_is_specific = True elif "mislukt" in kind or "failed" in kind or "error" in kind: line_status = "Error" + kind_is_specific = True # "DC01, SQL01" for name in [p.strip() for p in raw_list.split(",")]: - if name: - objects.append({"name": name, "status": line_status}) + if not name: + continue + prev = device_status.get(name) + if prev is None: + device_status[name] = line_status + continue + + # Do not override specific succeeded/failed lists with a generic "device list". + if not kind_is_specific: + continue + + if severity.get(line_status, 0) > severity.get(prev, 0): + device_status[name] = line_status + + objects: List[Dict] = [{"name": n, "status": s} for n, s in device_status.items()] result = { "backup_software": "Synology", diff --git a/docs/changelog.md b/docs/changelog.md index fde288b..9afea2d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -236,6 +236,16 @@ - Fixed layout issue in the Run Checks popup where the Objects table could overlap the mail content. - Adjusted container sizing and overflow handling to ensure the Objects table stays within its designated area. - Ensured the mail content and Objects table are visually separated and cannot overlap regardless of content length. + +--- + +## v20260112-17-synology-abb-warning-recognize-objects + +- Extended the Synology Active Backup for Business parser to correctly detect objects listed in warning / partially completed emails. +- Improved object extraction logic to recognize devices mentioned in generic device lists (e.g. “List of devices …”), ensuring DC01 and SQL01 are included as objects. +- Ensured that when a device appears in both generic and specific status sections, the more specific status (failed / warning / success) takes precedence. + + ================================================================================================================================================ ## v0.1.19 This release delivers a broad set of improvements focused on reliability, transparency, and operational control across mail processing, administrative auditing, and Run Checks workflows. The changes aim to make message handling more robust, provide better insight for administrators, and give operators clearer and more flexible control when reviewing backup runs.