Skip to content

Conversation

@maxxgx
Copy link
Contributor

@maxxgx maxxgx commented Dec 4, 2025

📝 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 found
  • 409:
    • Cannot delete project with active pipeline
    • Cannot delete project with running jobs

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔄 Refactor (non-breaking change which refactors the code base)
  • ⚡ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🚧 CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
Copilot AI review requested due to automatic review settings December 4, 2025 16:12
Copy link
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 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_project that 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]>
Copilot AI review requested due to automatic review settings December 4, 2025 20:06
Copy link
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

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.

@maxxgx maxxgx requested a review from MarkRedeman as a code owner December 5, 2025 09:29
Signed-off-by: Max Xiang <[email protected]>
Copilot AI review requested due to automatic review settings December 5, 2025 10:33
Copy link
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

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.
Copy link
Contributor

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

Copy link
Contributor Author

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

@maxxgx maxxgx merged commit 7e22d70 into open-edge-platform:feature/geti-inspect Dec 5, 2025
21 checks passed
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.

2 participants