Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(gitcafe): SCP remotes with a leading slash find their repository #44614 (GitHub #44612)

Mergedonly21mil(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/44612/headmerged by juliusmarminge View on GitHub

Problem

A GitCafe checkout whose remote uses git's scp-like form with a leading slash, such as ssh@git.cafe:/team/project.git, is recognized as GitCafe but never resolves to a repository. git clone documents this spelling as [<user>@]<host>:/<path-to-git-repo>. parseGitCafeRemote keeps the slash in the path, so the strict owner/name check rejects /team/project and returns null. Pull request lookups for that checkout then fail with "No GitCafe repository remote was found."

Change

The SCP pattern in gitCafeHosts.ts now skips one optional / after the colon. The core repositoryPathFromRemoteUrl already does the same (#44007). gitCafeRepositoryPath stays strict, because the pull request provider uses it as an exact owner/name check.

Scope

Small fix of an obvious bug, so no issue. One line in packages/source-control-gitcafe, plus three test rows. Other remote shapes are out of scope.

Verification

  • gitCafeHosts.test.ts gains ssh@git.cafe:/team/project.git and git.cafe:/team/project.git. On main both fail (expected null to deeply equal { host: 'git.cafe', … }). A third row keeps git.cafe://team/project.git rejected, since only one slash is skipped. With the change all 13 tests pass.
  • I ran a real-repo check: a fresh git init with origin set to ssh@git.cafe:/team/project.git. GitCafeSourceControlProvider.listChangeRequests read that remote through real git config, with a recording HTTP client standing in for git.cafe:
Remotemainthis PR
ssh@git.cafe:team/project.git (control)team/project, requests /api/repos/team/project/pullssame
ssh@git.cafe:/team/project.gitnull, "No GitCafe repository remote was found.", no requestteam/project, requests /api/repos/team/project/pulls
  • vp run check:changed passes.
  • Not checked: git.cafe's own SSH server with this spelling, since that needs a registered key.

Generated with Gemini 4 Neon in T3 Code Nightly

    1. Pushed7376317

    2. Evidence

      Real web app, 1280×800, light theme, fresh isolated databases and Replay (dev), using the real GitCafe repository/API.

      On each commit, fetch versecafe/webls over HTTPS, check out from_string() with its upstream configured, set origin to ssh@git.cafe:/versecafe/webls.git, create and open a thread, and inspect Version Control.

      BeforeAfter
      Before: existing PR missingAfter: existing PR found
      129c352ff2: Create PR; lookup logs No GitCafe repository remote was found.7376317bc8: existing #1, webls v2, and PR badge appear.
      Before recordingAfter recording

      Scenario driver. scenarios:prove exited 0: failed on base and passed on head. Captures inspected.

      Not shown:

      • The userless git.cafe:/owner/repo SCP variant was not independently exercised; this proof covers the reported ssh@git.cafe:/owner/repo form.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged this7ea8041

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.