feat: add a worktree cleanup script #1818
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a
worktree_cleanup_scriptfield at the project level that runs once before worktree directories are removed.Closes #1644
Database:
crates/db/migrations/20260107211120_add_worktree_cleanup_script_to_projects.sql- New migrationRust Backend:
crates/db/src/models/project.rs- Added field toProjectandUpdateProjectstructs, updated all SQL queriescrates/services/src/services/workspace_manager.rs- Addedcleanup_workspace_with_script()andexecute_cleanup_script()methodscrates/services/src/services/project.rs- UpdatedUpdateProjectusagecrates/services/src/services/container.rs- UpdatedUpdateProjectusagecrates/server/src/routes/tasks.rs- Task deletion now fetches and executes cleanup scriptcrates/local-deployment/src/container.rs- Addedget_cleanup_script_for_workspace(), updated cleanup methodsFrontend:
frontend/src/pages/settings/ProjectSettings.tsx- Added UI for the new fieldfrontend/src/components/tasks/TaskDetails/preview/NoServerContent.tsx- UpdatedUpdateProjectusagefrontend/src/i18n/locales/en/settings.json- Added localization stringsbash -c