Skip to content

Support org SSH users and gh-resolved remotes for pull request review#131

Open
KATT wants to merge 1 commit into
nkzw-tech:mainfrom
KATT:pr-remote-custom-ssh-users
Open

Support org SSH users and gh-resolved remotes for pull request review#131
KATT wants to merge 1 commit into
nkzw-tech:mainfrom
KATT:pr-remote-custom-ssh-users

Conversation

@KATT

@KATT KATT commented Jul 17, 2026

Copy link
Copy Markdown

AI written below, but a human has read it too

Background

codiff pr <number> (and PR URLs) fail with "Pull request owner/repo does not match a GitHub remote in this repository." in repositories whose remotes don't use the plain git@github.com: SSH user. GitHub organizations with SSO/SSH certificates issue remotes as org-<id>@github.com:owner/repo.git, and some setups hide the host entirely behind SSH aliases or insteadOf rewrites. The CLI-side remote parser already handles these, but the pull request load/review path uses a stricter parser, so opening or reviewing PRs is impossible in such repositories even though gh itself is authenticated and working.

Changes

  • parseGitHubRemoteUrl now recognizes org-<id>@github.com: SSH remotes alongside git@github.com:.
  • When no remote parses to the PR's owner/repo but a remote exists whose URL hides the github.com host (SSH host alias, insteadOf rewrite), the repository is resolved through gh repo view --json owner,name and that remote is used for fetching PR refs. The lookup only runs in that case — repos with parseable remotes never spawn it — and the result is cached per repository. Genuine mismatches fail fast with the existing error.
  • Added a test covering both paths: an org-<id> remote matching through parsing alone (no gh repo view call), and an aliased-host remote resolving through gh.

Test plan

  • vp test electron/__tests__/pull-request-review.test.ts electron/__tests__/command-line.test.ts (19/19)
  • vp check --fix clean
  • vpr build and manually opened a PR with codiff in a repository whose origin uses an org-<id>@github.com remote

banana banana banana

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@KATT
KATT marked this pull request as ready for review July 17, 2026 11:51
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