fix(linker): accept plain unified patches - #1021
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9581220. Configure here.
Greptile SummaryThis PR teaches
Confidence Score: 5/5Safe to merge — the plain-patch path shares all existing traversal and symlink guards, git-style parsing is unchanged, and the new hunk-count boundary detection is well-tested. The hunk-counter logic correctly distinguishes No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(linker): handle unified patch edge c..." | Re-trigger Greptile |

Summary
diff --githeaders---/+++headers while preserving git-style parsingRoot cause
The patch splitter only populated each section's target path from a
diff --gitline. Plaindiff -upatches were parsed into a body with no path and failed withpatch section missing file path, even though pnpm accepts them.Reported in Discussion #1018.
Validation
cargo fmt --checkcargo test -p aube-linker patches::testscargo clippy -p aube-linker --all-targets -- -D warningsaubebinaryNote
Medium Risk
Changes patch parsing and file-boundary logic on the install/link path; mistakes could mis-apply patches or split files wrong, though existing path-escape and symlink guards still apply.
Overview
Fixes patch application when users supply plain
diff -uoutput (nodiff --gitlines), which previously failed because each section never got a target path.split_patch_sectionsnow splits on either git boundaries or unified-diff file headers: paths come from---/+++viaunified_header_path(including bare paths and timestamp suffixes), and hunk line counts distinguish the next file’s---from hunk content— including multi-hunk and multi-file plain patches, adds (--- /dev/null), and deletes (+++ /dev/null). Git-style parsing is unchanged. Empty-parse errors now say “no parseable file sections.”Adds tests for plain unified apply paths, traversal rejection, and zero-count hunks at file boundaries.
Reviewed by Cursor Bugbot for commit f7bfe8b. Bugbot is set up for automated code reviews on this repo. Configure here.