Repository navigation
fix: index followed file symlinks in zlob walker (#912) - #913
Conversation
zlob reports followed symlinks with the Symlink kind and lstat metadata, so the zlob walker dropped every symlink that resolves to a file even with follow_symlinks on. Stat the target and index it as a file. Closes #912
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe zlob walker now indexes file symlinks when symlink following is enabled. A Unix-only test covers linked files, directory links, broken links, and behavior when following is disabled. ChangesSymlink traversal
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 Symlinks that resolve to files are now indexed when symlink following is enabled. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches 💡 1📝 Generate docstrings
🧪 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. Comment |
…mtrKovalenko#913) zlob reports followed symlinks with the Symlink kind and lstat metadata, so the zlob walker dropped every symlink that resolves to a file even with follow_symlinks on. Stat the target and index it as a file. Closes dmtrKovalenko#912 Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com>
Closes #912
Root cause
zlob keeps
kind = Symlinkand lstat metadata for followed links (zlob-1.6.5/zig-src/walker/worker.zig:422, onlyis_diris resolved for descent).crates/fff-core/src/walk/zlob.rs:55keeps onlyentry.is_file(), so withfollow_symlinks = trueevery symlink to a file is dropped. Ripgrep walker resolves the target type, so non-zlob builds work. Release builds use zlob.Fix
For
Symlinkentries whenfollow_symlinksis on,std::fs::metadatathe target; index it if it is a regular file, with target size/mtime. Broken links and dir links are skipped here (dir links are already descended by zlob, parents are synthesized atfile_picker.rs:2288). Regular-file hot path unchanged; extra stat only for symlinks and only withfollow_symlinks.Steps to reproduce
On pre-fix
main:Same with default (ripgrep) build gives the expected output.
How verified
walk::tests::follows_file_symlinks_outside_root(file link outside root, dir link, broken link, follow on/off). Pre-fix zlob:left: ["linked/inner.toml", "projects.toml"], fails. Post-fix: passes on zlob and ripgrep backends.indexed: configs.toml, projects.toml, sesh.toml.make test-rust: 528 passed, 0 failed.make lint-rustclean,cargo fmt --checkclean.Automated triage via Gustav. Honk-Honk 🪿
Summary by CodeRabbit