Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop grouping unrelated repos that only have a local git remote #13129

Mergedadambuchweitz(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/13129/headmerged by juliusmarminge View on GitHub

What Changed

The repository identity resolver now ignores remotes whose URL is a local path: ., relative or absolute paths, ~, Windows drive or UNC paths, and file://. It applies git's own rule, where host:path counts as scp-style only when the colon comes before any slash. If a repo has only local remotes, it gets no identity and uses its per-path key. If it has a local remote and a real one, it uses the real one.

Added a resolver test covering local-only and mixed remote sets.

Why

A local-path remote URL isn't a repository identity, but the resolver used it as one. normalizeGitRemoteUrl returns a path like . unchanged. As a result, every repo whose chosen remote is . gets the same canonical key.

This shows up in the sidebar. Projects are grouped by canonical key, so unrelated projects merge into one group, and that group is labeled with whichever member's title was picked. Threads then appear under the wrong project. A common way to hit this is a repo with no origin/upstream whose only remote is a local one, such as the gb-local → . remote GitButler adds.

Clones of a local bare repo (e.g. /srv/git/repo.git) intentionally stop grouping as well. An absolute path isn't a portable identity, and grouping works across environments.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes N/A: this changes how projects are grouped, not the UI
  • I included a video for animation/interaction changes N/A

Written by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 19b6b0a0-cf07-4b0c-9845-b8bd6674bb8e
      📥 Commits

      Reviewing files that changed from the base of the PR and between 5ae9b6b7a4873c7f7eb69b37ec9f74b0428e2120 and 7cb21dbd044543a91eae6a8b87f7897e74b36389.

      📒 Files selected for processing (2)
      • apps/server/src/project/RepositoryIdentityResolver.test.ts
      • apps/server/src/project/RepositoryIdentityResolver.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      The repository identity resolver now excludes local-path remotes, including file: URLs and drive-letter paths. Tests cover repositories with only local remotes and repositories with both local and GitHub remotes.

      Changes

      Repository identity resolution

      Layer / File(s)Summary
      Local remote filtering and validation
      apps/server/src/project/RepositoryIdentityResolver.ts, apps/server/src/project/RepositoryIdentityResolver.test.ts
      The resolver identifies local-path remote URLs and skips them during fetch URL parsing. Tests verify null for local-only remotes and GitHub identity resolution when a GitHub remote is also present.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 7cb21

      No actionable merge-blocking issue is established for local-remote filtering; merge after normal checks.

      Architecture Summary

      Architecture risk: 🟡 Medium · up to 7cb21

      The change affects 1 system.

      Changed systems: apps/server

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — apps/server (service) was modified; 2 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/server/src/project/RepositoryIdentityResolver.test.ts: Added a test for repositories with local-path remotes. It expects resolution to return null when all remotes are local paths, and to select the GitHub mirror remote when it appears alongside gb-local.
      • observed — Modified behavior in apps/server/src/project/RepositoryIdentityResolver.ts: Added isLocalRemoteUrl to identify local remotes: file: URLs and drive-letter paths are local; scheme:// URLs are not; other values are local when they have no colon or a slash precedes the colon.
      • observed — Modified behavior in apps/server/src/project/RepositoryIdentityResolver.ts: parseRemoteFetchUrls now also skips remotes classified as local, in addition to skipping non-fetch entries and entries with empty names or URLs.

      Reliability and maintainability

      • inferred — Risk-relevant change factors for apps/server: blast_radius_1; direct_dependents_1
      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Description check⚠️ WarningThe description clearly explains the problem, the implementation, and the intended behavior. It does not include the required Scope and approval section, and it does not provide a Verification section…Add a Scope and approval section with the linked issue or maintainer approval, or explain why this focused obvious bug qualifies for the exemption. Add a Verification section that lists the resolver tests or commands run, their observed res…
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Approvability✅ PassedPASS. The pull request changes only apps/server/src/project/RepositoryIdentityResolver.ts and its test. It is a focused bug fix that filters local-path Git remotes from repository identity resolutio…
      Title check✅ PassedThe title clearly describes the main change: preventing unrelated repositories with only local Git remotes from sharing an identity. It is concise and follows the repository's conventional commit styl…
      Full details: Description check

      Explanation

      The description clearly explains the problem, the implementation, and the intended behavior. It does not include the required Scope and approval section, and it does not provide a Verification section with focused test commands and observed results.

      Resolution

      Add a Scope and approval section with the linked issue or maintainer approval, or explain why this focused obvious bug qualifies for the exemption. Add a Verification section that lists the resolver tests or commands run, their observed results, and any checks that were not run.

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches 💡 1
      🛠️ Fix failing CI checks 💡
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    3. juliusmarminge added labelsmacroscope-review

    4. Approvability

      Verdict: Approved at 5ae9b6b

      Macroscope's review found this PR approvable — This is a small, well-scoped bug fix that prevents local filesystem remotes from becoming shared repository identities while preserving hosted remote resolution. Focused tests cover both local-only and mixed-remote repositories, with no product-default or static-analysis configuration changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged this19f3f6d

    6. juliusmarminge closed this

Sign in to join this conversation.