orca icon indicating copy to clipboard operation
orca copied to clipboard

Normalize e2e repo path matching

Open brennanb2025 opened this issue 5 months ago • 1 comments

## Description

  • Normalize e2e repo/worktree path matching through the shared runtime path comparison helpers instead of strict string equality.
  • Move seeded e2e git repo creation out of the oversized Playwright fixture into a concrete seeded-e2e-git-repo module.
  • Move repo/worktree path snapshot matching into e2e-runtime-path-matching so the fixture stays under max-lines without disabling lint.
  • Apply the same normalized matching to the no-upstream polling churn repro so that Windows path spelling differences do not block that crash-adjacent smoke.

Evidence

Crash-pass context: while validating Windows renderer crash work, the worktree lifecycle smoke was blocked before it could exercise worktree switching because the fixture could not find the repo it had just added on Windows:

Expected e2e repo to be loaded: C:\Users\neil\AppData\Local\Temp\orca-e2e-repo-...

The no-upstream polling churn repro hit the same Windows path identity blocker inside the spec itself:

Expected repo to be loaded: C:\Users\neil\AppData\Local\Temp\orca-e2e-repo-...

Before this change, those focused smokes failed during setup. After this change, both reach their actual assertions and pass.

Validation run on Windows:

pnpm exec oxlint tests/e2e/helpers/orca-app.ts tests/e2e/helpers/e2e-runtime-path-matching.ts tests/e2e/helpers/seeded-e2e-git-repo.ts
pnpm exec oxlint tests/e2e/git-no-upstream-polling-churn.spec.ts tests/e2e/helpers/e2e-runtime-path-matching.ts
pnpm exec oxfmt --check tests/e2e/helpers/orca-app.ts tests/e2e/helpers/e2e-runtime-path-matching.ts tests/e2e/helpers/seeded-e2e-git-repo.ts
pnpm exec oxfmt --check tests/e2e/git-no-upstream-polling-churn.spec.ts tests/e2e/helpers/e2e-runtime-path-matching.ts
pnpm run typecheck
SKIP_BUILD=1 ORCA_E2E_FORWARD_APP_LOGS=1 npx playwright test tests/e2e/worktree-lifecycle.spec.ts --grep 'switching worktrees preserves per-worktree state' --config tests/playwright.config.ts --project electron-headless --workers=1
SKIP_BUILD=1 ORCA_E2E_FORWARD_APP_LOGS=1 npx playwright test tests/e2e/git-no-upstream-polling-churn.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1

Result: typecheck/lint/format passed; both focused e2e smokes passed with Electron exit code 0.

ELI5

The tests were comparing two Windows paths like they had to be typed exactly the same way. Windows paths can still point to the same folder when their slashes or capitalization differ, so the tests sometimes could not recognize their own temporary repo. This teaches the tests to compare paths the same way Orca does.

Tradeoffs

  • This is test/repro infrastructure, not a direct renderer crash fix.
  • The fixture and no-upstream repro now do a tiny bit more work outside the renderer by collecting repo/worktree snapshots and selecting IDs in Node. That makes the path comparison consistent and keeps renderer page.evaluate calls simpler.

brennanb2025 avatar Jul 03 '26 08:07 brennanb2025

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds two E2E helper modules for seeded Git repo creation and runtime-path snapshot matching. It then refactors orca-app.ts and git-no-upstream-polling-churn.spec.ts to use those helpers, fetch repo and worktree candidates from the renderer store, match by normalized runtime path, set worktree visibility, and select active worktrees by id.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is informative, but it does not follow the required template sections and omits Screenshots, AI Review Report, Security Audit, and Notes. Rewrite it to match the template with Summary, Screenshots, Testing checkboxes, AI Review Report, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: normalizing e2e repo path matching.

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[bot] avatar Jul 03 '26 08:07 coderabbitai[bot]

Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-03T08:32:48Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes.

OrcaWin avatar Oct 27 '26 09:10 OrcaWin