Skip to content

fix(e2e): unblock golden file-link hover and Windows worktree activate - #14720

Merged
AmethystLiang merged 2 commits into
mainfrom
golden-e2e-fix
Aug 15, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
golden-e2e-fix

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

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~1 tmpdir while Git listed the long runneradmin path.

What Changed

  • golden-terminal-file-link.spec.ts now prints ./package.json (one xterm row) and hovers via rect.width/cols instead of css.cell.
  • createGoldenWorktree realpaths the worktree after git worktree add, and activateGoldenWorktree compares repo/worktree paths on the Node side with realpathSync.native so Windows 8.3 aliases match Git's long path.
  • Unit tests cover 8.3 vs long-path matching and that setup/config cwd uses the canonical path.

No product SCM or terminal-link-handler changes.

Why

Cut Release v1.4.183 failed on run 31858444785:

  1. Mac + Windows golden-terminal-file-link.spec.ts:96 — locateLink does indexOf(fullAbsolutePath) per physical xterm row. Long /private/var/folders/... and Windows tmp paths wrap, so hover stayed null even though getTerminalContent (SerializeAddon) saw the full path. Product already stitches wrapped paths; this is a test-locator limitation.
  2. Windows three source-control goldens — activateGoldenWorktree died with Golden worktree did not load: C:\Users\RUNNER~1\... while the sidebar listed e2e-golden-... as Inactive under the long path. electron-home-isolation already 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

  • Automated tests added/updated: goldenWorktreePathsMatch covers 8.3 vs long path, slash/case fold, and distinct-path non-match; createGoldenWorktree asserts 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 passed
  • oxlint + oxfmt on the three changed files
  • I did not re-run the full Electron golden E2E locally (needs the CI Electron matrix: macOS / Windows / Linux)

AI 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

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Targeted unit tests pass; full pnpm lint / typecheck / test / build left to CI

Author

  • X / Twitter: @JinjingLiang

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.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27c93328-db67-4585-bcf6-e4e63ef1c685

📥 Commits

Reviewing files that changed from the base of the PR and between fdff0b4 and f866b37.

📒 Files selected for processing (1)
  • tests/e2e/helpers/golden-source-control.ts

📝 Walkthrough

Walkthrough

The 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 /private prefixes, and trailing slashes. Worktree activation matches repository data in Node before setting active identifiers. Terminal link tests derive coordinates from rendered terminal dimensions, print a cwd-relative path, and compare normalized popover destinations with the resolved file path.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both primary test-harness fixes: terminal file-link hovering and Windows worktree activation.
Description check ✅ Passed The description covers the required sections, explains the changes and rationale, documents testing, and identifies the remaining CI validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0f7707b and fdff0b4.

📒 Files selected for processing (3)
  • tests/e2e/golden-terminal-file-link.spec.ts
  • tests/e2e/helpers/golden-source-control.ts
  • tests/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.
@AmethystLiang
AmethystLiang merged commit 2b10767 into main Aug 15, 2026
42 checks passed
julien-herrera pushed a commit to Oxeegen/OxeeUI that referenced this pull request Aug 19, 2026
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)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.
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.

1 participant