Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): recognize partial-clone Git remotes #12776

Closedvedprakash2302(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/12776/headopened View on GitHub

Problem

A PR can show as linked to a thread but be missing from the Pull Requests view, even though the user can open it on the provider's website and read it through the CLI.

This happens with partial clones when Git adds a filter marker such as [blob:none] after (fetch) in git remote -v. T3 expected the line to end at (fetch), so it discarded the remote and couldn't identify the repository. I encountered this with Azure DevOps, but the parsing bug affects other Git hosts too.

Fix

Replace the three copies of the remote parser with one shared helper that accepts the filter marker. Keep the remote URL intact and preserve separate fetch and push URLs.

Benefits

T3 can discover PRs for these checkouts without users changing their clone settings. The same fix covers repository detection, remote listing, and reusing an existing remote. It handles Windows and Unix line endings and adds no Git commands or network calls.

Verification

  • Parser and repository identity tests pass, including GitHub HTTPS/SSH and Azure DevOps cases.
  • Existing Git driver and core suites pass.
  • Server typecheck, targeted lint, and formatting checks pass.
  • Confirmed the helper recognizes the affected checkout's actual remote output.

I ran the fixed app locally against an isolated copy of the affected thread data. Opening the linked Azure DevOps PR from the thread loaded the PR side panel with its title, description, branches, changed-file count, reviewer, and comment count. This used real provider data, not a mocked response.

This verifies the PR side panel in the development web app. Fixes #12764.

Written with GPT-6 Astra through OpenCode in T3 Code.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Git remote detection for HTTPS and SSH repository URLs.
    • Preserved partial-clone URL details during repository identification.
    • Correctly separated fetch and push remotes, excluding push-only remotes from fetch discovery.
    • Improved handling of Windows and Unix line endings, blank lines, and malformed entries.
  • Tests

    • Added coverage for remote parsing and repository identity resolution across supported providers and URL formats.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

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

      Approvability

      Verdict: Approved at ffb46df

      Macroscope's review found this PR approvable — This is a contained server bug fix that centralizes Git remote parsing and recognizes partial-clone annotations without changing ordinary remote behavior or adding new commands, schemas, or infrastructure. Focused tests cover the new parsing cases and the affected repository-identity path.

      No code changes detected at 65e14f4. Prior analysis still applies.

      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 →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      Note

      Reviews paused

      It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to trigger a single review.

      Use the checkboxes below for quick actions:

      • ▶️ Resume reviews
      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: c7e9f7d3-2740-449b-9885-114eb7d3e89e

      📥 Commits

      Reviewing files that changed from the base of the PR and between f5198651baccae44fe6be56b193492c8bca51b12 and 65e14f4c95ef9b0cfa629e45f7ea4a96fcd0bff8.

      📒 Files selected for processing (2)
      • apps/server/src/vcs/GitVcsDriver.ts
      • apps/server/src/vcs/GitVcsDriverCore.ts

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


      📝 Walkthrough

      Walkthrough

      The change adds shared parsing for git remote -v output, including partial-clone annotations. Repository identity and VCS components use the shared helpers. Tests cover parsing edge cases and repository identity resolution.

      Changes

      Git remote parsing

      Layer / File(s)Summary
      Shared remote parser
      apps/server/src/git/remoteUrls.ts
      Adds helpers that parse fetch and push URLs, preserve partial-clone annotations, ignore malformed lines, and return fetch-only remotes.
      Consumer integration
      apps/server/src/project/RepositoryIdentityResolver.ts, apps/server/src/vcs/GitVcsDriver.ts, apps/server/src/vcs/GitVcsDriverCore.ts
      Replaces the three local parsers with imports from the shared module.
      Parser and identity tests
      apps/server/src/git/remoteUrls.test.ts, apps/server/src/project/RepositoryIdentityResolver.test.ts
      Adds coverage for line endings, annotated URLs, fetch and push separation, malformed input, and GitHub and Azure DevOps identity resolution.

      Priority: ➖ Normal

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 65e14

      This restores partial-clone remote recognition across repository discovery and VCS operations, with no identified current-head production risk remaining.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the main change: support for partial-clone Git remotes in the server.
      Description check✅ PassedThe description explains the problem, fix, benefits, verification, and issue reference. It does not use the template headings exactly and omits the checklist, but it provides the required change ratio…
      Linked Issues check✅ PassedThe changes meet the coding requirements in [#12764]. The shared parser accepts partial-clone annotations after (fetch) and (push), supports Unix and Windows line endings, and preserves fetch and …
      Out of Scope Changes check✅ PassedAll changed files support [#12764]. The shared parser removes duplicated parsing logic, and the added tests verify the required behavior. The changes add no unrelated product behavior, Git commands, n…
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

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

    5. Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition.

      The patch conflicts with the rewrite in apps/server/src/vcs/GitVcsDriverCore.ts. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2.

      Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved.

    6. juliusmarminge closed this

Sign in to join this conversation.