mirror of
https://github.com/stablyai/orca.git
synced 2026-10-15 16:02:49 +00:00
Report pending setup state in workspace target resolution
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -508,6 +508,8 @@ Already partially landed:
|
||||
known host before a checkout path exists
|
||||
- workspace creation host options distinguish pending/error/unsupported setup
|
||||
metadata from hosts that have no setup
|
||||
- workspace creation target resolution reports `setup-not-ready` when a
|
||||
selected host has non-ready setup metadata
|
||||
|
||||
Not complete yet:
|
||||
|
||||
|
||||
@@ -512,6 +512,8 @@ Already partially landed:
|
||||
known host before a checkout path exists
|
||||
- workspace creation host options distinguish pending/error/unsupported setup
|
||||
metadata from hosts that have no setup
|
||||
- workspace creation target resolution reports `setup-not-ready` when a
|
||||
selected host has non-ready setup metadata
|
||||
|
||||
Not complete yet:
|
||||
|
||||
|
||||
@@ -430,6 +430,8 @@ Already partially landed:
|
||||
known host before a checkout path exists
|
||||
- workspace creation host options distinguish pending/error/unsupported setup
|
||||
metadata from hosts that have no setup
|
||||
- workspace creation target resolution reports `setup-not-ready` when a
|
||||
selected host has non-ready setup metadata
|
||||
|
||||
Still needed:
|
||||
|
||||
|
||||
@@ -791,6 +791,9 @@ Landed so far:
|
||||
- Updated workspace creation host options so non-ready setup metadata appears
|
||||
with its real pending/error/unsupported state instead of being collapsed into
|
||||
a generic "project not set up" row.
|
||||
- Updated workspace creation target resolution so selecting a host with
|
||||
non-ready setup metadata reports `setup-not-ready` instead of
|
||||
`project-not-set-up-on-host`.
|
||||
- Added tests for local repos, SSH repos, same-provider multi-host grouping,
|
||||
no-identity same-name non-grouping, selector cache behavior, persistence
|
||||
backfill, repo mutation synchronization, renderer hydration, runtime RPC
|
||||
|
||||
@@ -155,6 +155,32 @@ describe('project-host workspace target resolution', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('reports setup-not-ready when the selected host has pending setup metadata', () => {
|
||||
const repo = makeRepo('orca')
|
||||
const projects = [makeProject('github:stablyai/orca', ['orca'])]
|
||||
const projectHostSetups = [
|
||||
makeSetup('orca', 'github:stablyai/orca', 'local', 'orca'),
|
||||
makeSetup('gpu-pending', 'github:stablyai/orca', 'runtime:gpu', '', {
|
||||
path: '',
|
||||
setupState: 'setting-up',
|
||||
setupMethod: 'provisioned'
|
||||
})
|
||||
]
|
||||
|
||||
expect(
|
||||
resolveWorkspaceCreationTarget({
|
||||
eligibleRepos: [repo],
|
||||
projects,
|
||||
projectHostSetups,
|
||||
projectId: 'github:stablyai/orca',
|
||||
hostId: 'runtime:gpu'
|
||||
})
|
||||
).toEqual({
|
||||
status: 'unavailable',
|
||||
reason: 'setup-not-ready'
|
||||
})
|
||||
})
|
||||
|
||||
it('reports unavailable when an explicit setup is not ready', () => {
|
||||
const repo = makeRepo('orca')
|
||||
const projects = [makeProject('github:stablyai/orca', ['orca'])]
|
||||
|
||||
@@ -142,6 +142,12 @@ export function resolveWorkspaceCreationTarget(
|
||||
}
|
||||
|
||||
if (projectId && hostId) {
|
||||
const hostSetup = setups.find(
|
||||
(setup) => setup.projectId === projectId && setup.hostId === hostId
|
||||
)
|
||||
if (hostSetup && !isReadySetup(hostSetup)) {
|
||||
return { status: 'unavailable', reason: 'setup-not-ready' }
|
||||
}
|
||||
const target = findReadySetupTarget(
|
||||
setups,
|
||||
repoById,
|
||||
|
||||
Reference in New Issue
Block a user