Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesAllowed-Root Path Resolution
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Home-relative workspace paths should now resolve against the user’s home directory while remaining subject to allowed-root checks. No actionable merge risk is established. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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. A rabbit checks the paths at night Comment |
|
| ); | ||
|
|
||
| assert.throws( | ||
| () => resolveAllowedPath("~/file.txt", "/workspace", ["/workspace"]), |
There was a problem hiding this comment.
Rejection test depends on HOME
If the test runner’s home directory is /workspace or beneath it, ~/file.txt is inside the allowed root. The helper correctly accepts it, but this assertion fails. Use an allowed root that excludes the file, such as join(home, "personal"). This is a non-blocking test reliability issue.
| () => resolveAllowedPath("~/file.txt", "/workspace", ["/workspace"]), | |
| () => resolveAllowedPath("~/file.txt", "/workspace", [join(home, "personal")]), |
Artifacts
Command used to run and capture the HOME boundary checks
- This executed shell command ran the actual test and focused reproduction under three HOME values, capturing each command and exit code.
Focused executable source for the allowed-root check
- This executed TypeScript source calls the changed helper with the original and proposed roots, showing their outcomes.
Actual root test passes with HOME outside /workspace
- Running `src/roots.test.ts` with `HOME=/home/user` exited 0, establishing the passing comparison.
Actual root test fails with HOME=/workspace
- Running the same test with `HOME=/workspace` exited 1 with a missing-expected-exception error at line 43, confirming the finding.
Focused path check with HOME outside /workspace
- The direct helper call rejected `~/file.txt` under the original `/workspace` root when HOME was `/home/user`.
Focused path check with HOME=/workspace
- The direct helper call accepted `~/file.txt` under `/workspace` but rejected it under `join(home, 'personal')`, confirming the proposed root avoids this failure.
Focused path check with HOME below /workspace
- With `HOME=/workspace/child`, the original root accepted `~/file.txt` while the proposed root rejected it.
Captured command and executed reproduction source
- A command captured the shell runner and TypeScript reproduction source used for the checks, making the execution inspectable.
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Expanding leading-tilde paths (
~/...) before making them absolute ensuresresolveAllowedPathresolves against the user's home directory rather than joining as a literal tilde segment undercwd. This fixesopen_workspacecalls using home-relative paths (e.g. from ChatGPT).Fixes #369
Summary by CodeRabbit
~now resolve from the home directory before access is checked, rather than being treated as paths beneath the working directory.