From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH/RFC datacenter-manager 0/8] add type field to RemoteUpid
Date: Tue, 11 Nov 2025 11:50:51 +0100 [thread overview]
Message-ID: <20251111105059.148997-1-l.wagner@proxmox.com> (raw)
In quite a few places in the code where we handle RemoteUpids, we need
to know the actual type of the remote, for instance to
- build correct API paths from it, if the UPID is passed to a
product-specific API endpoint (e.g. see [1])
- get fields from the actual UPID, which requires parsing the native
UPID type - if the type is unknown here, we have to either guess
(attempt to parse one type, and if it does not work, try the other
type), or get the type from somewhere else (some other parameter, or
from remotes.cfg) (e.g. see [2])
These can be easily solved by storing the type of the remote in the
RemoteUpid. The serialized representation is changed in such a way that
the type is prepended to the original represenation, e.g.
pve:remote-name!<original UPID>
This change aims to avoid breakage by being backward-compatible with the old
representation without the type field. In this case the type is simply inferred
by parsing the UPID. This adds some runtime cost, but this is only really
relevant for migrating the contents of the remote task cache over to the new
format. Once it has been migrated (which happens automatically when rewriting
the archive files, or if that does not happen, they are simply rotated out
after a while), the inefficient code path is not really needed any more (once
all the call sites producing a remote UPID have been adapted to use the new
constructor, not part of this series yet).
The following commits are a bit of cleanup/best-practices and can be
applied unconditionally:
pdm-api-types: move RemoteUpid to its own module
pdm-api-types: remote upid: make upid field private
pdm-api-types: remote upid: add missing doc strings
pdm-api-types: remote upid: add basic tests for RemoteUpid ser/deserialization
These commits then actually change the RemoteUpid type so that includes
a type:
pdm-api-types: remote upid: add type field to RemoteUpid
pdm-api-types: remote upid: allow to get native UPID type
The last commits show how the existing code can make use of
the changes:
[1]: ui: remote tasks: use correct base url for PBS tasks
[2]: remote task cache: handle PBS tasks correctly
proxmox-datacenter-manager:
Lukas Wagner (8):
pdm-api-types: move RemoteUpid to its own module
pdm-api-types: remote upid: make upid field private
pdm-api-types: remote upid: add missing doc strings
pdm-api-types: remote upid: add basic tests for RemoteUpid
ser/deserialization
pdm-api-types: remote upid: add type field to RemoteUpid
pdm-api-types: remote upid: allow to get native UPID type
ui: remote tasks: use correct base url for PBS tasks
remote task cache: handle PBS tasks correctly
lib/pdm-api-types/Cargo.toml | 1 +
lib/pdm-api-types/src/lib.rs | 91 +--------
lib/pdm-api-types/src/remote_upid.rs | 265 ++++++++++++++++++++++++++
lib/pdm-api-types/src/remotes.rs | 4 +-
server/src/api/pve/tasks.rs | 18 +-
server/src/remote_tasks/mod.rs | 21 +-
server/src/remote_tasks/task_cache.rs | 19 +-
server/src/sdn_client.rs | 2 +-
ui/src/remotes/tasks.rs | 7 +-
ui/src/tasks.rs | 4 +-
10 files changed, 318 insertions(+), 114 deletions(-)
create mode 100644 lib/pdm-api-types/src/remote_upid.rs
Summary over all repositories:
10 files changed, 318 insertions(+), 114 deletions(-)
--
Generated by murpp 0.9.0
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next reply other threads:[~2025-11-11 10:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 10:50 Lukas Wagner [this message]
2025-11-11 10:50 ` [pdm-devel] [PATCH datacenter-manager 1/8] pdm-api-types: move RemoteUpid to its own module Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [PATCH datacenter-manager 2/8] pdm-api-types: remote upid: make upid field private Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [PATCH datacenter-manager 3/8] pdm-api-types: remote upid: add missing doc strings Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [PATCH datacenter-manager 4/8] pdm-api-types: remote upid: add basic tests for RemoteUpid ser/deserialization Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [RFC datacenter-manager 5/8] pdm-api-types: remote upid: add type field to RemoteUpid Lukas Wagner
2025-11-12 20:00 ` Thomas Lamprecht
2025-11-11 10:50 ` [pdm-devel] [RFC datacenter-manager 6/8] pdm-api-types: remote upid: allow to get native UPID type Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [RFC datacenter-manager 7/8] ui: remote tasks: use correct base url for PBS tasks Lukas Wagner
2025-11-11 10:50 ` [pdm-devel] [RFC datacenter-manager 8/8] remote task cache: handle PBS tasks correctly Lukas Wagner
2025-11-12 15:50 ` [pdm-devel] [PATCH/RFC datacenter-manager 0/8] add type field to RemoteUpid Shannon Sterz
2025-11-12 20:27 ` [pdm-devel] applied-series: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251111105059.148997-1-l.wagner@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.