Skip to content

Enhance the model structure for list deletion#2326

Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main
Feb 23, 2026
Merged

Enhance the model structure for list deletion#2326
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

This PR changes the output model for deleting multiple resources from string to structured output

Copilot AI review requested due to automatic review settings February 23, 2026 14:25
Copy link
Copy Markdown
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 enhances the deletion model structure by changing bulk resource deletion responses from simple string arrays (model.IdList) to structured output (model.ResourceDeleteResults). The new model provides detailed per-resource success/failure information with error messages, making it easier for API consumers to understand which resources were successfully deleted and why others failed.

Changes:

  • Introduced new structured models: ResourceDeleteResult and ResourceDeleteResults with success/failure tracking and error messages
  • Updated bulk deletion APIs for securityGroup, sshKey, vNet, dataDisk, image, customImage, and sharedResources to return structured results
  • Re-enabled dependency checking to prevent deletion of resources still referenced by other objects
  • Added Spider response validation and post-deletion verification for improved reliability

Reviewed changes

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

Show a summary per file
File Description
src/core/model/common.go Added ResourceDeleteResult, ResourceDeleteResults, and SpiderBooleanInfo struct definitions
src/core/resource/common.go Updated DelAllResources and DelResource to use new models; added dependency checking and Spider verification
src/interface/rest/server/resource/common.go Simplified RestDelAllResources to return structured results directly, removed wrapper
src/interface/rest/server/resource/vnet.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/server/resource/sshkey.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/server/resource/securitygroup.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/server/resource/image.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/server/resource/dataDisk.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/server/resource/customimage.go Updated Swagger annotation to reference ResourceDeleteResults
src/interface/rest/docs/swagger.yaml Added OpenAPI schema definitions for new model structures
src/interface/rest/docs/docs.go Generated documentation reflecting new model structures

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

Signed-off-by: Seokho Son <shsongist@gmail.com>
@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Feb 23, 2026
@cb-github-robot cb-github-robot merged commit ff7a386 into cloud-barista:main Feb 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants