Repository navigation
fix(projects): refresh stale automatic GitHub icons during enrichment - #22421
Conversation
Based on the report and proposal by @mmarabel. Co-authored-by: mmarabel <[email protected]>
…81-project-identity
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughRepository identity enrichment now scopes repository lookups and updates by execution host. After a successful probe, it can refresh a repository’s existing GitHub image icon when the repository has no complete upstream and its provider identity resolves to a supported GitHub host. Added tests cover refresh timing, icon preservation, host ownership, and other eligibility conditions. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Automatic GitHub icon refresh works for normal repositories. However, when a local project shares an ID with a remote-host project, a local refresh can overwrite the remote project's identity or icon. Projects owned by a peer machine are also still probed with local 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
|
@coderabbitai review |
|
|
Independent review of the new ownership guard: it now prevents peer-owned metadata writes, but the same rows still reach |
There was a problem hiding this comment.
Important
The host-scoped read added in getCurrentRepo is not matched by a host-scoped write for local rows, so a client-local probe can land its identity/icon on a same-id SSH sibling row. One inline fix suggested.
Reviewed changes
- Automatic GitHub icon repair in the enrichment producer —
writeIdentitynow recomputes an automaticrepoIconfrom a resolved probe and writes it alongsidegitRemoteIdentity; the newgetAutomaticGitHubIconRefreshbails out for peer (runtime:) hosts, explicitupstream, non-github icons, non-GitHub probes, and unresolved SSH aliases. - Host-scoped current-row lookup —
getCurrentReponow resolves by(id, hostId)andRepoIdentityStore.getRepo/updateRepoaccept an optionalhostId; non-local writes pass it. - New regression test file —
repo-git-remote-avatar-refresh.test.tscovers the repair, custom/cleared icons, upstream preservation, provider-neutral remotes, the pending-probe race, folder workspaces, and cross-host id/path collisions.
ℹ️ A remote that leaves GitHub keeps its stale automatic icon
The repair only fires when the probed remote is still GitHub. If origin is re-pointed to a non-GitHub provider, getAutomaticGitHubIconRefresh returns undefined and the old github icon survives. Because getProjectProviderIdentity reads the github icon ahead of gitRemoteIdentity, the repo then keeps projecting under the old GitHub id even though the canonical key was updated. This looks intentional per the PR body ("preserves provider-neutral remotes"), but it is the same stale-automatic-metadata class the PR targets, so it is worth stating explicitly as out of scope (or clearing the automatic icon when a probe resolves to a non-GitHub provider).
Technical details
# Non-GitHub probe leaves the automatic github icon in place
## Affected sites
- `src/main/repo-git-remote-identity-enrichment.ts:143-145` — `icon` is `undefined` whenever the probed identity is not GitHub.
- `src/shared/project-host-setup-projection.ts:40-61` — `getProjectProviderIdentity` returns the github-icon identity before falling back to `gitRemoteIdentity`.
## Required outcome
- Either confirm GitHub→non-GitHub transitions are explicitly out of scope, or clear/refresh the automatic icon so the projection stops deriving the old GitHub project id.
## Open questions for the human
- Is the linked issue scoped to GitHub→GitHub only, or should an origin move off GitHub also detach the project id?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 52cffde9-dfef-4b70-b574-a68d44f442ba
📒 Files selected for processing (2)
src/main/repo-git-remote-avatar-refresh.test.tssrc/main/repo-git-remote-identity-enrichment.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.
There was a problem hiding this comment.
ℹ️ Delta is clean — the peer guard now covers all metadata writes. One item from the earlier review (unscoped local write) remains open and this commit does not touch it.
Reviewed changes (since a452dd4)
- Peer-owned metadata is now fully guarded — the host check moved out of
getAutomaticGitHubIconRefreshintowriteIdentity, so aruntime:(or any non-SSH, non-local) row can no longer have eithergitRemoteIdentityorrepoIconwritten from a client-local probe. This closes the identity-write half that the earlier icon-only guard left open. - Parametrized regression test —
does not write peer-owned metadata from a client-local probe when identity is same/different/missingasserts both fields are untouched and no write occurs; thedifferentandmissingcases are the ones the new guard fixes.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
The host-boundary findings are fixed in 56cd66f: peer-owned rows are never probed here, and all metadata writes carry their execution host, including local. The 96 focused tests, Node typecheck and changed-code quality pass. The non-GitHub transition note is intentionally outside this bounded repair. A GitHub-to-other-provider remote change leaves the stored icon unchanged; the PR body now states that limitation explicitly. This change does not alter provider precedence or clear user-visible metadata across mixed client/host versions. |
…rows (#23300) A repo row stamped `executionHostId: runtime:<env>` is how a paired client addresses a project registered in *this* process, so its files are local (`runtime-repository-registration-controller.ts`, and the helper #23184 added in `repo-execution-host.ts`). #22421 reclassified those rows as peer-owned and dropped them from the identity sweep, so `gitRemoteIdentity` never settled on remote-runtime and paired-web setups: the project stayed pending, fell back to a host-local `repo:<id>` that never grouped across hosts, and a stale automatic avatar never repaired. Reuse `getStoredRepoExecutionHostId` instead of a second host classifier, and keep skipping only a `runtime:` row that also names a nested SSH target — that target lives in the peer's dispatch table and the same path here is a different checkout. The store matches a write against the row's own stamp, so address `updateRepo` by that stamp rather than the probe host, which is `local` for these rows and would match no row at all.
…f failing silently (#23379) `Store.updateRepo` takes an optional `hostId` that must be the row's own `executionHostId` stamp. When it is anything else the lookup matches no row and the method returns `null` — the same value a deleted row returns — so the write is dropped with no error, no log, and no failing test. #22421 shipped exactly that: identity enrichment addressed the probe host (`local`) instead of a `runtime:` row's stamp, and every write was discarded for a full release. Resolve the row through `findRepoRowForHostScopedWrite`, which logs once when the id exists but only under other host stamps, naming the requested host and the stored ones. The guard itself is unchanged: a matching host still writes, and a client-local probe still cannot repair a peer's row.

ELI5
A confirmed GitHub remote refresh also repairs an old automatically selected project icon.
What Changed
The existing identity enrichment producer updates GitHub-source automatic icons after a resolved GitHub probe, including when the canonical key is already current. It preserves explicit upstream, custom/cleared icons, unresolved SSH aliases, provider-neutral remotes, folder workspaces and host/path ownership.
Why
Repair stored automatic metadata through the existing producer. Reordering project identity precedence would change IDs across mixed client/host versions and regress unresolved SSH aliases. This patch keeps that projection unchanged and adds no new polling.
Linked Issue
Related to #21515, #21881 and #21890. Reported by @mmarabel; @bbingz supplied the alternative proposals evaluated here. This does not follow GitHub redirects, rewrite origin, or claim to solve every transfer/rename case. Moving a remote from GitHub to another provider deliberately leaves its stored icon unchanged; that transition is outside this bounded repair.
Visual Proof
N/A — this is a host metadata enrichment change with no renderer, layout or interaction change. Controlled producer/projection fixtures prove that corrected automatic metadata groups consistently under the existing projection. No live SSH/paired runtime, rendered full-app run or automatic GitHub transfer/rename behavior is claimed.
Testing
96 enrichment, provider identity and projection tests pass against the reviewed main baseline. The ownership review reproduced two peer-write failures first, then five probe/write-boundary failures before the final correction. The suite also covers a pending local probe whose row becomes peer-owned. Node typecheck and changed-code quality pass. Executed on macOS with controlled probes only.
ORCA_BACKGROUND_LAUNCH=1AI Disclosure
Review
Independent review confirms the accepted producer update avoids the rejected projection reorder and its demonstrated version-skew failure. Follow-up review caught three ownership gaps. All metadata writes now enforce the snapshot’s host, local writes explicitly pass the local host ID, and peer-owned rows are excluded before probing. The write-side guard and stale-row check remain for in-flight ownership changes. Local and direct-SSH probes keep their existing routes; startup delay, bounded sweeps and six-hour refresh interval remain unchanged.
Agent skill upstream boundary
Notes
All current CI checks pass. An initial shard hit an unchanged palette-search timing budget (190.6 ms against 180 ms); all nine palette performance tests passed locally and the single targeted CI retry passed. No palette source or timing limit was changed.
Checklist