Repository navigation
Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Important
The reorder makes the raw probed remote authoritative over a correctly resolved avatar, which exposes an inconsistency for dotless SSH host aliases. A repo cloned through an alias named github-* / ghe-* now keys as GHES (github:github-work/owner/repo) instead of github:owner/repo, splitting it from its github.com siblings. Details inline.
Reviewed changes
- Precedence reorder —
getProjectProviderIdentity()now evaluates the probedgitRemoteIdentitybefore the cached GitHubrepoIcon.label, so a renamed/transferred repo (owner-a/app→org-b/app) no longer stays grouped under the stale icon on machines that cached it. - Rename regression test — both repos carry remote
org-b/app; one keeps a staleowner-a/appicon; asserts a single projectgithub:org-b/app. This test genuinely fails against the old ordering (two projects), so it pins the fix. isGitHubBackedRepotest — covers a remote-only repo; see nitpicks.
I verified the same-name-fork parent preference (githubAvatarSlug) is not regressed: a same-name fork always carries repo.upstream, which is still evaluated first, and icon/upstream are written atomically by detectRepoIconAndUpstream. Re-keying of persisted project ids is also handled by carryProjectStateThroughIdentityChange.
ℹ️ Nitpicks
- The deleted
// Why: the remote URL retains HTTP(S) endpoint ports that the canonical key omits...comment explained a load-bearing ordering (parseGitHubRemoteUrlbeforeparseGitHubCanonicalKey, still exercised by thepreserves GHES HTTP portstest). Consider restoring it abovefromRemote. - The new
isGitHubBackedRepotest passes against the old code too —getProjectProviderIdentityalready evaluatedgitRemoteIdentitylast, so it documents behavior but does not pin this change.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const fromRemote = | ||
| parseGitHubRemoteUrl(repo.gitRemoteIdentity?.remoteUrl) ?? | ||
| parseGitHubCanonicalKey(repo.gitRemoteIdentity?.canonicalKey) | ||
| if (fromRemote) { | ||
| return fromRemote | ||
| } |
There was a problem hiding this comment.
The reorder makes this branch authoritative over a correctly resolved avatar, but parseGitHubRemoteUrl / parseGitHubCanonicalKey keep the remote's host verbatim. For a dotless SSH alias such as github-work, isGitHubRemoteHost() matches the github- prefix, so the project keys as github:github-work/owner/repo, while the icon for the same repo was resolved through ssh -G to github.com/owner/repo. That splits alias-cloned repos from their github.com siblings — the same failure mode this PR fixes.
Technical details
# Unresolved SSH alias hosts leak into the project identity key
## Affected sites
- `src/shared/project-host-setup-projection.ts:42-47` — the newly prioritized remote branch returns a host-qualified identity for a dotless alias host.
- `src/shared/project-host-setup-projection.ts:144-155` — `isGitHubRemoteHost()` treats `github-*` / `ghe-*` hosts as GHES without consulting `isUnresolvedSshHostAlias`.
- `src/shared/git-remote-host-alias.ts:42` — `isUnresolvedSshHostAlias`: a dotless host is an OpenSSH `Host` alias, unexpandable from `git remote -v`.
- `src/shared/git-remote-identity.ts:44` — the comparison path already treats dotless hosts as `'unknown'`, so the projection path is inconsistent with it.
## Reproduction
Repo cloned as `git@github-work:org/app.git` with `HostName github.com` in `~/.ssh/config`, plus a github-sourced `repoIcon` (avatar detection resolves the alias to `github.com`). Before the reorder: icon → `github:org/app`. After: remote `canonicalKey` `github-work/org/app` → `github:github-work/org/app`.
## Required outcome
An unexpanded dotless SSH alias must not mint a host-qualified GHES project id while a resolved identity (the icon) exists; both identity paths should agree on github.com.
## Suggested approach
Either skip `fromRemote` when `fromRemote.host` is a dotless alias (fall through to the icon), or update `isGitHubRemoteHost` to return false for `isUnresolvedSshHostAlias(host)` so every identity path agrees.|
Closing as superseded by merged #22421, which carries the reviewed fix and regression coverage. Thank you for the original contribution. The merged approach repairs automatic metadata at its owning host rather than changing identity precedence across mixed client/host versions. |

ELI5
When a repository is renamed or transferred to a new organization on GitHub, Orca should group all worktrees across different computers under the updated repository name instead of keeping them split apart under old names.
What Changed
owner-a/apptoorg-b/app), existing machines that had already cached the old avatar icon label would continue to group the repository undergithub:owner-a/app. A newly added machine would derivegithub:org-b/app. This caused the sidebar to show duplicate project rows split across machines for the same repository with no way to merge them.github:org-b/app), unifying worktrees into a single project row across local and remote hosts.getProjectProviderIdentity()(src/shared/project-host-setup-projection.ts), evaluate the probedgitRemoteIdentitybefore falling back to cachedrepoIconavatar metadata.Why
Probed
gitRemoteIdentityis the authoritative source of truth for the active repository remote and is continuously refreshed (every 6h byrepo-git-remote-identity-enrichment.ts). In contrast,repoIcon.labelis a static presentation artifact captured once during initial clone or import. Prioritizing the authoritative remote identity over cached avatar labels ensures that renames and transfers take effect immediately and consistently across all connected execution hosts.Alternatives considered:
repoIconandupstreamin the periodic identity enrichment sweep: This would require network calls or GitHub API queries in the background sweep and would not fix project grouping on hosts before the sweep runs or on offline/disconnected clients. Evaluating the already-probedgitRemoteIdentityin the projection is immediate, pure, and does not require extra network requests.Linked Issue
Fixes #21515
Visual Proof
N/A - This fixes repository identity resolution and project grouping logic across hosts; no new UI primitives or styles were introduced.
Testing
prefers probed git remote identity over stale cached avatar icon label across renamesinsrc/shared/project-host-setup-projection.test.ts.isGitHubBackedRepotest coveringgitRemoteIdentityinsrc/shared/project-host-setup-projection.test.ts.node config/scripts/check-changed-code-quality.mjs(passed with 0 findings)node config/scripts/check-max-lines-ratchet.mjs(passed with 0 new bypasses)tsc --noEmitacross CLI, Node, and Web configurations (all passed)vitest runonproject-host-setup-projection.test.tsandrepo-git-remote-identity-enrichment.test.ts(60 passed)AI Disclosure
Developed with Google Antigravity.
Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)