From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 789B51FF0AB for ; Wed, 23 Sep 2026 14:32:50 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 36464214C3; Wed, 23 Sep 2026 14:32:50 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Wed, 23 Sep 2026 14:32:42 +0200 Message-Id: Subject: Re: [PATCH proxmox-perl-rs 24/29] notify: opt into 'legacy-matchers' feature in proxmox-notify From: "Lukas Wagner" To: "Arthur Bied-Charreton" , "Lukas Wagner" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260709115716.299836-1-l.wagner@proxmox.com> <20260709115716.299836-25-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1790166762936 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.459 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_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: XJK4TPVVM4BQKAFPU2MPCL7OFI3P4WOG X-Message-ID-Hash: XJK4TPVVM4BQKAFPU2MPCL7OFI3P4WOG X-MailFrom: l.wagner@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 Fri Jul 24, 2026 at 8:48 AM CEST, Arthur Bied-Charreton wrote: > On Thu, Jul 09, 2026 at 01:57:11PM +0200, Lukas Wagner wrote: >> This allows us to continue to support the older 'match-*', 'mode' and >> 'invert-match' configuration keys in notifications.cfg. >>=20 >> Signed-off-by: Lukas Wagner >> --- >> pve-rs/Cargo.toml | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/pve-rs/Cargo.toml b/pve-rs/Cargo.toml >> index 5ae9082..ab95f29 100644 >> --- a/pve-rs/Cargo.toml >> +++ b/pve-rs/Cargo.toml >> @@ -39,7 +39,7 @@ proxmox-http =3D { version =3D "1.0.2", features =3D [= "client-sync", "client-trait"] } >> proxmox-http-error =3D "1" >> proxmox-log =3D "1" >> proxmox-network-types =3D "1.1.2" >> -proxmox-notify =3D { version =3D "1", features =3D ["pve-context"] } >> +proxmox-notify =3D { version =3D "1", features =3D ["pve-context", "leg= acy-matchers"] } > afaict this should also be added to pmg-rs. it currently does not > compile otherwise.=20 Good catch! This is a bit weird, since PMG currently does not use proxmox-notify at all. If we ever add the notification stack to PMG (not planned for the near future, but maybe some day), we'd likely not want to pull in the legacy-matchers feature at all. For now, I've solved this by adding a 'notify-legacy-matchers' feature in pmg-rs and pve-rs, which is only enabled by default in pve-rs. Unfortunately, in perlmod modules it does not seem to be possible to use feature gates on functions, so I had to adapt get_matcher as follows: #[export(serialize_error)] pub fn get_matcher( #[try_from_ref] this: &NotificationConfig, id: &str, #[allow(unused)] migrate_to_expression: Option, ) -> Result { let config =3D this.config.lock().unwrap(); #[cfg(feature =3D "notify-legacy-matchers")] if migrate_to_expression.unwrap_or_default() { return api::matcher::get_matcher_as_expression(&config, id); } api::matcher::get_matcher(&config, id) } Maybe not the cleanest option, since pmg could then pass a parameter that is completely ignored, but i'm not sure if I can think of a better solution at the moment (besides moving the notify module into pve-rs, but that'd require changing all users to use PVE::RS::Notify instead of Proxmox::RS::Notify).