mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix(github): resolve project accounts at the request boundary * fix(github): retain account identity through request settlement * fix: isolate GitHub leaf caches by held execution identity * fix: use canonical options type for merged review membership
26 lines
937 B
TypeScript
26 lines
937 B
TypeScript
import { githubRepoContext, type LocalGitExecOptions } from './github-repository-identity'
|
|
|
|
export function githubApiRepositoryProbeCacheKey(
|
|
repoPath: string,
|
|
remoteName: string,
|
|
connectionId: string | null | undefined,
|
|
localGitOptions: LocalGitExecOptions,
|
|
requireVerifiedSshProbe: boolean
|
|
): string {
|
|
const runtimeKey = connectionId
|
|
? `ssh:${connectionId}`
|
|
: `local:${localGitOptions.wslDistro ?? 'host'}`
|
|
const { ghAccount } = githubRepoContext(repoPath, connectionId, localGitOptions)
|
|
return `${runtimeKey}\0${repoPath}\0${remoteName}\0${requireVerifiedSshProbe ? 'verified' : 'tolerant'}\0${JSON.stringify(ghAccount ?? null)}`
|
|
}
|
|
|
|
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
|
|
}
|