Skip to content

Add --clean-workdir option to verdi group delete #7299

@Khushi281300

Description

@Khushi281300

Description
In AiiDA v2.6+ (after PR #6756), verdi node delete includes a --clean-workdir option to clean remote working directories before deleting nodes.

The same functionality is currently missing from verdi group delete --delete-nodes.

Current behavior
When deleting a group with --delete-nodes, the nodes are removed from the database, but their associated remote working directories are not cleaned up. This can leave behind unused data on the remote system.

Expected behavior
It would be useful if verdi group delete supported a --clean-workdir flag, similar to verdi node delete, so that remote directories can be cleaned as part of the deletion process.

Implementation idea

group_delete in
src/aiida/cmdline/commands/cmd_group.py
doesn’t include the clean_mapping_remote_paths logic that exists in cmd_node.py

Approach I thought of:

Collect relevant CalcJobNode instances (optionally including descendants if needed)
Call aiida.orm.utils.remote.clean_mapping_remote_paths before deleting nodes

This would bring consistency between node-level and group-level deletion and help avoid leftover remote data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions