-
Notifications
You must be signed in to change notification settings - Fork 42
cli: add --dry-run to decision-log-prune #720
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerslevel-3Write a self-contained test, or add a flag following an existing sibling pattern.Write a self-contained test, or add a flag following an existing sibling pattern.
Description
Activity
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerslevel-3Write a self-contained test, or add a flag following an existing sibling pattern.Write a self-contained test, or add a flag following an existing sibling pattern.
setup,install-hooks,uninstall-hooksanduninstallall have--dry-run.decision-log-prune(src/doberman/cli/main.py:3055-3088) deletes audit rows with no way to preview how many.What to do
dry_runtoprune_decisions(src/doberman/storage/log.py:459-480): run the same deletes, count the rows, thenconn.rollback()instead of committing.--dry-runto the command and printWould prune N row(s) (A by age, B over --max-rows).The delete predicate doesn't change, so pending AUTH rows are still never counted.
Test (next to the prune tests in
tests/integration/test_decision_log.py): the dry-run count matches what a real prune then removes, and the row count is unchanged after the dry run.