mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
Extend worktree creation, remote-conflict detection, and the Checks panel UI to support linked PRs from Bitbucket, Azure DevOps, and Gitea alongside GitHub and GitLab. * Extract shared metadata lookup helpers to map provider-specific review identifiers. * Update remote-conflict validation to check hosted reviews on target providers during worktree creation. * Propagate provider-specific PR states through the RPC layers and into the Checks and Source Control UI panels.
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
import type { FolderWorkspace, Worktree } from './types'
|
|
import { folderWorkspaceKey } from './workspace-scope'
|
|
|
|
export function folderWorkspaceToWorktree(folderWorkspace: FolderWorkspace): Worktree {
|
|
const linkedTask = folderWorkspace.linkedTask
|
|
return {
|
|
id: folderWorkspaceKey(folderWorkspace.id),
|
|
repoId: `folder-workspace:${folderWorkspace.projectGroupId}`,
|
|
displayName: folderWorkspace.name,
|
|
comment: folderWorkspace.comment,
|
|
linkedIssue:
|
|
linkedTask?.provider === 'github' && linkedTask.type === 'issue' ? linkedTask.number : null,
|
|
linkedPR: null,
|
|
linkedLinearIssue:
|
|
linkedTask?.provider === 'linear' ? (linkedTask.linearIdentifier ?? null) : null,
|
|
linkedGitLabMR: null,
|
|
linkedGitLabIssue:
|
|
linkedTask?.provider === 'gitlab' && linkedTask.type === 'issue' ? linkedTask.number : null,
|
|
linkedBitbucketPR: null,
|
|
linkedAzureDevOpsPR: null,
|
|
linkedGiteaPR: null,
|
|
isArchived: folderWorkspace.isArchived,
|
|
isUnread: folderWorkspace.isUnread,
|
|
isPinned: folderWorkspace.isPinned,
|
|
sortOrder: folderWorkspace.sortOrder,
|
|
manualOrder: folderWorkspace.manualOrder,
|
|
lastActivityAt: folderWorkspace.lastActivityAt,
|
|
createdAt: folderWorkspace.createdAt,
|
|
createdWithAgent: folderWorkspace.createdWithAgent,
|
|
pendingFirstAgentMessageRename: folderWorkspace.pendingFirstAgentMessageRename,
|
|
firstAgentMessageRenameError: folderWorkspace.firstAgentMessageRenameError,
|
|
workspaceStatus: folderWorkspace.workspaceStatus,
|
|
path: folderWorkspace.folderPath,
|
|
head: '',
|
|
branch: '',
|
|
isBare: false,
|
|
isSparse: false,
|
|
isMainWorktree: false
|
|
}
|
|
}
|