Repository navigation
fix(mcpx): skip symlink loops in @dir: resolution like dangling links (#7693) - #8451
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
agent-note:v1 |
What
In
pkgs/mcpx/internal/source, the@dir:walk followed entry symlinks withos.Statand skipped only the dangling-link error (fs.ErrNotExist). A symlink loop makesos.Statfail withELOOP, which aborted the entire resolve — one loop entry took down every readable file in the tree.The stat-error branch now treats
syscall.ELOOPexactly like a dangling link: the entry is skipped and the walk continues. A loop can never resolve to a regular target, so it is the same tolerated case as a link whose target does not exist.Tests
TestDirectorySkipsSymlinkLoop: a tree with a regular file, a self-referential link, and a two-link loop resolves to exactly the regular file (files list and concatenated text).go test ./internal/source/green;go vetandgofmtclean. Full-modulego test ./...: only two failures, both reproduced identically on pristine main without this change —internal/configTestServerKeysAnotherHostWritesAreRecordedNotRefused andinternal/conformanceTestMessagesClient — pre-existing and unrelated (neither package's behavior is touched here).Fixes #7693
Refs: fleet task 14506 (queue repo-health-code-pilot, lane code-b)
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.