Conversation
71f6365 to
c00fdf7
Compare
klesh
left a comment
There was a problem hiding this comment.
Thanks for putting this up.
The overall design LGTM.
But I didn't see any actual implementation on the plugin side, what is the plan for that part?
|
@klesh The intention was to keep this opt-in on the plugin side so existing plugins wouldn’t be forced to implement the new interface just because the framework supports it. The idea was that plugins which actually have buffered/stateful resources that need flushing can implement it as needed, while the rest remain unchanged. That said, if you’d prefer this PR to include concrete implementations for the existing plugins where it makes sense, I can go through them and add those as part of this PR. |
Makes sense. Please resolve the conflict and I will merge this PR first. |
b72720e to
dda7484
Compare
|
Thanks @klesh I've resolved the conflicts and pushed. |
dda7484 to
b0dd4e8
Compare
…e#9081) Project deletion deletes core DevLake records directly without exposing a lifecycle hook for plugins that maintain project-scoped state. While project renames provide a lifecycle extension through ProjectService.RenameProject, there was no equivalent hook for project deletion. This commit: - Introduces optional plugin.ProjectDeleteHook in core/plugin - Traverses registered plugins via plugin.TraversalPlugin during DeleteProject - Executes hooks, blueprint cleanup, and project deletion inside a single transaction - Provides BlueprintManager.DeleteBlueprintInTransaction to participate in caller transaction - Adds comprehensive unit tests covering hook dispatch, veto rollback, and atomic deletion Closes apache#9081 Signed-off-by: Muzamil Kaleem <113013457+muzamilkm@users.noreply.github.com>
b0dd4e8 to
0591498
Compare
Summary
DELETE /projects/:projectNamedeletes core project state directly, but plugins had no deletion lifecycle extension point. A plugin that persists state tied to a DevLake project therefore had no way to validate or clean up that state when deletion went through the core API.This PR:
plugin.ProjectDeleteHookalongside the existing project-related plugin contractsplugin.TraversalPluginbefore core project deletionBlueprintManager.DeleteBlueprintInTransactionso blueprint cleanup can participate in the caller's transaction while preserving the existingDeleteBlueprint(id)entry pointExisting plugins do not need to implement
ProjectDeleteHookunless they persist state whose lifecycle is tied to a DevLake project.Does this close any open issues?
Closes #9081
Screenshots
N/A
Other Information
Backwards compatibility
ProjectServiceremains unchanged and still only requiresRenameProject(...).ProjectDeleteHookis a separate optional plugin interface, so existing plugins and existingProjectServiceimplementations remain source-compatible.The existing
BlueprintManager.DeleteBlueprint(id)entry point is preserved.DeleteBlueprintInTransactiononly provides a transaction-aware path for callers that already own a transaction.There are no schema, migration, HTTP API, Config UI or Grafana changes in this PR.
Validation
From
backend/:All of the above pass locally.
The new hook contract is documented in core/plugin. No user-facing documentation changes are required.