mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 18:17:36 +00:00
refactor(providers): delete the SSH git and filesystem providers and relay-only wiring (#27644)
* refactor(providers): delete the SSH git and filesystem providers and relay-only wiring * refactor(ssh): drop relay-protocol exports only the deleted stream readers used --------- Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types'
|
||||
import { commandExecFileAsync } from '../git/runner'
|
||||
import { getSshGitProvider, getSshGitProviderGeneration } from '../providers/ssh-git-dispatch'
|
||||
import { parseWslPath } from '../wsl'
|
||||
import { resolveWithSshG } from '../ssh/ssh-g-config-resolution'
|
||||
import {
|
||||
@@ -58,8 +57,7 @@ function pruneSshHostnameCache(now: number): void {
|
||||
|
||||
function sshRuntimeCacheKey(context: SshConfigResolutionContext): string {
|
||||
if (context.connectionId) {
|
||||
const generation = getSshGitProviderGeneration(context.connectionId)
|
||||
return `ssh:${context.connectionId}:${generation}`
|
||||
return `ssh:${context.connectionId}`
|
||||
}
|
||||
const distro = context.wslDistro ?? parseWslPath(context.repoPath)?.distro
|
||||
return `local:${distro?.toLowerCase() ?? 'host'}`
|
||||
@@ -80,23 +78,7 @@ async function resolveSshHostnameInRuntime(
|
||||
context: SshConfigResolutionContext
|
||||
): Promise<string | null> {
|
||||
if (context.connectionId) {
|
||||
const provider = getSshGitProvider(context.connectionId)
|
||||
if (!provider) {
|
||||
return null
|
||||
}
|
||||
try {
|
||||
const result = await provider.execNonInteractive(
|
||||
'ssh',
|
||||
['-G', '--', host],
|
||||
context.repoPath,
|
||||
SSH_G_TIMEOUT_MS
|
||||
)
|
||||
return result.exitCode === 0 && !result.timedOut && !result.canceled
|
||||
? parseSshGHostname(result.stdout)
|
||||
: null
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const wslDistro = context.wslDistro ?? parseWslPath(context.repoPath)?.distro
|
||||
|
||||
Reference in New Issue
Block a user