Skip to content

Conversation

@DavidePrincipi
Copy link
Member

@DavidePrincipi DavidePrincipi commented Feb 3, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Backup/Restore UX by adding cleanup behavior on termination, introducing an action to import backup destinations from a cluster backup payload, and enriching defaults returned to the UI.

Changes:

  • Add SIGTERM-triggered cleanup tasks support to agent task runner and use it to auto-remove half-restored modules.
  • Introduce import-backup-destinations action plus JSON schemas for validating its input/output.
  • Extend get-defaults output with has_additional_disks and reuse shared helpers for hostname/volumes.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
core/imageroot/var/lib/nethserver/cluster/actions/restore-module/50restore_module Registers a SIGTERM cleanup task for restore-module and changes failure exit behavior.
core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/10import_backup_destinations New Python action to decrypt/decompress backup payload and import destinations into Redis.
core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-input.json Adds input JSON schema for the new import action.
core/imageroot/var/lib/nethserver/cluster/actions/import-backup-destinations/validate-output.json Adds output JSON schema for the new import action.
core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/50read Computes has_additional_disks and uses shared hostname helper.
core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-input.json Changes input schema for get-defaults.
core/imageroot/var/lib/nethserver/cluster/actions/get-defaults/validate-output.json Adds has_additional_disks to get-defaults output schema.
core/imageroot/usr/local/agent/pypkg/agent/tasks/run.py Adds on_sigterm_tasks support and refactors progress/extra handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

github-actions bot pushed a commit that referenced this pull request Feb 3, 2026
github-actions bot pushed a commit that referenced this pull request Feb 3, 2026
Return a new boolean attribute "has_additional_disks" describing the NS8
node storage. This boolean guides the user through the correct cluster
disaster recovery procedure path. If an additional disk exists, the
procedure must direct the user to the Backup page.
If restore-module action is canceled by user, run a cleanup task that
removes the restored instance from the cluster.

Introduce on_sigterm_tasks optional array for agent.tasks.run/runp: it
registers additional tasks that are submitted in nowait mode when the
process receives SIGTERM, without overriding the internal cancel-task
behavior.

Sanitize kwargs variable in _runp(), pop()ing unexpected arguments to
sub-functions.
Import backup destinations from a cluster backup encrypted file.

This new action expects a file generated by download-cluster-backup as
input and the password to decrypt it.

During import, existing backup destinations are skipped. Configurations
are not validated, they are assumed to be correct. For this reason,
interal cluster destinations are ignored if the cluster backup was
generated by another cluster (cluster UUIDs are compared for this
purpose).
@DavidePrincipi DavidePrincipi force-pushed the feat-7810 branch 2 times, most recently from bcb9f35 to ae4bedc Compare February 3, 2026 15:43
github-actions bot pushed a commit that referenced this pull request Feb 3, 2026
@DavidePrincipi DavidePrincipi marked this pull request as ready for review February 3, 2026 16:02
@DavidePrincipi DavidePrincipi self-assigned this Feb 3, 2026
@stephdl stephdl self-requested a review February 3, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants