mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
* fix(github): fail closed when the SSH git provider is gone getCurrentHeadOid and probeTrackedUpstreamBranches only routed through the SSH provider when one was registered. With connectionId set but the provider unregistered (dropped connection, not yet reattached) they fell through to client-side git with cwd pointing at the remote repoPath — on a machine with a same-named local path that silently answers for the wrong repository. getCurrentHeadOid feeds shouldHideMergedImplicitPR, so a wrong OID changes which PR the UI attributes to a worktree. Both now take their existing unknown path (null / probeFailed) instead, matching repo-default-branch.ts. Local and WSL routing is unchanged. * fix(github): preserve PR state when SSH probes fail * fix(github): keep failed SSH discovery unverifiable * fix(github): propagate SSH identity failures * fix(github): scope verified SSH identity probes * test(github): preserve tolerant resolver calls * fix(github): preserve indeterminate auth discovery * fix(github): isolate SSH repository probe generations * test(github): expose SSH probe generation in mocks
26 lines
918 B
TypeScript
26 lines
918 B
TypeScript
import type { LocalGitExecOptions } from './github-repository-identity'
|
|
import { getSshGitProviderGeneration } from '../providers/ssh-git-dispatch'
|
|
|
|
export function githubApiRepositoryProbeCacheKey(
|
|
repoPath: string,
|
|
remoteName: string,
|
|
connectionId: string | null | undefined,
|
|
localGitOptions: LocalGitExecOptions,
|
|
requireVerifiedSshProbe: boolean
|
|
): string {
|
|
const runtimeKey = connectionId
|
|
? `ssh:${connectionId}:${getSshGitProviderGeneration(connectionId)}`
|
|
: `local:${localGitOptions.wslDistro ?? 'host'}`
|
|
return `${runtimeKey}\0${repoPath}\0${remoteName}\0${requireVerifiedSshProbe ? 'verified' : 'tolerant'}`
|
|
}
|
|
|
|
export function resolveGitHubApiRepositoryProbe<T>(
|
|
value: T | undefined,
|
|
requireVerifiedSshProbe: boolean
|
|
): T | null {
|
|
if (value === undefined && requireVerifiedSshProbe) {
|
|
throw new Error('GitHub repository identity is unverifiable.')
|
|
}
|
|
return value ?? null
|
|
}
|