Conversation
There was a problem hiding this comment.
Pull request overview
Adds an automated Firebase cleanup tool and schedules it via cron to reduce Realtime Database storage usage/costs while attempting to preserve editor/release functionality.
Changes:
- Registers a new
cleanupFirebaseCLI tool underpnpm run tools .... - Schedules a weekly production cron job to run Firebase cleanup with
--execute. - Implements
tools/cleanupFirebase.tsto prune old Firebase history data, fast-forward discussions, and remove orphaned drafts/paths.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| tools/index.js | Adds cleanupFirebase to the tools command registry. |
| tools/cron.ts | Schedules weekly production execution of the cleanup tool. |
| tools/cleanupFirebase.ts | Implements the Firebase cleanup/pruning + orphan detection/removal logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Firebase Cleanup Tool
Implements automated cleanup of Firebase to reduce storage costs.
What it should do
changes/,checkpoints/,checkpointMap/,checkpoint, andmerges/before the safe thresholdmin(latestCheckpointKey, latestReleaseHistoryKey)— preserves all steps needed for release creation (any discussions made on a release are fast-forwarded through steps to align on the new release, so we have to preserve steps since release in case there are discussions)CLI Usage
Scheduled
Runs on a regular interval set via cron in
tools/cron.ts.Testing Checklist
1. Dry-run mode
pnpm run tools cleanupFirebasein dev2. Single pub test
--pubId <test-pub-id> --execute3. Discussion fast-forwarding
--execute4. Release preservation
5. Orphan cleanup
--execute, verify orphan is removed from Firebase6. Edge cases
pub-*/branch-*) — verify handled correctlydrafts/draft-*) — verify handled correctly7. Production dry-run