feat: add delete repository functionality#42
feat: add delete repository functionality#42Selene29 wants to merge 5 commits intorepowise-dev:mainfrom
Conversation
06c6824 to
7d71a0c
Compare
|
Full-stack delete is well done. CRUD, API, CLI, and both UI surfaces (dashboard and Danger Zone) are all covered. The FTS cleanup before CASCADE delete is the right order. Two issues I found in the code:
Logic and tests otherwise look solid. Fix the CLI argument issue and this is ready to merge. |
Persistence layer for repository deletion. CASCADE on FK constraints handles child tables; FTS5 needs explicit cleanup via delete_many.
Cleans up FTS index before CASCADE-deleting the repository and all child rows (pages, graph, symbols, git metadata, decisions, etc.).
Lists repos in a numbered table, lets user pick one, confirms, then cleans FTS and CASCADE-deletes the repo. Supports --force.
Trash icon appears on hover in the repo list. Clicking shows a
confirmation dialog, then calls DELETE /api/repos/{id} and refreshes.
7d71a0c to
f781ac8
Compare
Reviewer feedback: - path as a second positional arg was unreachable (Click assigns left-to-right, so a path string would land in repo_id). Now --path/-p. - Added comment explaining fts is always initialized in lifespan, so the None guard is purely defensive.
Summary
delete_repositoryandlist_page_idsCRUD helpers, plusdelete_manyfor FTS cleanupDELETE /api/repos/{repo_id}endpoint that cascades through DB rows and FTS indexrepowise deleteCLI command with interactive repo selection and--forceflagTest plan
delete_repositoryandlist_page_idsDELETE /api/repos/{repo_id}(success + 404)repowise deleteCLI and verify repo is removed/repos/{id}/settings, verify Danger Zone section with Delete Repository button