Skip to content

feat(cli): add support for deleting multiple resources in ado delete#885

Merged
AlessandroPomponio merged 1 commit into
mainfrom
ap_776_ado_delete_multiple_resources
Apr 23, 2026
Merged

feat(cli): add support for deleting multiple resources in ado delete#885
AlessandroPomponio merged 1 commit into
mainfrom
ap_776_ado_delete_multiple_resources

Conversation

@AlessandroPomponio
Copy link
Copy Markdown
Member

Summary

This pull request adds support for deleting multiple resources in a single command to the ado delete CLI. Previously, users could only delete one resource at a time. Now they can specify multiple resource IDs as arguments (e.g., ado delete operation op-1 op-2 op-3), with comprehensive reporting of successes and failures.

Closes #776

Files Changed

📄 orchestrator/cli/commands/delete.py

Added batch deletion support with a new _report_deletion_results() function that provides detailed feedback. Changed resource_id parameter to resource_ids (list), implemented loop to process each resource individually, and added comprehensive error handling with summary reporting. Removed direct exception handler imports in favor of inline error handling.

📄 orchestrator/cli/models/parameters.py

Updated AdoDeleteCommandParameters model to change resource_id field from str to resource_ids: list[str] to support multiple resource IDs.

📄 orchestrator/cli/resources/actuator_configuration/delete.py

Updated to extract the single resource_id from the resource_ids list (maintaining backward compatibility with the new list-based parameter structure). All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 orchestrator/cli/resources/context/delete.py

Updated to extract the single resource_id from the resource_ids list. All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 orchestrator/cli/resources/data_container/delete.py

Updated to extract the single resource_id from the resource_ids list. All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 orchestrator/cli/resources/discovery_space/delete.py

Updated to extract the single resource_id from the resource_ids list. All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 orchestrator/cli/resources/operation/delete.py

Updated to extract the single resource_id from the resource_ids list. All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 orchestrator/cli/resources/sample_store/delete.py

Updated to extract the single resource_id from the resource_ids list. All references to parameters.resource_id changed to use the extracted resource_id variable.

📄 tests/ado/delete/test_ado_delete_actuator_configuration.py

Updated test assertions to match new error message format that reports "Failed to delete" and "Resource does not exist" instead of the old detailed ERROR message.

📄 tests/ado/delete/test_ado_delete_multiple.py

New test file with comprehensive test coverage for multiple deletion scenarios: successful deletion of multiple operations, partial failures (mix of valid/invalid IDs), backward compatibility with single deletion, and complete failure scenarios.

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
@AlessandroPomponio AlessandroPomponio force-pushed the ap_776_ado_delete_multiple_resources branch from 4964535 to 4ffa7ca Compare April 22, 2026 07:53
@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 23, 2026
@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 7f00b7a Apr 23, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the ap_776_ado_delete_multiple_resources branch April 23, 2026 12:51
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.

feat: enable ado delete to delete multiple resource

2 participants