Skip to content

feature/LCHIB-786: support symlink files for PTS v2 embedding - #1375

Merged
Konboi merged 4 commits into
v1from
feature/LCHIB-786-support-symlink
Sep 4, 2026
Merged

feature/LCHIB-786: support symlink files for PTS v2 embedding#1375
Konboi merged 4 commits into
v1from
feature/LCHIB-786-support-symlink

Conversation

@Konboi

@Konboi Konboi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolve symlink entries in collectFiles() so they are sent to the server for PTS v2 embedding generation
  • Symlinks pointing outside the repo, broken symlinks, and multi-level symlinks are safely skipped
  • Added tests for symlink resolution, broken symlinks, outside-repo symlinks, and regression for regular files

Background

PTS v2 uses file_embeddings to select tests related to changed source code. Symlinked test files were excluded because collectFiles() only accepted TYPE_FILE entries, causing symlink-based tests to never get embedded.

Changes

  • CommitGraphCollector.java: Modified collectFiles() to detect SYMLINK entries, resolve them via resolveSymlinkTarget(), and treat them as regular GitFiles with the symlink path but the target's blob content
  • CommitGraphCollectorTest.java: Added 4 new test cases

Test plan

  • symlinkResolvedAsRegularFile — symlink is included with target's content
  • brokenSymlinkSkipped — broken symlink is gracefully skipped
  • symlinkOutsideRepoSkipped — symlink pointing outside repo is skipped
  • regularFilesUnaffectedBySymlinkChange — existing regular file handling unchanged
  • All 17 existing tests still pass

🤖 Generated with Claude Code

Konboi and others added 4 commits September 3, 2026 17:58
… 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>
@Konboi
Konboi requested a review from gayanW September 4, 2026 02:24
@Konboi
Konboi merged commit 05d43dc into v1 Sep 4, 2026
15 checks passed
@Konboi
Konboi deleted the feature/LCHIB-786-support-symlink branch September 4, 2026 03:41
@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants