From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C871C1FF179 for ; Wed, 12 Nov 2025 13:25:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CEB331E97; Wed, 12 Nov 2025 13:25:48 +0100 (CET) Mime-Version: 1.0 Date: Wed, 12 Nov 2025 13:25:45 +0100 Message-Id: From: "Lukas Wagner" To: "Proxmox Datacenter Manager development discussion" , "Stefan Hanreich" X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20251112092225.17890-1-s.hanreich@proxmox.com> <20251112092225.17890-6-s.hanreich@proxmox.com> In-Reply-To: <20251112092225.17890-6-s.hanreich@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762950320562 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] tree-wide: handle new unknown enum variants X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Reviewed-by: Lukas Wagner One comment inline. On Wed Nov 12, 2025 at 10:22 AM CET, Stefan Hanreich wrote: > pve-api-types now generates a fallback enum variant in order to handle > encountering unknown values for enums more gracefully. Fix all > occurrences of enums that have changed that lead to compiler errors. > > In the case of migrations an error is thrown, since it is impossible > to tell if it is okay to proceed migrating a guest with an unknown > state. In other cases simply log / print the unknown value. > > Signed-off-by: Stefan Hanreich > --- > server/src/metric_collection/rrd_task.rs | 4 ++++ > ui/src/pve/utils.rs | 1 + > ui/src/widget/migrate_window.rs | 6 ++++++ > 3 files changed, 11 insertions(+) > > diff --git a/server/src/metric_collection/rrd_task.rs b/server/src/metric_collection/rrd_task.rs > index 507d6b2..f48968b 100644 > --- a/server/src/metric_collection/rrd_task.rs > +++ b/server/src/metric_collection/rrd_task.rs > @@ -140,6 +140,10 @@ fn store_metric_pve(cache: &RrdCache, remote_name: &str, data_point: &ClusterMet > ClusterMetricsDataType::Gauge => DataSourceType::Gauge, > ClusterMetricsDataType::Counter => DataSourceType::Counter, > ClusterMetricsDataType::Derive => DataSourceType::Derive, > + ClusterMetricsDataType::UnknownEnumValue(value) => { > + log::warn!("encountered unknown metric type: {value}"); > + return; > + } > }; > At lunch, we briefly talked about whether it would be possible to store datapoints with an unknown data type enum value in some form until PDM is updated and is able to understand the new variant. If we wanted to do this, we would need to store the raw datapoints, since we cannot just dump data with an unknown type into proxmox_rrd. I think just bailing out and logging is fine, since - it's pretty unlikely that there will be a new enum variant here - keeping the raw datapoints around could mean that we have to store large amounts of data for an unknown time period > cache.update_value( > diff --git a/ui/src/pve/utils.rs b/ui/src/pve/utils.rs > index 5923855..ef536da 100644 > --- a/ui/src/pve/utils.rs > +++ b/ui/src/pve/utils.rs > @@ -289,5 +289,6 @@ pub(crate) fn render_content_type(ty: &StorageContent) -> String { > StorageContent::Snippets => tr!("Snippets"), > StorageContent::Vztmpl => tr!("Container template"), > StorageContent::None => tr!("None"), > + StorageContent::UnknownEnumValue(value) => tr!("unknown content type ({0})", value), > } > } _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel