Skip to content

[Bug]: remotes rewritten with url.*.insteadOf get no forge, and linked PRs fail silently #41341

Closed

Description

@rwblokzijl

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Related to #17805 (SSH host aliases): same result, different git mechanism.

  1. In the server's git config, rewrite GitHub to another host, e.g. an authenticating proxy:
    [url "https://proxy.example/"]
        insteadOf = git@github.com:
        insteadOf = https://github.com/
    
    (Ours comes from GIT_CONFIG_* in the server's environment; a gitconfig file behaves the same.)
  2. Add a repo whose remote.origin.url is git@github.com:owner/repo.git as a project.
    git remote -v prints https://proxy.example/owner/repo.git.
  3. Link a https://github.com/owner/repo/pull/N PR to a thread (gh pr create from the thread, or link_pull_request).
  4. Click the PR link with "Open pull requests in T3 Code" on.

Expected behavior

The project is recognised as github.com/owner/repo, the linked PR shows its state, and the link opens in the PR panel.

Actual behavior

  • The project's repository identity is proxy.example/owner/repo with provider unknown, because
    RepositoryIdentityResolver builds it from git remote -v, which applies insteadOf.
  • No project matches the github.com link, so the client opens it in the browser.
  • The linked PR keeps state: null. In our setup the server has no github.com credential (by design: the proxy
    holds the token), and every sync fails with No GitHub credential for github.com in the traces
    (134 PullRequestSyncReactor.syncGroup and 68 ws.rpc.pullRequests.detail failures in 53 minutes).
    Nothing in the thread says so.

Suggested fix

Possibly separate: our proxy speaks the GHES API (/api/v3, /api/graphql) and gh auth token --hostname proxy.example
works, but T3 can't know that proxy.example serves github.com. A host alias setting ("github.com is served by
proxy.example") would let PR reads go through it.

Impact

Minor bug or occasional failure

Version or commit

0.1.10

Environment

Server on Linux arm64 in a container, desktop client on macOS

Logs or stack traces

GitHubNotSignedInError: No GitHub credential for github.com: run `gh auth login --hostname github.com`.
  spans: PullRequestSyncReactor.syncGroup > PullRequestService.persistedRead > GitHubPullRequestApi.getPullRequestSummary > GitHubCredentials.get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions