From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 416CC1FF0EC for ; Fri, 24 Jul 2026 08:59:42 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 01AAB21495; Fri, 24 Jul 2026 08:59:42 +0200 (CEST) Date: Fri, 24 Jul 2026 08:59:36 +0200 From: Arthur Bied-Charreton To: Lukas Wagner Subject: Re: [PATCH proxmox 11/29] notify: matcher: add expression support Message-ID: References: <20260709115716.299836-1-l.wagner@proxmox.com> <20260709115716.299836-12-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260709115716.299836-12-l.wagner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784876347305 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.950 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: E5JGN634GCLXVZZJNZSQIKTDL5554ZK5 X-Message-ID-Hash: E5JGN634GCLXVZZJNZSQIKTDL5554ZK5 X-MailFrom: a.bied-charreton@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pbs-devel@lists.proxmox.com, pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Jul 09, 2026 at 01:56:58PM +0200, Lukas Wagner wrote: > This commit adds support for the new 'expression' parameter in the > matcher configuration. It contains a JSON-serialized match expression > (based on the new proxmox-match-expression crate). It is intended as a > replacement for the existing match-field, match-calendar, > match-severity, mode and invert-match keys. > > The match expression implements a strict superset of the existing > configuration keys, any existing configuration can be converted into > an expression. > > Expressions lift some of limitations of the old approach, namely they > allow arbitrary nesting of match rules and combinators. > > The following expressions are supported > - all-of (corresponds to the former mode 'all') > - any-of (corresponds to the former mode 'any') > - one-of (new) > - not (corresponds to former 'invert-match') > - match-calendar (unchanged) > - match-field (unchanged) > - match-severity (unchanged) > > The combinators all-of, any-of and one-of support an arbitrary number of > child expressions (where each child can be a combinator, not, or a > match-* expression). > > Internally, existing, 'old-style' matchers are converted on the fly to > expressions, meaning there is only a single code path for the matching > logic. If any matcher has any of the old configuration keys and the new > expression set, the old keys will be ignored and a warning will be > logged. > > Signed-off-by: Lukas Wagner one general thing i noticed while testing: it would be really useful to know which matchers matched a notification. right now the only log message you get is "notified via target {target}". such a change might be a better fit in the notification history you have planned though. another idea (bit more involved ^^): being able to construct test notifications in the UI and showing a list of matching matchers. (not particularly relevant to this specific patch, just thought about this while reading it) > --- > Cargo.toml | 1 + > proxmox-notify/Cargo.toml | 2 + > proxmox-notify/src/matcher/expression.rs | 84 ++++++++++++++ > proxmox-notify/src/matcher/field.rs | 31 +++-- > proxmox-notify/src/matcher/mod.rs | 142 +++++++++++++---------- > proxmox-notify/src/matcher/severity.rs | 6 +- > 6 files changed, 185 insertions(+), 81 deletions(-) > create mode 100644 proxmox-notify/src/matcher/expression.rs > [...]