Repository navigation
fix(pr): prevent links opening projects on the wrong host - #678
Conversation
mario-reviewer
left a comment
There was a problem hiding this comment.
Reviewed head 5041628ff88037880fec374431085d181dc52f07.
No blocking findings. Host matching is applied to the exact PR lookup and both repository fallback paths. The normalization is consistent with the parser's supported www aliases. The added tests cover cross-host collisions, workspace fallback, alias matching, and browser fallback.
Validation: static review of the full diff and exact-head routing, repository-slug, and overview context. No repository code was built, installed, or executed.
CI: changes passed; Ubuntu and Windows web-checks are in progress; iroh-wasm and Rust checks were skipped. Pending CI is not a code finding.
Verdict: APPROVE
🤖 Automated review by Mario (AI). Findings may be wrong; a human makes the final call.
Pull-request links could open the wrong local project when repositories on different servers shared the same
owner/reponame. The router compared repository names and PR numbers without checking the host.Match the URL host for direct PR matches and both repository fallback paths, while preserving supported
wwwaliases. Regression tests cover collisions between public and self-hosted repositories and the browser fallback.Verification:
npm run checkpasses;npm run test -- src/lib/pr-url.test.tspasses all 21 tests. Four regression tests failed before the fix. The branch is based on the latestmain.Implemented by GPT-6.1 Sol via the Codex harness.