mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 18:47:40 +00:00
refactor(providers): an ssh: route carries no provider and throws one typed error (#27477)
Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
@@ -193,53 +193,6 @@ describe('#10284 SSH Host alias → github.com owner/repo', () => {
|
||||
expect(gitExecFileAsyncMock).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('preserves a one-shot SSH remote failure through candidate discovery', async () => {
|
||||
const failure = new Error('relay request failed')
|
||||
const provider = {
|
||||
exec: vi
|
||||
.fn()
|
||||
.mockRejectedValueOnce(failure)
|
||||
.mockResolvedValueOnce({ stdout: 'git@github.com:team/orca.git\n', stderr: '' })
|
||||
}
|
||||
getSshGitProviderMock.mockReturnValue(provider)
|
||||
|
||||
await expect(
|
||||
getOwnerRepoForRemote(
|
||||
'/remote/repo',
|
||||
'origin',
|
||||
'ssh-1',
|
||||
{},
|
||||
{
|
||||
requireVerifiedSshProbe: true
|
||||
}
|
||||
)
|
||||
).rejects.toBe(failure)
|
||||
await expect(getOwnerRepoForRemote('/remote/repo', 'origin', 'ssh-1')).resolves.toEqual({
|
||||
owner: 'team',
|
||||
repo: 'orca'
|
||||
})
|
||||
expect(provider.exec).toHaveBeenCalledTimes(2)
|
||||
expect(gitExecFileAsyncMock).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps failed SSH alias classification unverifiable', async () => {
|
||||
const provider = sshProvider('')
|
||||
getSshGitProviderMock.mockReturnValue(provider)
|
||||
|
||||
await expect(
|
||||
getOwnerRepoForRemote(
|
||||
'/remote/repo',
|
||||
'origin',
|
||||
'ssh-1',
|
||||
{},
|
||||
{
|
||||
requireVerifiedSshProbe: true
|
||||
}
|
||||
)
|
||||
).rejects.toThrow('Remote repository identity is unverifiable.')
|
||||
expect(gitExecFileAsyncMock).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('isolates the same alias across native and WSL runtimes', async () => {
|
||||
resolveWithSshGMock.mockResolvedValueOnce(sshConfig('github.com'))
|
||||
commandExecFileAsyncMock.mockResolvedValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user