Skip to content

feat: implement garbage-collect for all providers#9

Merged
frostebite merged 1 commit intorefactor/orchestrator-extractionfrom
feat/garbage-collect-improvements
May 3, 2026
Merged

feat: implement garbage-collect for all providers#9
frostebite merged 1 commit intorefactor/orchestrator-extractionfrom
feat/garbage-collect-improvements

Conversation

@frostebite
Copy link
Copy Markdown
Member

Summary

Implements proper garbage collection for all main providers, fixes --garbageMaxAge wiring, and ensures --dry-run works correctly.

  • AWS: Fixed garbageMaxAge (was converted to a boolean, now passes actual hours). Fixed buggy isOlderThan1day which used getDay() (returns 0-6) instead of computing actual age. Added dry-run output logging and returns a summary of actions taken.
  • K8s: Full implementation — cleans up completed/failed jobs, orphaned pods, build-credentials-* secrets, and service-account-* service accounts older than maxAge. Respects --dry-run and --filter.
  • Docker: Full implementation — removes stopped unity containers, prunes dangling images (or all unity images with --fullCache), and removes orchestrator volumes. Respects --dry-run and --garbageMaxAge.
  • CLI serve command: Wires --garbageMaxAge from CLI options into the garbage-collect dispatch (was previously ignored, always passed 0).

Addresses feedback from game-ci/documentation#541 (review comment about safety/confirmation).

Test plan

  • game-ci garbage-collect --provider-strategy aws --dry-run shows what would be deleted without deleting
  • game-ci garbage-collect --provider-strategy aws --garbageMaxAge 48 only targets resources >48h old
  • game-ci garbage-collect --provider-strategy k8s --dry-run lists stale jobs/pods/secrets
  • game-ci garbage-collect --provider-strategy local-docker --dry-run lists stale containers/images
  • All existing tests still pass (848 passing)

🤖 Generated with Claude Code

…--garbageMaxAge

- AWS: Fix garbageMaxAge wiring (was converted to boolean, now passes actual hours).
  Fix buggy isOlderThan1day (used getDay() instead of actual age diff).
  Add dry-run output logging instead of silently skipping.
  Return summary of actions taken.

- K8s: Implement garbage collection — cleans up completed/failed jobs, orphaned
  pods, build-credentials secrets, and service accounts older than maxAge.
  Respects --dry-run and --filter flags.

- Docker: Implement garbage collection — removes stopped unity containers,
  prunes dangling images (or all unity images with --fullCache), and removes
  orchestrator volumes. Respects --dry-run and --garbageMaxAge.

- CLI: Wire --garbageMaxAge from CLI options into the garbage-collect command
  (was previously ignored, always passed 0).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e61fe1e-5aaf-42cb-af76-0183e24a000f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/garbage-collect-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@frostebite frostebite merged commit 9cee8c5 into refactor/orchestrator-extraction May 3, 2026
7 checks passed
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.

1 participant