Skip to content

fix(github): resolve owner/repo through SSH Host aliases - #10360

Closed
innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/github-ssh-host-alias-owner-repo
Closed

innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/github-ssh-host-alias-owner-repo

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Summary

  • After a literal github.com host parse misses, expand SSH config Host → HostName (then ssh -G when needed) so multi-account remotes like git@github-work:owner/repo resolve to github.com.
  • Wire the expansion into getOwnerRepoForRemote (local host only — SSH-provider remotes stay on the literal parser).
  • Leave the remote URL unchanged for Git transport so the correct IdentityFile still applies.

Fixes #10284.

Why

parseGitHubOwnerRepo rejects any host that is not literally github.com. SSH config Host aliases are common for multiple GitHub accounts; HostName is already github.com / ssh.github.com, but Orca never expanded it, so Squash and merge failed with “Could not resolve GitHub owner/repo for this repository” even though the PR UI worked.

Test plan

  • pnpm exec vitest run --config config/vitest.config.ts src/main/github/github-remote-identity-parsing.test.ts (19)
  • Manual: git@github-work:OWNER/REPO remote + Squash and merge succeeds when HostName maps to github.com

Screenshots

No visual change.

parseGitHubOwnerRepo only accepts a literal github.com host token, so
multi-account remotes like git@github-work:org/repo failed PR merge with
"Could not resolve GitHub owner/repo" even when HostName maps to
ssh.github.com / github.com.

After the sync parse miss, expand the remote host via ~/.ssh/config HostName
(and ssh -G when needed) before classifying as github.com. Keep the original
remote URL for Git transport so the correct IdentityFile still applies.

Closes stablyai#10284
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@innocarpe, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba440311-3605-4fb5-a387-a15e58ede23a

📥 Commits

Reviewing files that changed from the base of the PR and between 1bd36ce and a9ee7d3.

📒 Files selected for processing (4)
  • src/main/github/github-owner-repo-ssh-alias.ts
  • src/main/github/github-remote-identity-parsing.test.ts
  • src/main/github/github-remote-identity-parsing.ts
  • src/main/github/github-repository-identity.ts

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.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks for jumping on this and for the initial SSH-alias implementation. #10361 has now merged with the same core fix plus runtime-scoped resolution for native, WSL, and SSH workspaces; retryable failure handling; case-sensitive alias caching; reconnect isolation; and GHES coverage. Closing this as superseded.

@nwparker nwparker closed this Jul 26, 2026
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.

[Bug]: GitHub PR merge fails when origin uses an SSH config Host alias

3 participants