Skip to content

feat(cli): add --dry-run option to decision-log-prune (#720) - #735

Open
harmehak0173 wants to merge 2 commits into
DobermanCore:mainfrom
harmehak0173:feat/issue-720-decision-log-prune-dry-run
Open

harmehak0173 wants to merge 2 commits into
DobermanCore:mainfrom
harmehak0173:feat/issue-720-decision-log-prune-dry-run

Conversation

@harmehak0173

Copy link
Copy Markdown
Contributor

Summary

Fixes #720.

Adds --dry-run\ to \doberman decision-log-prune\ so operators can preview how many resolved decision rows would be pruned by age and/or row budget without deleting them:

  • Adds \dry_run: bool = False\ to \prune_decisions\ in \src/doberman/storage/log.py: executes the delete queries to count rows, then executes \�wait conn.rollback()\ instead of \�wait conn.commit()\ when \dry_run\ is \True.
  • Adds --dry-run\ option to \decision_log_prune\ in \src/doberman/cli/main.py: prints \Would prune N row(s) (A by age, B over --max-rows).\ when \dry_run\ is \True, while preserving standard output when \False.
  • Updates \docs/CLI.md\ options list for \decision-log-prune.
  • Adds integration tests in \ ests/integration/test_decision_log.py\ verifying that dry-run counts match a subsequent real prune and database rows remain unchanged after dry run.
  • Adds CLI integration test in \ ests/integration/test_cli_views.py\ verifying preview output and database persistence.

This branch has not been deployed

No deployments
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.

cli: add --dry-run to decision-log-prune

1 participant