Search before asking
What happened
The generic DELETE /projects/:projectName endpoint deletes a project through services.DeleteProject() without exposing a lifecycle hook for plugins or features that maintain project-scoped state.
Core DevLake records such as the project, blueprint, mappings and metric settings are cleaned up, but feature-owned records can be left stale if their cleanup normally happens through a feature-specific or Config UI deletion flow.
There is already a project lifecycle extension for renames through ProjectService.RenameProject(...), but there is no equivalent hook for deletion.
What do you expect to happen
Project deletion should provide a lifecycle extension point that allows plugins or features with project-scoped state to validate and clean up their own records before the project is deleted.
Ideally this should integrate with the core deletion transaction where possible so project deletion and feature-owned cleanup cannot leave inconsistent state.
For example, the existing ProjectService boundary could expose a BeforeDeleteProject or DeleteProject hook similar to RenameProject.
How to reproduce
-
Add or use a feature/plugin that persists a record associated with a DevLake project and normally removes or validates that record during its own project-deletion flow.
-
Create a DevLake project and associate feature-owned state with it.
-
Delete the project directly through:
DELETE /projects/:projectName
-
Observe that server/api/project.DeleteProject calls services.DeleteProject(projectName) directly.
-
Observe that core project records are removed, but no plugin/feature deletion hook is invoked.
-
The feature-owned project association can therefore remain stale or orphaned.
This is reproducible on current main at commit:
f110add
Anything else
No response
Version
f110add
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
The generic
DELETE /projects/:projectNameendpoint deletes a project throughservices.DeleteProject()without exposing a lifecycle hook for plugins or features that maintain project-scoped state.Core DevLake records such as the project, blueprint, mappings and metric settings are cleaned up, but feature-owned records can be left stale if their cleanup normally happens through a feature-specific or Config UI deletion flow.
There is already a project lifecycle extension for renames through
ProjectService.RenameProject(...), but there is no equivalent hook for deletion.What do you expect to happen
Project deletion should provide a lifecycle extension point that allows plugins or features with project-scoped state to validate and clean up their own records before the project is deleted.
Ideally this should integrate with the core deletion transaction where possible so project deletion and feature-owned cleanup cannot leave inconsistent state.
For example, the existing
ProjectServiceboundary could expose aBeforeDeleteProjectorDeleteProjecthook similar toRenameProject.How to reproduce
Add or use a feature/plugin that persists a record associated with a DevLake project and normally removes or validates that record during its own project-deletion flow.
Create a DevLake project and associate feature-owned state with it.
Delete the project directly through:
DELETE /projects/:projectName
Observe that
server/api/project.DeleteProjectcallsservices.DeleteProject(projectName)directly.Observe that core project records are removed, but no plugin/feature deletion hook is invoked.
The feature-owned project association can therefore remain stale or orphaned.
This is reproducible on current
mainat commit:f110add
Anything else
No response
Version
f110add
Are you willing to submit PR?
Code of Conduct