feat(cli): add support for deleting multiple resources in ado delete#885
Merged
Merged
Conversation
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
4964535 to
4ffa7ca
Compare
michael-johnston
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds support for deleting multiple resources in a single command to the
ado deleteCLI. 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.pyAdded batch deletion support with a new
_report_deletion_results()function that provides detailed feedback. Changedresource_idparameter toresource_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.pyUpdated
AdoDeleteCommandParametersmodel to changeresource_idfield fromstrtoresource_ids: list[str]to support multiple resource IDs.📄
orchestrator/cli/resources/actuator_configuration/delete.pyUpdated to extract the single resource_id from the
resource_idslist (maintaining backward compatibility with the new list-based parameter structure). All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
orchestrator/cli/resources/context/delete.pyUpdated to extract the single resource_id from the
resource_idslist. All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
orchestrator/cli/resources/data_container/delete.pyUpdated to extract the single resource_id from the
resource_idslist. All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
orchestrator/cli/resources/discovery_space/delete.pyUpdated to extract the single resource_id from the
resource_idslist. All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
orchestrator/cli/resources/operation/delete.pyUpdated to extract the single resource_id from the
resource_idslist. All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
orchestrator/cli/resources/sample_store/delete.pyUpdated to extract the single resource_id from the
resource_idslist. All references toparameters.resource_idchanged to use the extractedresource_idvariable.📄
tests/ado/delete/test_ado_delete_actuator_configuration.pyUpdated 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.pyNew 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.