Skip to content

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

Description

@fu351

setup, install-hooks, uninstall-hooks and uninstall all 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

  1. Add dry_run to prune_decisions (src/doberman/storage/log.py:459-480): run the same deletes, count the rows, then conn.rollback() instead of committing.
  2. Add --dry-run to the command and print Would 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomerslevel-3Write a self-contained test, or add a flag following an existing sibling pattern.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions