Repository navigation
feat(merge_requests): validate literal original diff selection - #637
Conversation
Reject malformed or incomplete literal diff input before binding review endpoints, preserving raw text and immutable validated coordinates. Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
sjungwon03-ai
left a comment
There was a problem hiding this comment.
Reviewed commit 9a72ad2: All five remote PR blobs match the reviewed local commit. The literal validator rejects unsupported metadata, omitted content, malformed/truncated/overlapping hunks, unequal unchanged gaps, invalid count/coordinate bounds and stray/repeated no-newline markers without repairing raw text. Literal metadata and whitespace are retained; validated hunks, rows and selections are immutable. Literal range matching validates the whole input before the shared matcher; existing display parsing remains unchanged. Full format/analyze and 7,877 local tests pass, including 56 test-first cases. No blocking findings. Conservative local validation does not establish server coverage, original references or private-write safety; guarded controller/private-save UI remains a follow-up.
Summary
Validate original commit diff text and metadata before matching review endpoints. Malformed, truncated, omitted or contradictory input returns no selectable range instead of being silently repaired by the display parser. Retain literal text, nullable flags and deeply immutable validated hunks; existing display parsing and original range behavior remain compatible.
Closes #636
Validation
dart format .: 971 files; no outstanding changes.flutter analyze: no issues.Checklist
dev, linked issue, Conventional Commit and DCO sign-off.Notes for reviewers
The validator accepts a conservative local textual format. It does not prove full server coverage or original commit references; captured origin/membership checks and guarded controller/private-save reservation/recovery UI remain follow-ups. This slice provides strict literal range matching without changing permissive display parsing.