feat(cli): vouch approve accepts multiple ids for scriptable bulk approval#103
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vouch approve <id1> <id2> …now approves multiple proposals in one non-interactive call, for CI and clearing a review backlog (feat:vouch approve --batchfor scriptable bulk approval #93). Complements the interactivevouch reviewqueue.Root Cause / Context
Enhancement, not a bug.
vouch approveaccepted a singleproposal_idonly (src/vouch/cli.py), so bulk approval meant one process per proposal. The issue asks for a scriptable batch with one audit event per artifact and clear all-or-nothing vs best-effort semantics.Fix
approvetakes variadicproposal_ids(nargs=-1) plus--keep-going. Single-id usage is unchanged.proposals.check_approvable()before any write, so a typo or already-decided id aborts the batch and approves nothing.--keep-going= best-effort: approve each id independently, print✗ <id>: <reason>for failures, exit non-zero if any failed.proposals.check_approvable()/_approval_block_reason()extract the not-pending + forbidden-self-approval gates into one read-only helper;approve()now reuses it, so the single-approve path and the batch precheck can't drift. Error messages are byte-for-byte unchanged.do_approvelogs per call).Test Plan
tests/test_cli.py:test_approve_batch_approves_all,test_approve_batch_one_audit_event_per_artifact,test_approve_batch_atomic_aborts_on_bad_id,test_approve_batch_keep_going_best_effortapproverejects extra args); all pass with the fixtest_crystallize_cli_partial_failures_shows_warning) that also fails on cleanupstream/test(environment-sensitive_whoami())Closes #93