mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 00:03:20 +00:00
Persist project host setup method
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -71,6 +71,19 @@ describe('project host setup projection', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('preserves repo-backed setup method metadata', () => {
|
||||
const projection = projectHostSetupProjectionFromRepos([
|
||||
repo({
|
||||
id: 'repo-1',
|
||||
path: '/Users/alice/orca',
|
||||
displayName: 'orca',
|
||||
projectHostSetupMethod: 'cloned'
|
||||
})
|
||||
])
|
||||
|
||||
expect(projection.setups[0]?.setupMethod).toBe('cloned')
|
||||
})
|
||||
|
||||
it('groups repo checkouts with the same provider identity under one project', () => {
|
||||
const projection = projectHostSetupProjectionFromRepos([
|
||||
repo({
|
||||
|
||||
@@ -68,6 +68,7 @@ function mergeProjectRepo(project: Project, repo: Repo): Project {
|
||||
function createSetupFromRepo(repo: Repo, projectId: string, now: number): ProjectHostSetup {
|
||||
const hostId = getRepoExecutionHostId(repo)
|
||||
const createdAt = repo.addedAt || now
|
||||
const setupMethod = repo.projectHostSetupMethod ?? 'legacy-repo'
|
||||
return {
|
||||
id: repo.id,
|
||||
projectId,
|
||||
@@ -83,7 +84,7 @@ function createSetupFromRepo(repo: Repo, projectId: string, now: number): Projec
|
||||
...(repo.gitUsername ? { gitUsername: repo.gitUsername } : {}),
|
||||
...(repo.sourceControlAi ? { sourceControlAi: repo.sourceControlAi } : {}),
|
||||
setupState: 'ready',
|
||||
setupMethod: 'legacy-repo',
|
||||
setupMethod,
|
||||
createdAt,
|
||||
updatedAt: createdAt
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ export type ProjectHostSetupExistingFolderArgs = {
|
||||
path: string
|
||||
kind?: RepoKind
|
||||
displayName?: string
|
||||
setupMethod?: Exclude<ProjectHostSetupMethod, 'legacy-repo'>
|
||||
}
|
||||
|
||||
export type ProjectHostSetupCloneArgs = {
|
||||
@@ -193,6 +194,8 @@ export type Repo = {
|
||||
projectGroupOrder?: number
|
||||
/** Repo-specific source-control AI overrides. Missing fields inherit global settings. */
|
||||
sourceControlAi?: RepoSourceControlAiOverrides
|
||||
/** Transitional source for ProjectHostSetup.setupMethod while Repo remains compatibility storage. */
|
||||
projectHostSetupMethod?: Exclude<ProjectHostSetupMethod, 'legacy-repo'>
|
||||
}
|
||||
|
||||
export type ProjectGroupCreatedFrom = 'manual' | 'folder-scan' | 'migration'
|
||||
|
||||
Reference in New Issue
Block a user