all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry
@ 2025-08-25 13:21 Shan Shaji
  2025-08-26  9:26 ` Michael Köppl
  2025-08-27 11:57 ` [pbs-devel] applied: " Wolfgang Bumiller
  0 siblings, 2 replies; 3+ messages in thread
From: Shan Shaji @ 2025-08-25 13:21 UTC (permalink / raw)
  To: pbs-devel; +Cc: Shan Shaji

Using 'Prune All' gives incomplete task-log output for a
'protected' entry. To fix this, add match expression to
convert `PruneMark` variants into strings.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---

 changes since v1:
 - Removed nested if condition check. 
 - Added match expression to convert the `PruneMark` variants to strings.
 - Updated commit message.

 src/server/prune_job.rs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/server/prune_job.rs b/src/server/prune_job.rs
index 1c86647a..9d07558d 100644
--- a/src/server/prune_job.rs
+++ b/src/server/prune_job.rs
@@ -7,7 +7,7 @@ use pbs_api_types::{
     print_store_and_ns, Authid, KeepOptions, Operation, PruneJobOptions, MAX_NAMESPACE_DEPTH,
     PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE,
 };
-use pbs_datastore::prune::compute_prune_info;
+use pbs_datastore::prune::{compute_prune_info, PruneMark};
 use pbs_datastore::DataStore;
 use proxmox_rest_server::WorkerTask;
 
@@ -72,7 +72,13 @@ pub fn prune_datastore(
                 if dry_run { "would " } else { "" },
                 group.backup_type(),
                 group.backup_id(),
-                info.backup_dir.backup_time_string()
+                info.backup_dir.backup_time_string(),
+                mark = match mark {
+                    PruneMark::Protected => "keep protected",
+                    PruneMark::Keep => "keep",
+                    PruneMark::KeepPartial => "keep partial",
+                    PruneMark::Remove => "remove",
+                }
             );
             if !keep && !dry_run {
                 if let Err(err) = datastore.remove_backup_dir(ns, info.backup_dir.as_ref(), false) {
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry
  2025-08-25 13:21 [pbs-devel] [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry Shan Shaji
@ 2025-08-26  9:26 ` Michael Köppl
  2025-08-27 11:57 ` [pbs-devel] applied: " Wolfgang Bumiller
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Köppl @ 2025-08-26  9:26 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Shan Shaji

Gave this a quick spin by running a dry-run "prune all" with the various
marks set. The logs now make more sense. Good change!

The changes to the code are simple enough. I like the version that
Wolfgang suggested and that you implemented for v2 better.

Overall, lgtm! Please consider this:

Reviewed-by: Michael Köppl <m.koeppl@proxmox.com>
Tested-by: Michael Köppl <m.koeppl@proxmox.com>

On 8/25/25 3:21 PM, Shan Shaji wrote:
> Using 'Prune All' gives incomplete task-log output for a
> 'protected' entry. To fix this, add match expression to
> convert `PruneMark` variants into strings.
> 
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
> 
>  changes since v1:
>  - Removed nested if condition check. 
>  - Added match expression to convert the `PruneMark` variants to strings.
>  - Updated commit message.
> 
>  src/server/prune_job.rs | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/server/prune_job.rs b/src/server/prune_job.rs
> index 1c86647a..9d07558d 100644
> --- a/src/server/prune_job.rs
> +++ b/src/server/prune_job.rs
> @@ -7,7 +7,7 @@ use pbs_api_types::{
>      print_store_and_ns, Authid, KeepOptions, Operation, PruneJobOptions, MAX_NAMESPACE_DEPTH,
>      PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE,
>  };
> -use pbs_datastore::prune::compute_prune_info;
> +use pbs_datastore::prune::{compute_prune_info, PruneMark};
>  use pbs_datastore::DataStore;
>  use proxmox_rest_server::WorkerTask;
>  
> @@ -72,7 +72,13 @@ pub fn prune_datastore(
>                  if dry_run { "would " } else { "" },
>                  group.backup_type(),
>                  group.backup_id(),
> -                info.backup_dir.backup_time_string()
> +                info.backup_dir.backup_time_string(),
> +                mark = match mark {
> +                    PruneMark::Protected => "keep protected",
> +                    PruneMark::Keep => "keep",
> +                    PruneMark::KeepPartial => "keep partial",
> +                    PruneMark::Remove => "remove",
> +                }
>              );
>              if !keep && !dry_run {
>                  if let Err(err) = datastore.remove_backup_dir(ns, info.backup_dir.as_ref(), false) {



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry
  2025-08-25 13:21 [pbs-devel] [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry Shan Shaji
  2025-08-26  9:26 ` Michael Köppl
@ 2025-08-27 11:57 ` Wolfgang Bumiller
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Bumiller @ 2025-08-27 11:57 UTC (permalink / raw)
  To: Shan Shaji; +Cc: pbs-devel

applied, thanks

On Mon, Aug 25, 2025 at 03:21:03PM +0200, Shan Shaji wrote:
> Using 'Prune All' gives incomplete task-log output for a
> 'protected' entry. To fix this, add match expression to
> convert `PruneMark` variants into strings.
> 
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
> 
>  changes since v1:
>  - Removed nested if condition check. 
>  - Added match expression to convert the `PruneMark` variants to strings.
>  - Updated commit message.
> 
>  src/server/prune_job.rs | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/server/prune_job.rs b/src/server/prune_job.rs
> index 1c86647a..9d07558d 100644
> --- a/src/server/prune_job.rs
> +++ b/src/server/prune_job.rs
> @@ -7,7 +7,7 @@ use pbs_api_types::{
>      print_store_and_ns, Authid, KeepOptions, Operation, PruneJobOptions, MAX_NAMESPACE_DEPTH,
>      PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE,
>  };
> -use pbs_datastore::prune::compute_prune_info;
> +use pbs_datastore::prune::{compute_prune_info, PruneMark};
>  use pbs_datastore::DataStore;
>  use proxmox_rest_server::WorkerTask;
>  
> @@ -72,7 +72,13 @@ pub fn prune_datastore(
>                  if dry_run { "would " } else { "" },
>                  group.backup_type(),
>                  group.backup_id(),
> -                info.backup_dir.backup_time_string()
> +                info.backup_dir.backup_time_string(),
> +                mark = match mark {
> +                    PruneMark::Protected => "keep protected",
> +                    PruneMark::Keep => "keep",
> +                    PruneMark::KeepPartial => "keep partial",
> +                    PruneMark::Remove => "remove",
> +                }
>              );
>              if !keep && !dry_run {
>                  if let Err(err) = datastore.remove_backup_dir(ns, info.backup_dir.as_ref(), false) {
> -- 
> 2.47.2


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-27 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-25 13:21 [pbs-devel] [PATCH proxmox-backup v2] fix #6624: ui: improve task log output for protected entry Shan Shaji
2025-08-26  9:26 ` Michael Köppl
2025-08-27 11:57 ` [pbs-devel] applied: " Wolfgang Bumiller

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal