Skip to content

feat: clean up runners when pool is deleted + bulk runner management#17

Merged
depoll merged 2 commits intomainfrom
feature/edit-pool-attributes
Jan 4, 2026
Merged

feat: clean up runners when pool is deleted + bulk runner management#17
depoll merged 2 commits intomainfrom
feature/edit-pool-attributes

Conversation

@depoll
Copy link
Copy Markdown
Owner

@depoll depoll commented Jan 4, 2026

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

  • Pool deletion cleanup: When deleting a pool via DELETE /api/pools/:id, all runners belonging to that pool are now cleaned up:
    • Docker runners: stopped and container removed
    • Native runners: process stopped, deregistered from GitHub
    • Database records deleted
  • Added test case verifying runner cleanup on pool deletion

Frontend

  • Bulk selection: Added checkboxes for selecting multiple runners
  • Bulk delete: "Delete Selected" button for deleting multiple runners at once
  • Orphan detection: Runners that are ephemeral with no pool are flagged as "orphaned" with a yellow badge
  • Orphan filter: "Show orphaned only" checkbox to filter the list to just orphaned runners (useful for cleaning up historical orphans)
  • Fixed test script to use vitest run instead of watch mode

Testing

  • All backend tests pass (72 tests)
  • All frontend tests pass (14 tests)
  • Typecheck passes for both workspaces

- 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
Copilot AI review requested due to automatic review settings January 4, 2026 19:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread frontend/src/components/RunnerManager.tsx Outdated
Comment thread frontend/src/components/RunnerManager.tsx Outdated
Comment thread backend/tests/pools.test.ts
Comment thread backend/src/routes/pools.ts
Comment thread backend/src/routes/pools.ts Outdated
Comment thread backend/src/routes/pools.ts Outdated
- 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
@depoll depoll merged commit e75294a into main Jan 4, 2026
4 checks passed
@depoll depoll deleted the feature/edit-pool-attributes branch January 4, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants