fix: reject diffs containing binary files instead of silently dropping them - #61
Conversation
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryBinary-diff rejection now protects newly generated split plans, but executing an existing dry-run plan still skips that check. A saved plan containing a binary file can continue toward branch creation and omit that file from the generated split branches. Confidence Score: 4/5Not ready to merge: saved plans with binary changes can be executed without rejecting the unsupported binary file. One verified non-security correctness issue remains in the saved-plan execution path. Files Needing Attention: pr_split/cli.py
What T-Rex did
|
42002fc to
51e9674
Compare
|
Good catch — |
…g them Binary patches have no hunks, so coverage validation passed without any group claiming them and the change never reached any sub-PR. Refuse such diffs up front in split (before the LLM call) and in validate_plan.
A dry-run plan saved before this check existed (or produced by a different version) can still carry a binary file; execute now runs validate_no_binary_files on the saved diff before validate_coverage so it stops before creating any branches.
ca4f34f to
2485609
Compare
Summary
Coverage validation is computed over hunks. A binary
PatchedFilehas zero hunks, so a plan that covered only the text files passedvalidate_planwith no warnings and the binary change (e.g. an updated image) was never materialised into any branch — it silently vanished from the split.validate_no_binary_files(parsed_diff)raisesPlanValidationError(BINARY_FILES_UNSUPPORTED)listing the filesvalidate_plan, and insplitright after parsing so the failure is reported before an LLM call is spentTest plan
validate_planrejects even when all text hunks are covereduv run ruff check/ruff format --checkcleanuv run pytest -q— 447 passed