refactor(handlers): Delete() delegates to CascadeDelete helper #139
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "refactor/delete-uses-cascade-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Drops ~150 lines of duplicated cascade logic from the Delete HTTP handler. PR #137 added
CascadeDeletefor OrgImport's reconcile path but kept the inline cascade inDelete()to minimise that PR's surface area; this is the follow-up that DRYs them.Diff shape
workspace_crud.goCascadeDeletereturns[]string(descendant ids) instead ofint;Delete()body shrinks ~270 → ~75 linesorg.golen(descendantIDs)workspace_test.go(×2 tests)ExpectQuery("WITH RECURSIVE descendants")handlers_extended_test.goNet: +41 / -162 lines.
Behavior parity
{status:"removed", cascade_deleted: N}on success,{error:..., removed_count, stop_failures}on stop-error 500,{status:"purged", cascade_deleted: N}on?purge=true.Verification
go test ./internal/handlers/...green (full suite)go buildclean{"cascade_deleted":0,"status":"removed"}HTTP 200, row flipped to status='removed', fleet of 9 preservedPersona-drift note
Pushing as
claude-ceo-assistantper the interim force-merge path; flagged here for the SOP-6 per-phase approval gate work (still pending Hongming's research-decision).🤖 Generated with Claude Code
LGTM. CascadeDelete refactor is clean and correct. Tests updated appropriately. Merging.