Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): recognize partial-clone remote annotations #16316

Mergedmaxwellyoung(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/16316/headmerged by juliusmarminge View on GitHub

Problem

Partial clones add a filter annotation to git remote -v, such as (fetch) [blob:none]. The anchored parsers rejected those valid lines, losing repository identity, remote listings and existing remotes that should be reused. The same parsing issue could also bypass GitHub's marked repository selection or Forgejo's host-specific remote lookup.

Change

Accept the optional trailing annotation in all five readers: the three server readers, GitHub repository resolution and Forgejo host lookup. Preserve fetch versus push handling, URL captures, GitHub remote ranking, Forgejo host/HTTP filtering, and main's exclusion of local-path remotes from repository identity.

The implementation keeps these local parsing changes small and adds brief comments explaining Git's output format.

Scope and approval

Maintainer takeover of maxwellyoung's contribution, preserving the contributor commits and merging main. The review found the same defect in the two source-control package readers, which are included in this fix. No transport, client, provider-runtime, dependency or product-default changes.

Verification

  • Reduced the 12 filter-variant regression cases to three real-Git behavior tests: repository identity with a distinct push URL, remote listing, and remote reuse/name collision. All 237 unrelated server cases remain. The three server files passed 240 tests; all three retained regressions fail with main's parsers.
  • Added one marked-repository assertion to an existing GitHub test and adapted an existing Forgejo host-lookup fixture. No new package test cases were added. The GitHub and Forgejo suites passed 3 and 23 tests; each affected behavior fails when its old parser is restored.
  • Both fresh second-round reviewers independently passed the three real-Git regressions and all 26 package cases at the final head, checked all five parser paths, and found no remaining defects.
  • Scoped server and package typechecks, changed-file lint/format checks and cumulative whitespace checks pass. Reported lint warnings are on unchanged main lines.
  • Proof uses Git 2.47.3 with disposable repositories on Linux, plus package service tests and actual annotated output. No browser, installed desktop, mobile, Windows or current macOS run is claimed. This is nonvisual parsing behavior; no screenshots are used as evidence.

Example Git output accepted by the tests:

origin  https://github.com/example/repo.git (fetch) [blob:none]
origin  https://github.com/example/repo.git (push)

Current-head CI must run after publication; checks on the previous contributor head do not validate this revision.

Prepared through T3 Code: Opus 5.5 test reduction and review, Fable 5.1 implementation, and GPT-6.1 Sol coordination and independent review, using Claude Code and Codex harnesses.

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at ab39784

      Macroscope's review found this PR approvable — This is a localized parser bug fix: five production readers accept Git’s optional partial-clone annotation while preserving existing remote behavior, with tests covering identity, remote reuse/listing, GitHub selection, and Forgejo lookup. Product defaults, schemas, deployment settings, and static-analysis configuration are unchanged.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Warning

      Review limit reached

      Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

      Next included review available in 3 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used all 10 included reviews currently available.

      Learn how review limits work.

      Review configuration:

      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: a210a346-b2c9-466a-b5b9-1fef0c8e9430
      📥 Commits

      Reviewing files that changed from the base of the PR and between ab39784f53004aab45df42d9403872cce65a396c and 49495f7cdaa73ceb14ccd7476b63eaadda0dca42.

      📒 Files selected for processing: 10
      • apps/server/src/project/RepositoryIdentityResolver.test.ts
      • apps/server/src/project/RepositoryIdentityResolver.ts
      • apps/server/src/vcs/GitVcsDriver.test.ts
      • apps/server/src/vcs/GitVcsDriver.ts
      • apps/server/src/vcs/GitVcsDriverCore.test.ts
      • apps/server/src/vcs/GitVcsDriverCore.ts
      • packages/source-control-forgejo/src/server/ForgejoCli.ts
      • packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
      • packages/source-control-github/src/server/gitHubRepositoryResolution.test.ts
      • packages/source-control-github/src/server/gitHubRepositoryResolution.ts

      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: f9df6eab-7d9b-44c9-87f9-63616aaa343f
      📥 Commits

      Reviewing files that changed from the base of the PR and between d0f3c59363c03fcc616904d45ac49423b2ed492b and ab39784f53004aab45df42d9403872cce65a396c.

      📒 Files selected for processing: 10
      • apps/server/src/project/RepositoryIdentityResolver.test.ts
      • apps/server/src/project/RepositoryIdentityResolver.ts
      • apps/server/src/vcs/GitVcsDriver.test.ts
      • apps/server/src/vcs/GitVcsDriver.ts
      • apps/server/src/vcs/GitVcsDriverCore.test.ts
      • apps/server/src/vcs/GitVcsDriverCore.ts
      • packages/source-control-forgejo/src/server/ForgejoCli.ts
      • packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
      • packages/source-control-github/src/server/gitHubRepositoryResolution.test.ts
      • packages/source-control-github/src/server/gitHubRepositoryResolution.ts

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

      📝 Walkthrough

      Git remote parsers now accept optional bracketed annotations after fetch and push markers. Tests cover remote listing, repository identity resolution, remote reuse, and Forgejo and GitHub repository selection.

      Changes: Partial-clone remote handling

      Layer / File(s)Summary
      Annotated remote parsing and validation
      apps/server/src/vcs/GitVcsDriver.ts, apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/project/RepositoryIdentityResolver.ts, packages/source-control-forgejo/src/server/ForgejoCli.ts, packages/source-control-github/src/server/gitHubRepositoryResolution.ts, apps/server/src/vcs/GitVcsDriver.test.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts, apps/server/src/project/RepositoryIdentityResolver.test.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts, packages/source-control-github/src/server/gitHubRepositoryResolution.test.ts
      The parsers accept optional trailing bracketed annotations on remote entries. Tests cover fetch and push URL handling, repository identity resolution, remote reuse, and Forgejo and GitHub repository selection.

      Priority: ➖ Normal

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

      Change: Bug fix

      Possibly related PRs

      • pingdotgg/t3code#15172: Both changes handle partial-clone annotations in Git remote output and update repository resolution and remote selection.

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to ab397

      Git remotes in partial clones, which show annotations such as [blob:none], are now recognized for repository identity, remote listing, remote reuse, and GitHub and Forgejo selection. Tests cover these paths, and no merge-blocking risk is evident.

      ### Architecture Summary

      Architecture risk: 🔵 Low · up to d0f3c

      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; 6 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/server/src/vcs/GitVcsDriver.test.ts: Added the Option import used to assert the optional push URL in the new remote test.
      • observed — Modified behavior in apps/server/src/vcs/GitVcsDriver.test.ts: Added a test for blob:none, blob:limit=1024, tree:0, and combine:blob:none+tree:1. For each filter, it creates a repository, configures an origin fetch URL and a different push URL, marks the remote as a promisor with that partial-clone filter, and asserts that listRemotes reports the fetch URL, the push URL as Option.some, and isPrimary: true.
      • observed — Modified behavior in apps/server/src/project/RepositoryIdentityResolver.test.ts: Added a test covering four partial-clone filter values. For each, it configures origin with a GitHub fetch URL and separate push URL, enables partial-clone settings, verifies the filter appears on Git’s fetch remote, and asserts resolution uses the fetch URL and origin to produce the expected repository identity.
      • observed — Modified behavior in apps/server/src/project/RepositoryIdentityResolver.ts: parseRemoteFetchUrls gains documentation for annotated verbose-remote entries and extends its line matcher to accept an optional whitespace-prefixed bracketed annotation after (fetch) or (push). Fetch-only filtering remains unchanged.
      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title is concise, specific, and accurately summarizes the primary change: support for partial-clone remote annotations.
      Description checkPassedThe description includes all required sections and clearly explains the problem, implementation, scope, affected components, focused verification, limitations, and test results. The scope section iden…
      Full details: Description check

      Explanation

      The description includes all required sections and clearly explains the problem, implementation, scope, affected components, focused verification, limitations, and test results. The scope section identifies the maintainer takeover and contribution context, although it does not include a separate explicit approval-comment link.

      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsmacroscope-review

    5. Moved the existing annotation explanation to documentation on the three parser functions, addressing the docstring warning. Also refreshed this on current main and rechecked the real Git regressions: all twelve fail without the parsing fix, and all 232 tests across the three affected suites pass with it. Scoped lint and server typecheck pass.

    6. juliusmarminge assignedjuliusmarminge

    7. Taking over this one. I’ll reduce the tests to the useful coverage, update the implementation against current main, and verify it before publishing the changes.

    8. juliusmarminge merged thisa195ba0

    9. juliusmarminge closed this

Sign in to join this conversation.