mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
refactor: group shared settings, profiles and execution hosts (#43047)
* refactor: place shared settings profiles and host contracts with owners * fix: retire stale cleanup validation contacts * refactor: consolidate imports from concrete owners * refactor: bind new card fixture to profile defaults owner * style: format rebased concrete host import * refactor: consolidate project header color owner imports * fix: load released phone readers after folder moves * fix: preserve released chat readers and current owner imports
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
import { win32 } from 'node:path'
|
||||
import type * as NodePath from 'node:path'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
// Exercise production UNC resolution on every CI host; keep matching and elections real.
|
||||
vi.mock('node:path', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof NodePath>()
|
||||
return { ...actual, resolve: actual.win32.resolve }
|
||||
})
|
||||
|
||||
import {
|
||||
selectEnclosingRepoOnHost,
|
||||
selectEnclosingWorktreeSelectionOnHost
|
||||
} from '../workspace-selection/caller-host-worktree-selection'
|
||||
import { buildWorktree } from '../runtime/fixtures/runtime-rpc-fixtures'
|
||||
import { toSshExecutionHostId } from '../../shared/execution-host'
|
||||
|
||||
const UPPER = String.raw`\\wsl.localhost\Ubuntu\home\Alice\App`
|
||||
const LOWER = String.raw`\\wsl$\Ubuntu\home\alice\app`
|
||||
const upper = buildWorktree(UPPER, 'main', 'abc', 'repo-a')
|
||||
const lower = buildWorktree(LOWER, 'main', 'abc', 'repo-b')
|
||||
|
||||
describe('WSL enclosing selection with Windows path resolution on every platform', () => {
|
||||
it('excludes case-distinct directories before caller preference in either order', () => {
|
||||
for (const rows of [
|
||||
[upper, lower],
|
||||
[lower, upper]
|
||||
]) {
|
||||
for (const owner of [upper, lower]) {
|
||||
for (const caller of [undefined, upper.id, lower.id]) {
|
||||
const cwd = win32.join(owner.path, 'src')
|
||||
expect(selectEnclosingWorktreeSelectionOnHost(rows, cwd, 'local', caller)).toEqual({
|
||||
selector: `id:${owner.id}`,
|
||||
worktreeId: owner.id
|
||||
})
|
||||
expect(selectEnclosingRepoOnHost(rows, cwd, 'local', caller)).toBe(owner.repoId)
|
||||
}
|
||||
}
|
||||
}
|
||||
const wrongDistro = { ...upper, path: UPPER.replace('Ubuntu', 'Debian') }
|
||||
const wrongHost = { ...upper, hostId: toSshExecutionHostId('other') }
|
||||
expect(
|
||||
selectEnclosingWorktreeSelectionOnHost([wrongDistro, wrongHost], UPPER, 'local')
|
||||
).toBeUndefined()
|
||||
expect(selectEnclosingRepoOnHost([wrongDistro, wrongHost], UPPER, 'local')).toBeUndefined()
|
||||
})
|
||||
})
|
||||
@@ -1,4 +1,7 @@
|
||||
import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../../shared/execution-host'
|
||||
import {
|
||||
isUnresolvedOwnerHostId,
|
||||
parseExecutionHostId
|
||||
} from '../../shared/execution-host/execution-host'
|
||||
import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store'
|
||||
import { parseWorkspaceKey } from '../../shared/workspace/identity/workspace-scope'
|
||||
import type { CrossStoreParentRef } from '../../shared/worktree/lineage-types'
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { normalizeExecutionHostId, type ParsedExecutionHost } from '../../shared/execution-host'
|
||||
import {
|
||||
normalizeExecutionHostId,
|
||||
type ParsedExecutionHost
|
||||
} from '../../shared/execution-host/execution-host'
|
||||
import type { ProjectHostSetup } from '../../shared/project/project-types'
|
||||
import { hostFilterMatchesHostId, resolveHostFlagTarget } from '../hosts/execution-host-flag'
|
||||
import { findProjectSetups, setupHostId } from '../projects/project-selector'
|
||||
|
||||
Reference in New Issue
Block a user