From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH v2 proxmox-backup 0/5] introduce dedcated archive name api type
Date: Wed, 10 Jul 2024 09:48:51 +0200 [thread overview]
Message-ID: <20240710074856.27706-1-c.ebner@proxmox.com> (raw)
There is currently no dedicated api type for the archive names, given
as input parameters to several methods.
This patches introduce a dedicated type for archive names, in order
to collect the code for checks and eventual mappings into one
location and reduce possible unintentional misuse by passing
incorrect argument values to the functions and methods consuming
the archive names.
As a positive side effect, the mapping now allows also for the server
archive type extensions to be optionally passed as input to several
commands, e.g.
```
proxmox-backup-client restore <snapshot> <name>.pxar.didx <target>
```
is now valid, being equal to
```
proxmox-backup-client restore <snapshot> <name.pxar <target>
```
Note that this patch series currently depends on this patch being
applied beforehand:
https://lists.proxmox.com/pipermail/pbs-devel/2024-July/010059.html
Changes since version 1 (thanks @Gabriel):
- Rebased onto current master
- Added unit tests for archive name parsing
- Added missing check for invalid archive names ending with '/'
- Inlined variable names for format strings
- Import implemented traits at top
Christian Ebner (5):
datastore: move `ArchiveType` to PBS api types crate
api types: introduce `BackupArchiveName` type
client/server: use dedicated api type for all archive names
client: drop unused parse_archive_type helper
api types: add unit tests for backup archive name parsing
pbs-api-types/src/datastore.rs | 189 ++++++++++++++++++++++++++-
pbs-client/src/backup_reader.rs | 14 +-
pbs-client/src/backup_writer.rs | 24 ++--
pbs-client/src/tools/mod.rs | 24 ++--
pbs-datastore/src/datastore.rs | 6 +-
pbs-datastore/src/manifest.rs | 50 +++----
pbs-datastore/src/snapshot_reader.rs | 4 +-
proxmox-backup-client/src/catalog.rs | 25 ++--
proxmox-backup-client/src/helper.rs | 7 +-
proxmox-backup-client/src/main.rs | 128 +++++++++---------
proxmox-backup-client/src/mount.rs | 33 ++---
proxmox-file-restore/src/main.rs | 20 ++-
src/api2/admin/datastore.rs | 60 ++++-----
src/api2/backup/mod.rs | 3 +-
src/api2/reader/mod.rs | 7 +-
src/api2/tape/restore.rs | 10 +-
src/backup/verify.rs | 7 +-
src/bin/proxmox_backup_debug/diff.rs | 16 +--
src/server/pull.rs | 20 +--
19 files changed, 418 insertions(+), 229 deletions(-)
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next reply other threads:[~2024-07-10 7:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 7:48 Christian Ebner [this message]
2024-07-10 7:48 ` [pbs-devel] [PATCH v2 proxmox-backup 1/5] datastore: move `ArchiveType` to PBS api types crate Christian Ebner
2024-07-10 7:48 ` [pbs-devel] [PATCH v2 proxmox-backup 2/5] api types: introduce `BackupArchiveName` type Christian Ebner
2024-07-10 7:48 ` [pbs-devel] [PATCH v2 proxmox-backup 3/5] client/server: use dedicated api type for all archive names Christian Ebner
2024-07-10 7:48 ` [pbs-devel] [PATCH v2 proxmox-backup 4/5] client: drop unused parse_archive_type helper Christian Ebner
2024-07-10 7:48 ` [pbs-devel] [PATCH v2 proxmox-backup 5/5] api types: add unit tests for backup archive name parsing Christian Ebner
2024-07-10 9:17 ` [pbs-devel] [PATCH v2 proxmox-backup 0/5] introduce dedcated archive name api type Gabriel Goller
2024-10-24 8:03 ` Christian Ebner
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=20240710074856.27706-1-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox