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 312911FF0AF for ; Thu, 24 Sep 2026 10:30:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9D8D821637; Thu, 24 Sep 2026 10:30:25 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 24 Sep 2026 10:30:20 +0200 Message-Id: Subject: Re: [PATCH proxmox-perl-rs 24/29] notify: opt into 'legacy-matchers' feature in proxmox-notify From: "Lukas Wagner" To: "Lukas Wagner" , "Arthur Bied-Charreton" 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: 1790238620565 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.456 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: ZGT3C7IJDDUGDOUPFW4YT2QSTILOFLPJ X-Message-ID-Hash: ZGT3C7IJDDUGDOUPFW4YT2QSTILOFLPJ 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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed Sep 23, 2026 at 2:32 PM CEST, Lukas Wagner wrote: >>> +proxmox-notify =3D { version =3D "1", features =3D ["pve-context", "le= gacy-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). Discussed this issue with Wolfgang, we came to the conclusion that it's actually better to move the binding code to PVE::RS::Notify, there are only two call sites that need to be adapted anyway.