Skip to content

Commit 9dbb1e2

Browse files
committed
fixup! feat: add prune_db command to prune old checkouts, builds and tests. * Delete rows older than a given age with manual cascade (checkout -> builds -> tests) * --origins scoping, --dry-run and a --yes confirmation. Extract parse_interval into a shared helper and add integration tests.
* Add tables parameter. * Protect issue related rows by default, and add parameter to bypass. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
1 parent 68ecb10 commit 9dbb1e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

backend/kernelCI_app/management/commands/prune_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
99
Rows linked to an incident (an issue) are kept by default, together with their
1010
ancestors so nothing is orphaned; pass --skip-issue-protection to prune them too.
11+
12+
Only checkouts, builds and tests are touched. Aggregate and derived tables (e.g.
13+
tree_tests_rollup, hardware_status, latest_checkout) are left untouched and must
14+
be cleaned up separately.
1115
"""
1216

1317
from django.core.management.base import BaseCommand, CommandError

0 commit comments

Comments
 (0)