feat: clean up runners when pool is deleted + bulk runner management#17
Merged
feat: clean up runners when pool is deleted + bulk runner management#17
Conversation
- Add immediate runner cleanup when deleting a pool via DELETE /api/pools/:id - Clean up both Docker and native runners (stop process/container, deregister from GitHub) - Add bulk selection and delete functionality to RunnerManager UI - Add orphan detection (ephemeral runners with no pool) with filter and visual indicator - Fix frontend test script to use 'vitest run' instead of watch mode - Add test case for pool deletion runner cleanup
There was a problem hiding this comment.
Pull request overview
This PR enhances pool and runner management by implementing automatic cleanup when pools are deleted, and adding bulk selection/deletion capabilities in the frontend. When a pool is deleted, all associated runners are now properly stopped, deregistered from GitHub, and removed from the database, preventing orphaned resources. The frontend also introduces orphan detection to identify ephemeral runners without pools.
Key changes:
- Backend pool deletion now cleans up all associated runners (Docker and native) before removing the pool
- Frontend adds bulk runner selection with checkboxes and a "Delete Selected" button for managing multiple runners
- Orphaned runners (ephemeral runners without a pool) are visually flagged and can be filtered for easy cleanup
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| backend/src/routes/pools.ts | Added comprehensive runner cleanup logic to pool deletion endpoint, including stopping runners, deregistering from GitHub, and cleaning up files |
| backend/tests/pools.test.ts | Added test case to verify runners are deleted when their pool is deleted |
| frontend/src/components/RunnerManager.tsx | Implemented bulk selection UI with checkboxes, orphan detection with visual badges, filtering by orphaned status, and bulk delete functionality |
| frontend/package.json | Changed test script from watch mode to run-once mode for better CI/CD compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move deleteRunnerById prepared statement to top with other statements - Fix misleading comment about ON DELETE SET NULL behavior - Add race condition acknowledgment comment with note about orphan detection - Use Promise.allSettled for parallel bulk deletion in frontend - Add user notification when bulk delete has failures - Add comment explaining test runners are simplified without directories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When a pool is deleted, all associated runners are now properly cleaned up (stopped, deregistered from GitHub, and removed from the database).
Changes
Backend
DELETE /api/pools/:id, all runners belonging to that pool are now cleaned up:Frontend
vitest runinstead of watch modeTesting