Repository navigation
Conversation
| files: Schema.Array( | ||
| Schema.Struct({ | ||
| path: TrimmedNonEmptyStringSchema, | ||
| path: GitFilePath, |
There was a problem hiding this comment.
🟠 High src/git.ts:222
Repositories containing leading.txt or trailing.txt still report leading.txt or trailing.txt, so selecting the reported path does not identify the changed file and the targeted commit cannot stage it. parseNumstatEntries and parsePorcelainPath trim rawPath before it reaches GitFilePath; preserve Git's path bytes in those producers instead of trimming filename whitespace.
🤖 Copy this AI Prompt to have your agent fix this:
In file @packages/contracts/src/git.ts around line 222:
Repositories containing ` leading.txt` or `trailing.txt ` still report `leading.txt` or `trailing.txt`, so selecting the reported path does not identify the changed file and the targeted commit cannot stage it. `parseNumstatEntries` and `parsePorcelainPath` trim `rawPath` before it reaches `GitFilePath`; preserve Git's path bytes in those producers instead of trimming filename whitespace.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — This is a small, backward-compatible Git path-validation fix with focused regression tests and no broad runtime or infrastructure changes. However, server-side path parsers still trim whitespace before these schemas receive the values, leaving the intended end-to-end fix incomplete. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds a non-empty Git path schema that does not trim whitespace. Git action inputs and VCS status paths use this schema. Tests cover whitespace preservation and empty-path rejection. ChangesGit path decoding
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The path decoding change preserves whitespace while continuing to reject empty paths, with focused coverage for both affected contracts. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Closes #12464
Git action inputs and working-tree status results trim file paths, changing
" leading.txt"into"leading.txt". Preserve the exact strings in both path fields while continuing to reject empty paths.Verification against upstream
9ea9c3d5d: the two whitespace-preservation assertions fail without the fix and pass with it. Both empty-path rejection assertions pass in both cases, giving four passing focused tests with the fix. This verifies schema decoding; a complete staging or commit operation was not tested.Developed with Astra 6 in Codex/T3 Code and reviewed with Fable 5.1.
Summary by CodeRabbit