-
Notifications
You must be signed in to change notification settings - Fork 846
feat(inspect): project deletion #3192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inspect): project deletion #3192
Conversation
Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
There was a problem hiding this 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 adds a new endpoint for deleting projects, including both database records and binary files. The implementation uses a two-phase approach: first deleting all related database records in a single transaction, then performing best-effort cleanup of filesystem resources.
Key changes:
- New
DELETE /projects/<project_id>endpoint with validation to prevent deletion of projects with active pipelines or running jobs - Two-phase deletion strategy in
ProjectService.delete_projectthat ensures database consistency before filesystem cleanup - New service methods across multiple services to support bulk deletion of project-related resources
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| application/backend/src/api/endpoints/project_endpoints.py | Adds DELETE endpoint with active pipeline and running jobs validation |
| application/backend/src/services/project_service.py | Implements two-phase project deletion coordinating across multiple services |
| application/backend/src/services/pipeline_service.py | Adds method to delete all pipelines for a project |
| application/backend/src/services/model_service.py | Adds methods for bulk model deletion and filesystem cleanup |
| application/backend/src/services/media_service.py | Adds methods for bulk media deletion and filesystem cleanup |
| application/backend/src/services/job_service.py | Adds methods for bulk job deletion and checking running jobs |
| application/backend/src/services/dataset_snapshot_service.py | Adds methods for bulk snapshot deletion and filesystem cleanup |
| application/backend/src/services/configuration_service.py | Adds methods for bulk source and sink deletion |
| application/backend/src/repositories/base.py | Adds delete_all method supporting transactional bulk deletion |
| application/backend/src/repositories/binary_repo.py | Adds ModelExportBinaryRepository class and delete_project_folder method |
| application/backend/tests/unit/endpoints/test_projects.py | Adds comprehensive tests for the delete endpoint scenarios |
| application/backend/tests/unit/services/test_project_service.py | Updates tests for the new two-phase deletion logic |
| application/backend/tests/unit/services/test_model_service_export.py | Updates export tests to use new ModelExportBinaryRepository |
| application/backend/src/services/init.py | Exports DatasetSnapshotService for use in project deletion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """ | ||
| Get the folder path for model exports. | ||
| :return: Folder path for model exports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment but we use Google style formatting in Anomalib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we still have a few places with this format. I'll create another PR to address all of them
7e22d70
into
open-edge-platform:feature/geti-inspect
📝 Description
Adds new endpoint for project deletion (db and binary files):
DELETE /projects/<project_id>A project cannot be deleted in the following scenarios:
404: project not found409:✨ Changes
Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.