feature/LCHIB-786: support symlink files for PTS v2 embedding - #1375
Merged
Conversation
… PTS v2 embedding Symlink files in git were excluded from file collection because only TYPE_FILE entries were accepted. This change detects SYMLINK entries, resolves them to their target blob via the git tree, and sends them as regular GitFiles with the symlink path but the target's content. Symlinks pointing outside the repo, broken symlinks, and multi-level symlinks are safely skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace unnecessary `continue OUTER` with `continue` (not inside inner for loop) - Add absolute path guard to resolveSymlinkTarget - Add comment explaining symlinkDir null check - Add tests for cross-directory symlinks (subdir→parent, parent→subdir) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use resolved content blob ID for dedup check so symlink target changes are detected even when the symlink itself is unchanged - Fix Windows path separator in resolveSymlinkTarget (replace \ with /) - Remove inline comment explaining symlinkDir null check - Merge cross-directory symlink tests into one test case - Extract collectFilePaths() helper to reduce test boilerplate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gayanW
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
collectFiles()so they are sent to the server for PTS v2 embedding generationBackground
PTS v2 uses
file_embeddingsto select tests related to changed source code. Symlinked test files were excluded becausecollectFiles()only acceptedTYPE_FILEentries, causing symlink-based tests to never get embedded.Changes
CommitGraphCollector.java: ModifiedcollectFiles()to detectSYMLINKentries, resolve them viaresolveSymlinkTarget(), and treat them as regularGitFiles with the symlink path but the target's blob contentCommitGraphCollectorTest.java: Added 4 new test casesTest plan
symlinkResolvedAsRegularFile— symlink is included with target's contentbrokenSymlinkSkipped— broken symlink is gracefully skippedsymlinkOutsideRepoSkipped— symlink pointing outside repo is skippedregularFilesUnaffectedBySymlinkChange— existing regular file handling unchanged🤖 Generated with Claude Code