Repository navigation
fix(e2e): unblock golden file-link hover and Windows worktree activate - #14720
Conversation
Mac/Windows tmp paths wrap across xterm rows, so locateLink never found the full absolute path. Print ./package.json instead. createGoldenWorktree used os.tmpdir() (Windows 8.3 RUNNER~1) while Git listed the long path, so activateGoldenWorktree never matched. Realpath after worktree add and compare on the Node side.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe changes improve cross-platform golden worktree and terminal file-link tests. Worktree creation now stores native real paths, and path matching normalizes separators, case, macOS 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 44b50ed3-dc21-47b4-9d6b-2fcee3df622f
📒 Files selected for processing (3)
tests/e2e/golden-terminal-file-link.spec.tstests/e2e/helpers/golden-source-control.tstests/e2e/helpers/golden-source-control.unit.test.ts
Ensure half-built worktrees and branches are rolled back when realpathSync fails, preventing leaks into later test runs. Extract error handling into rollbackGoldenWorktree() for consistent cleanup.
stablyai#14720) * fix(e2e): unblock golden file-link hover and Windows worktree activate Mac/Windows tmp paths wrap across xterm rows, so locateLink never found the full absolute path. Print ./package.json instead. createGoldenWorktree used os.tmpdir() (Windows 8.3 RUNNER~1) while Git listed the long path, so activateGoldenWorktree never matched. Realpath after worktree add and compare on the Node side. * fix(e2e): handle realpath failures in golden worktree creation Ensure half-built worktrees and branches are rolled back when realpathSync fails, preventing leaks into later test runs. Extract error handling into rollbackGoldenWorktree() for consistent cleanup. (cherry picked from commit 2b10767)
stablyai#14720) * fix(e2e): unblock golden file-link hover and Windows worktree activate Mac/Windows tmp paths wrap across xterm rows, so locateLink never found the full absolute path. Print ./package.json instead. createGoldenWorktree used os.tmpdir() (Windows 8.3 RUNNER~1) while Git listed the long path, so activateGoldenWorktree never matched. Realpath after worktree add and compare on the Node side. * fix(e2e): handle realpath failures in golden worktree creation Ensure half-built worktrees and branches are rolled back when realpathSync fails, preventing leaks into later test runs. Extract error handling into rollbackGoldenWorktree() for consistent cleanup.
ELI5
Two release-blocking golden E2E tests were failing because the tests compared or hovered the wrong path spelling. The product already works. The file-link test printed a long tmp path that wrapped across terminal rows, and the Windows source-control goldens created a worktree under the 8.3
RUNNER~1tmpdir while Git listed the longrunneradminpath.What Changed
golden-terminal-file-link.spec.tsnow prints./package.json(one xterm row) and hovers viarect.width/colsinstead ofcss.cell.createGoldenWorktreerealpaths the worktree aftergit worktree add, andactivateGoldenWorktreecompares repo/worktree paths on the Node side withrealpathSync.nativeso Windows 8.3 aliases match Git's long path.No product SCM or terminal-link-handler changes.
Why
Cut Release v1.4.183 failed on run 31858444785:
golden-terminal-file-link.spec.ts:96—locateLinkdoesindexOf(fullAbsolutePath)per physical xterm row. Long/private/var/folders/...and Windows tmp paths wrap, so hover stayed null even thoughgetTerminalContent(SerializeAddon) saw the full path. Product already stitches wrapped paths; this is a test-locator limitation.activateGoldenWorktreedied withGolden worktree did not load: C:\Users\RUNNER~1\...while the sidebar listede2e-golden-...as Inactive under the long path.electron-home-isolationalready realpaths HOME for this reason; the extra golden worktree did not.Linked Issue
Blocked Cut Release v1.4.183 (run 31858444785; mac/linux file-link job, windows source-control job).
Visual Proof
N/A — test-harness only. No product UI, path-comparison, or linkifier behavior change.
Testing
goldenWorktreePathsMatchcovers 8.3 vs long path, slash/case fold, and distinct-path non-match;createGoldenWorktreeasserts native realpath is stored and used as Git cwd.pnpm exec vitest run --config config/vitest.config.ts tests/e2e/helpers/golden-source-control.unit.test.ts— 7 passedoxlint+oxfmton the three changed filesAI Disclosure
Review
Test-only path spelling. Cross-platform: Mac wrap + Windows 8.3 are the two CI failures. SSH/remote and product linkifier untouched.
Checklist
N/Awith reasonpnpm lint/typecheck/test/buildleft to CIAuthor