Skip to content

SSH-alias remotes re-probe every forge CLI on each sweep; no way to mark a host as plain git #40005

Closed

Description

@Lucian-Adrian

What happened

On a Linux server install (0.1.11-nightly.20261119.4954), repositories whose origin is an ssh-config alias in scp form (for example myhost:repo or otherhost:D:/dev/repo) are classified unknown. Refinement then spawns every forge CLI for them, again and again: glab, tea, fj, az, cafe (ENOENT when not installed) and gh auth token --hostname myhost.

Nothing breaks (every failure is caught), but the server trace fills with failed spans and processes keep spawning:

  • In 45 minutes: 131 ForgejoCli.listLogins failed spans, 17 glab and 17 tea spawn failures, 68 gh GitHubNotSignedInError: No GitHub credential for myhost.
  • In a later 25-minute window: 87 refinements, 103 glab and 103 tea spawn failures.
  • Triggers seen in traces: ProjectEnrichmentService.resolveRepositoryIdentity (1-minute TTL), ThreadPullRequestServiceV2.synchronize and VcsStatusBroadcaster.

This looks like the same retry pattern as #12060, but for remotes that are plain git over ssh, with no forge behind them at all. The #12060 fix covers *.ghe.com; ssh aliases still re-probe.

With the default trace retention (10 × 10 MB) this noise also shortens the useful log window to under an hour.

Steps to reproduce

  1. Add an ssh-config alias myhost and a repository with origin = myhost:repo.
  2. Open it as a T3 project with a few threads; leave the server running.
  3. Watch server.trace.ndjson for ForgejoCli.listLogins, glab/tea ENOENT and GitHubNotSignedInError spans.

Expected

A remote that no CLI claims should be cached as plain git for a long time, and users should be able to opt hosts out. I found no setting, project setting or environment variable for this. The per-host GitHub disabled switch only applies to GitHub host names.

Suggestions

  • (a) A setting such as a list of plain-git hosts, or a per-project sourceControlProvider: "none", making recognizeRemote return a terminal plain-git kind.
  • (b) Cache an all-null refinement even when one spec fails with a non-missing-CLI error, or cache per host rather than per remote.
  • (c) Skip CLI specs whose executable discover already reported missing, instead of spawning them on every refine.

Related: cross-environment delegation

delegate_task to another environment without target.projectId fails with "No project there has this repository (myhost:repo)". The match uses the literal remote string, and ssh aliases often differ between machines. Matching on more than the literal string, or naming the projectId workaround in the error, would help.

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