Skip to content

[LCHIB-786] support symlink files for PTS v2 embedding (main) - #1377

Merged
Konboi merged 16 commits into
mainfrom
feature/LCHIB-786-support-symlink-main
Sep 7, 2026
Merged

[LCHIB-786] support symlink files for PTS v2 embedding (main)#1377
Konboi merged 16 commits into
mainfrom
feature/LCHIB-786-support-symlink-main

Conversation

@Konboi

@Konboi Konboi commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why

Forward-port of #1375 (merged to v1) to main.

When a repository contains symlinks, PTS v2 file embedding failed to index them. The symlink entry's blob ID is just a string containing the target path — it never changes even if the target file's content changes — so the server-side dedup check would incorrectly skip re-embedding the symlink path when the target content changed.

What

  • Detect SYMLINK entries in collectFiles() in CommitGraphCollector.ByRepository
  • Resolve each symlink to its target's blob ID using resolveSymlinkTarget()
  • Send the symlink path with the resolved target blob content (so the server can embed path→content)
  • Restructure the dedup check to use the resolved content blob ID, so changes to the target are detected even when the symlink itself is unchanged
  • Skip symlinks that: point outside the repository (.. or absolute), are broken (target not found in tree), or point to non-regular files (directories, other symlinks)
  • Fix Windows path separator: resolved.toString() uses \ on Windows; normalize to / for JGit's TreeWalk.forPath

Please Review Here

  • collectFiles() loop restructuring (lines ~528–570): subtree dedup still uses the tree object ID correctly; regular files and symlinks now share the post-resolve dedup check
  • resolveSymlinkTarget(): uses the per-ByRepository objectReader (same as v1)

jothikumar-CB and others added 16 commits August 25, 2026 15:30
…-the-gate-command-output

feature/LCHIB-777: improve the gate command output to display actionable failure details
…-gate-command-output-v1

feature/LCHIB-777: remove stop command and escape content from ::
… 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>
…-symlink

feature/LCHIB-786: support symlink files for PTS v2 embedding
- CommitGraphCollector.java: keep main's `reportAllFiles` optimization
  and `readers::get` (ThreadLocal) for GitFile; apply v1's symlink
  support (resolveSymlinkTarget + restructured loop)
- CommitGraphCollectorTest.java: adapt v1's tests to main API
  (ByRepository.collectFiles instead of ByRepository.transfer)
- tests/commands/test_gate.py: drop v1's LAUNCHABLE_TOKEN duplicates,
  keep main's SMART_TESTS_TOKEN versions
- launchable/commands/gate.py: rm (already ported to smart_tests/)
- smart_tests/jar/exe_deploy.jar: rebuilt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Konboi
Konboi force-pushed the feature/LCHIB-786-support-symlink-main branch from 0e98b83 to 6ce707e Compare September 4, 2026 03:54
@Konboi
Konboi merged commit 1862b3d into main Sep 7, 2026
4 checks passed
@Konboi
Konboi deleted the feature/LCHIB-786-support-symlink-main branch September 7, 2026 01:13
@github-actions github-actions Bot mentioned this pull request Sep 7, 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.

3 participants