Repository navigation
Add manual cleanup for worktree Electron storage - #27414
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The worktree cleanup command is ready to merge after normal checks; no actionable risk remains from this review. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
74f8b5e8-b6dc-4682-8ff0-e1d878ad5084
📒 Files selected for processing (11)
config/scripts/dev-electron-bundle-cache.mjsconfig/scripts/dev-electron-bundle-cache.test.tsconfig/scripts/install-electron-package-binary.mjsconfig/scripts/rebuild-native-deps.mjsconfig/scripts/reclaim-dev-electron-bundles.mjsconfig/scripts/reclaim-dev-electron-bundles.test.tsconfig/scripts/reclaim-electron-dists.mjsconfig/scripts/reclaim-worktree-space.mjsconfig/scripts/reclaim-worktree-space.test.mjsdocs/readme/worktree-storage-maintenance.mdpackage.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
ELI5
Old development app bundles and separate Electron copies can accumulate across worktrees. This adds one local command to preview reclaimable storage and another to apply the cleanup. Cleanup runs only when requested;
pnpm devdoes not start background maintenance.What Changed
--repo DIRECTORYselects another local repository.docs/readme/worktree-storage-maintenance.md.Why
Starting the dev app previously reclaimed old bundles only in the current worktree, leaving output from inactive branches behind. Healthy dependency installs also skipped the opportunity to share their existing Electron distribution. Reusing the existing cache and cleanup scripts addresses both without deleting whole worktrees or replacing their dependency installations. Keeping the sweep manual lets developers choose when to reclaim storage.
Linked Issue
N/A — maintainer-requested maintenance work; no linked issue.
Visual Proof
N/A — local command and dependency setup changes; no rendered UI changes.
Testing
On macOS, ran the combined preview against the local repository without applying it to existing worktrees. Tested actual preview/apply removal in a disposable Git repository, including age retention. Focused tests cover competing cleanup commands, failure recovery, active-process/build protection, Electron installation, and the existing sharing mechanisms.
ORCA_BACKGROUND_LAUNCH=1 pnpm tcpassed.ORCA_BACKGROUND_LAUNCH=1 pnpm run check:code-quality:changedpassed; commit hooks also run lint and formatting.Full application build and full-repository lint were not run locally; CI covers those checks.
Review
Self-reviewed the selected changes, default preview behavior, deletion checks, lock release, and PR scope.
Agent skill upstream boundary
Notes
No background cleanup hook, timer, or scheduling mode is included. Historical release-test cache sharing and the tracked-source cloning experiment are outside this PR.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)