mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 03:45:08 +00:00
refactor(github): organize concrete feature owners (#41601)
This commit is contained in:
@@ -12,8 +12,8 @@ import type {
|
||||
GitStatusEntry
|
||||
} from './git/status/git-status-types'
|
||||
import type { GitLabProjectRef } from './gitlab-types'
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from './github/check-types'
|
||||
import type { GitHubRepositoryIdentity } from './github/pull-request-types'
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from './github/checks/check-types'
|
||||
import type { GitHubRepositoryIdentity } from './github/repositories/repository-identity'
|
||||
|
||||
export type DiffSource =
|
||||
| 'unstaged'
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
import type { GlobalSettings } from '../global-settings-types'
|
||||
import type { GlobalSettings } from '../../global-settings-types'
|
||||
import {
|
||||
LOCAL_EXECUTION_HOST_ID,
|
||||
normalizeExecutionHostId,
|
||||
toSshExecutionHostId,
|
||||
type ExecutionHostId
|
||||
} from '../execution-host'
|
||||
import { taskSourceCacheScopeHostId } from '../work-items/task-source-context'
|
||||
} from '../../execution-host'
|
||||
import { taskSourceCacheScopeHostId } from '../../work-items/task-source-context'
|
||||
|
||||
export type RuntimeFocusSettings =
|
||||
| Pick<GlobalSettings, 'activeRuntimeEnvironmentId'>
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import type { PRCheckDetail } from './check-types'
|
||||
import type { CheckStatus } from './pull-request-types'
|
||||
import type { HostedReviewState } from '../source-control/hosted-review/hosted-review-contracts'
|
||||
import { reviewRefreshIntervalMs } from '../review-refresh-policy'
|
||||
import type { CheckStatus } from '../pull-requests/pull-request-types'
|
||||
import type { HostedReviewState } from '../../source-control/hosted-review/hosted-review-contracts'
|
||||
import { reviewRefreshIntervalMs } from '../../review-refresh-policy'
|
||||
|
||||
export function detailedChecksStatus(checks: readonly PRCheckDetail[]): CheckStatus | undefined {
|
||||
if (checks.length === 0) {
|
||||
+1
-19
@@ -1,9 +1,5 @@
|
||||
import { expect, it } from 'vitest'
|
||||
import {
|
||||
acceptPRCheckObservation,
|
||||
isCompletePRCheckOwner,
|
||||
projectPRCheckOwner
|
||||
} from './complete-pr-check-owner'
|
||||
import { acceptPRCheckObservation } from './complete-pr-check-owner'
|
||||
|
||||
const summary = {
|
||||
state: 'success' as const,
|
||||
@@ -49,17 +45,3 @@ it('retains last-good only for the same proved source, target and nonempty head'
|
||||
acceptPRCheckObservation({ ...pr, checksSummary: undefined }, pr, context)?.checksSummary
|
||||
).toBeUndefined()
|
||||
})
|
||||
|
||||
it('carries unavailable authority explicitly through display and review projections without lending it to another head', () => {
|
||||
const unavailable = acceptPRCheckObservation({ ...pr, checksSummary: undefined }, null, context)!
|
||||
const display = projectPRCheckOwner(unavailable, { ...unavailable })
|
||||
expect(isCompletePRCheckOwner(display)).toBe(true)
|
||||
const review = projectPRCheckOwner(display, { ...display, status: display.checksStatus })
|
||||
expect(isCompletePRCheckOwner(review)).toBe(true)
|
||||
expect(isCompletePRCheckOwner({ ...review })).toBe(false)
|
||||
expect(isCompletePRCheckOwner(projectPRCheckOwner(review, { ...review, headSha: 'h2' }))).toBe(
|
||||
false
|
||||
)
|
||||
const full = acceptPRCheckObservation(pr, null, context)!
|
||||
expect(isCompletePRCheckOwner({ ...pr, checksSummary: full.checksSummary })).toBe(false)
|
||||
})
|
||||
+7
-3
@@ -1,6 +1,10 @@
|
||||
import type { CheckStatus, GitHubOwnerRepo, ProviderCheckSummary } from './pull-request-types'
|
||||
import { githubRepoIdentityKey } from './repository-identity-key'
|
||||
import { matchesGitHubWorkItemTarget, parseGitHubItemRepository } from './work-item-target'
|
||||
import type { CheckStatus, ProviderCheckSummary } from '../pull-requests/pull-request-types'
|
||||
import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../repositories/repository-identity'
|
||||
import { githubRepoIdentityKey } from '../repositories/repository-identity-key'
|
||||
import {
|
||||
matchesGitHubWorkItemTarget,
|
||||
parseGitHubItemRepository
|
||||
} from '../work-items/work-item-target'
|
||||
|
||||
type CheckOwner = {
|
||||
number?: number
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GitHubRepositoryIdentity } from './pull-request-types'
|
||||
import type { GitHubRepositoryIdentity } from '../repositories/repository-identity'
|
||||
|
||||
export type GitHubReactionContent =
|
||||
| '+1'
|
||||
+5
-2
@@ -1,5 +1,8 @@
|
||||
import type { Repo } from '../repo-types'
|
||||
import { githubHostFromIdentityKey, repoUpstreamIdentityKey } from './repository-identity-key'
|
||||
import type { Repo } from '../../repo-types'
|
||||
import {
|
||||
githubHostFromIdentityKey,
|
||||
repoUpstreamIdentityKey
|
||||
} from '../repositories/repository-identity-key'
|
||||
|
||||
export type GitHubRepoReference = {
|
||||
owner: string
|
||||
@@ -1,18 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import {
|
||||
GITHUB_PROJECT_REF_INPUT_MAX_BYTES,
|
||||
hasBoundedGitHubProjectRefInputText,
|
||||
isGitHubProjectRefInputTooLarge
|
||||
} from './project-ref-input'
|
||||
|
||||
describe('GitHub project reference input limits', () => {
|
||||
it('rejects oversized whitespace before submit checks trim the reference', () => {
|
||||
const oversizedWhitespace = ' '.repeat(GITHUB_PROJECT_REF_INPUT_MAX_BYTES + 1)
|
||||
|
||||
expect(isGitHubProjectRefInputTooLarge(oversizedWhitespace)).toBe(true)
|
||||
expect(hasBoundedGitHubProjectRefInputText(oversizedWhitespace)).toBe(false)
|
||||
expect(hasBoundedGitHubProjectRefInputText(' acme/42 ')).toBe(true)
|
||||
expect(hasBoundedGitHubProjectRefInputText(' ')).toBe(false)
|
||||
})
|
||||
})
|
||||
+1
-6
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { githubProjectHost, githubProjectIdentityKey } from './project-identity'
|
||||
import { githubProjectIdentityKey } from './project-identity'
|
||||
|
||||
describe('GitHub project identity', () => {
|
||||
it('keeps legacy github.com keys while isolating Enterprise hosts and ports', () => {
|
||||
@@ -14,9 +14,4 @@ describe('GitHub project identity', () => {
|
||||
'ghe.example:8443:organization:acme:7'
|
||||
)
|
||||
})
|
||||
|
||||
it('pins host-less projects to github.com', () => {
|
||||
expect(githubProjectHost()).toBe('github.com')
|
||||
expect(githubProjectHost('ghe.example:8443')).toBe('ghe.example:8443')
|
||||
})
|
||||
})
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { isDefaultGitHubHost } from './repository-identity-key'
|
||||
import { isDefaultGitHubHost } from '../repositories/repository-identity-key'
|
||||
|
||||
export type GitHubProjectIdentity = {
|
||||
owner: string
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { isClipboardTextByteLengthOverLimit } from '../clipboard-text'
|
||||
import { isClipboardTextByteLengthOverLimit } from '../../clipboard-text'
|
||||
|
||||
export const GITHUB_PROJECT_REF_INPUT_MAX_BYTES = 2 * 1024
|
||||
export const GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR = 'Project reference is too large to resolve.'
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Keep Project request payloads separate from ProjectV2 domain shapes so renderer domain imports do not pull IPC arguments.
|
||||
import type { GitHubProjectFieldMutationValue, GitHubProjectOwnerType } from './project-types'
|
||||
import type { GitHubIssueUpdate } from '../issue-mutation-types'
|
||||
import type { GitHubIssueUpdate } from '../../issue-mutation-types'
|
||||
|
||||
/** Set by a click: it may start the stopped WSL distro gh lives in (E9). Loads that also run
|
||||
* unprompted (mount effects, restore) leave it unset. Local IPC only. */
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
// Project IPC envelopes share classified failures and cross-module work-item/comment/user types unnecessary in the ProjectV2 domain model.
|
||||
import type { PRComment } from './comment-types'
|
||||
import type { PRComment } from '../comments/comment-types'
|
||||
import type {
|
||||
GitHubIssueType,
|
||||
GitHubProjectOwnerType,
|
||||
@@ -7,8 +7,8 @@ import type {
|
||||
GitHubProjectTable,
|
||||
GitHubProjectViewSummary
|
||||
} from './project-types'
|
||||
import type { GitHubAssignableUser } from './pull-request-types'
|
||||
import type { GitHubWorkItemDetails } from './work-item-types'
|
||||
import type { GitHubAssignableUser } from '../pull-requests/pull-request-types'
|
||||
import type { GitHubWorkItemDetails } from '../work-items/work-item-types'
|
||||
|
||||
export type GitHubProjectViewErrorType =
|
||||
| 'auth_required'
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { PRMergeableState, PRReviewDecision, PRState } from './pull-request-types'
|
||||
import type { PRMergeableState, PRReviewDecision, PRState } from '../pull-request-types'
|
||||
|
||||
export type GitHubPRAutoMergeAvailabilityInput = {
|
||||
state: PRState
|
||||
-7
@@ -5,13 +5,6 @@ import {
|
||||
} from './pull-request-merge-methods'
|
||||
|
||||
describe('GitHub PR merge methods', () => {
|
||||
it('keeps the historical squash-first fallback when repository metadata is missing', () => {
|
||||
expect(resolveGitHubPRMergeMethods()).toEqual({
|
||||
defaultMethod: 'squash',
|
||||
methods: ['squash', 'merge', 'rebase']
|
||||
})
|
||||
})
|
||||
|
||||
it('uses GitHub viewer defaults and hides methods disabled by the repository', () => {
|
||||
const settings = normalizeGitHubPRMergeMethodSettings({
|
||||
defaultMethod: 'REBASE',
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from './pull-request-types'
|
||||
import type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from '../pull-request-types'
|
||||
|
||||
export const GITHUB_PR_MERGE_METHODS = ['squash', 'merge', 'rebase'] as const
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { getProviderChecksOutcome } from '../source-control/checks/provider-check-summary'
|
||||
import type { CheckStatus, ProviderCheckSummary } from './pull-request-types'
|
||||
import { getProviderChecksOutcome } from '../../../source-control/checks/provider-check-summary'
|
||||
import type { CheckStatus, ProviderCheckSummary } from '../pull-request-types'
|
||||
import {
|
||||
canShowGitHubPRAutoMergeControl,
|
||||
type GitHubPRAutoMergeAvailabilityInput
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { GitHubPRStack, GitHubPRStackEntry } from './pull-request-types'
|
||||
import type { GitHubPRStack, GitHubPRStackEntry } from '../pull-request-types'
|
||||
|
||||
export type GitHubPRStackMergeScope = {
|
||||
count: number
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import type { GitHubAssignableUser } from './pull-request-types'
|
||||
import type { GitHubWorkItem } from './work-item-types'
|
||||
import { isClipboardTextByteLengthOverLimit } from '../clipboard-text'
|
||||
import type { GitHubWorkItem } from '../work-items/work-item-types'
|
||||
import { isClipboardTextByteLengthOverLimit } from '../../clipboard-text'
|
||||
|
||||
type ReviewDisplayItem = Pick<GitHubWorkItem, 'reviewDecision' | 'reviewRequests' | 'latestReviews'>
|
||||
export type GitHubPRPrimaryReviewer = Pick<GitHubAssignableUser, 'login' | 'avatarUrl'> & {
|
||||
+5
-6
@@ -1,8 +1,13 @@
|
||||
import type { GitHubRepositoryIdentity } from '../repositories/repository-identity'
|
||||
|
||||
export type PRState = 'open' | 'closed' | 'merged' | 'draft'
|
||||
|
||||
export type IssueState = 'open' | 'closed'
|
||||
|
||||
export type CheckStatus = 'pending' | 'success' | 'failure' | 'neutral'
|
||||
|
||||
export type PRMergeableState = 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN'
|
||||
|
||||
export type PRReviewDecision = 'APPROVED' | 'CHANGES_REQUESTED' | 'REVIEW_REQUIRED'
|
||||
|
||||
export type PRConflictSummary = {
|
||||
@@ -13,9 +18,6 @@ export type PRConflictSummary = {
|
||||
localMergeState?: 'clean'
|
||||
}
|
||||
|
||||
// Keep GHES host identity across renderer/RPC boundaries to prevent actions targeting same-named github.com repos.
|
||||
export type GitHubRepositoryIdentity = { owner: string; repo: string; host?: string }
|
||||
|
||||
export type GitHubPRMergeMethod = 'merge' | 'squash' | 'rebase'
|
||||
|
||||
export type GitHubPRMergeMethodSettings = {
|
||||
@@ -150,6 +152,3 @@ export type GitHubPRFileContents = {
|
||||
originalTooLarge?: boolean
|
||||
modifiedTooLarge?: boolean
|
||||
}
|
||||
|
||||
// Share the identity shape across IPC/renderer without main imports; main’s gh-utils.ts retains the OwnerRepo alias.
|
||||
export type GitHubOwnerRepo = GitHubRepositoryIdentity
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import type { PRInfo } from './pull-request-types'
|
||||
import type { Worktree } from '../worktree/types'
|
||||
import type { PRInfo } from '../pull-request-types'
|
||||
import type { Worktree } from '../../../worktree/types'
|
||||
|
||||
export function shouldClearDivergedLinkedMergedPR(args: {
|
||||
pr: PRInfo | null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { PRInfo } from './pull-request-types'
|
||||
import type { PRInfo } from '../pull-request-types'
|
||||
import type { GitHubPRRefreshCandidate } from './pull-request-refresh-types'
|
||||
|
||||
export type PRBranchFallback = {
|
||||
+1
-8
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import type { PRInfo } from './pull-request-types'
|
||||
import type { PRInfo } from '../pull-request-types'
|
||||
import { normalizeGitHubPRForBranchOutcome } from './pull-request-for-branch-outcome'
|
||||
|
||||
const PR: PRInfo = {
|
||||
@@ -14,13 +14,6 @@ const PR: PRInfo = {
|
||||
}
|
||||
|
||||
describe('normalizeGitHubPRForBranchOutcome', () => {
|
||||
it.each([
|
||||
{ kind: 'no-pr' as const, fetchedAt: 10 },
|
||||
{ kind: 'no-pr' as const, fetchedAt: 10, rejectedPRUrls: [PR.url] }
|
||||
])('preserves no-PR responses from older and newer hosts', (outcome) => {
|
||||
expect(normalizeGitHubPRForBranchOutcome(outcome, 20)).toEqual(outcome)
|
||||
})
|
||||
|
||||
it('normalizes legacy PRInfo and null responses', () => {
|
||||
expect(normalizeGitHubPRForBranchOutcome(PR, 20)).toEqual({
|
||||
kind: 'found',
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import type { PRRefreshOutcome } from './pull-request-refresh-types'
|
||||
import type { PRInfo } from './pull-request-types'
|
||||
import type { PRInfo } from '../pull-request-types'
|
||||
|
||||
export type GitHubPRForBranchResponse = PRRefreshOutcome | PRInfo | null
|
||||
|
||||
+2
-5
@@ -1,5 +1,5 @@
|
||||
import type { RepoKind } from '../repo-types'
|
||||
import type { CheckStatus, PRInfo, PRMergeableState, PRState } from './pull-request-types'
|
||||
import type { RepoKind } from '../../../repo-types'
|
||||
import type { CheckStatus, PRInfo, PRMergeableState, PRState } from '../pull-request-types'
|
||||
|
||||
/** Classified failures drive stable empty-state copy. Auth/permission/repo_unavailable/gh_unavailable make existing-review lookup impossible and must hide Create. */
|
||||
export type PRRefreshErrorType =
|
||||
@@ -12,9 +12,6 @@ export type PRRefreshErrorType =
|
||||
| 'server_error'
|
||||
| 'unknown'
|
||||
|
||||
// Backward-compatible name used by outage-copy consumers added on main.
|
||||
export type PRRefreshUpstreamErrorType = PRRefreshErrorType
|
||||
|
||||
export type PRRefreshOutcome =
|
||||
| { kind: 'found'; pr: PRInfo; fetchedAt: number }
|
||||
| { kind: 'no-pr'; fetchedAt: number; rejectedPRUrls?: string[] }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { Repo } from '../repo-types'
|
||||
import type { Repo } from '../../repo-types'
|
||||
|
||||
// Share github.com/GHES detection across cache identity, quota scoping and execution routing.
|
||||
export function isDefaultGitHubHost(host?: string): boolean {
|
||||
@@ -0,0 +1,2 @@
|
||||
// Keep GHES host identity across renderer/RPC boundaries to prevent actions targeting same-named github.com repos.
|
||||
export type GitHubRepositoryIdentity = { owner: string; repo: string; host?: string }
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod'
|
||||
import { SlugRepo } from '../rpc-contract/github-repo-target-params'
|
||||
import { ExpectedRuntimeSourceSchema } from '../runtime-rpc-envelope'
|
||||
import { SlugRepo } from '../../rpc-contract/github-repo-target-params'
|
||||
import { ExpectedRuntimeSourceSchema } from '../../runtime-rpc-envelope'
|
||||
|
||||
const methods = new Set([
|
||||
'github.workItemDetails',
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { ClassifiedError } from '../classified-error'
|
||||
import type { ClassifiedError } from '../../classified-error'
|
||||
import { GITHUB_SEARCH_RESULT_WINDOW_ERROR_PATTERN } from './work-items-query-bounds'
|
||||
|
||||
export function getWorkItemPageErrorTypes(errors: unknown): ClassifiedError['type'][] {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import type { GitHubOwnerRepo } from './pull-request-types'
|
||||
import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../repositories/repository-identity'
|
||||
import type { GitHubWorkItem, GitHubWorkItemDetails } from './work-item-types'
|
||||
import { githubRepoIdentityKey } from './repository-identity-key'
|
||||
import { githubRepoIdentityKey } from '../repositories/repository-identity-key'
|
||||
|
||||
export type GitHubWorkItemTarget = {
|
||||
repository: GitHubOwnerRepo
|
||||
+9
-7
@@ -1,18 +1,20 @@
|
||||
import type { ClassifiedError } from '../classified-error'
|
||||
import type { ExecutionHostId } from '../execution-host'
|
||||
import type { PRCheckDetail } from './check-types'
|
||||
import type { GitHubIssueTimelineItem, PRComment } from './comment-types'
|
||||
import type { ClassifiedError } from '../../classified-error'
|
||||
import type { ExecutionHostId } from '../../execution-host'
|
||||
import type { PRCheckDetail } from '../checks/check-types'
|
||||
import type { GitHubIssueTimelineItem, PRComment } from '../comments/comment-types'
|
||||
import type {
|
||||
GitHubAssignableUser,
|
||||
GitHubOwnerRepo,
|
||||
GitHubPRFile,
|
||||
GitHubPRMergeMethodSettings,
|
||||
GitHubPRReviewSummary,
|
||||
GitHubRepositoryIdentity,
|
||||
PRMergeableState,
|
||||
PRReviewDecision,
|
||||
ProviderCheckSummary
|
||||
} from './pull-request-types'
|
||||
} from '../pull-requests/pull-request-types'
|
||||
import type {
|
||||
GitHubRepositoryIdentity as GitHubOwnerRepo,
|
||||
GitHubRepositoryIdentity
|
||||
} from '../repositories/repository-identity'
|
||||
|
||||
export type GitHubWorkItem = {
|
||||
id: string
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { isClipboardTextByteLengthOverLimit } from '../clipboard-text'
|
||||
import { isClipboardTextByteLengthOverLimit } from '../../clipboard-text'
|
||||
|
||||
export const GITHUB_WORK_ITEMS_QUERY_MAX_BYTES = 8 * 1024
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
CheckStatus,
|
||||
PRConflictSummary,
|
||||
ProviderCheckSummary
|
||||
} from './github/pull-request-types'
|
||||
} from './github/pull-requests/pull-request-types'
|
||||
import type { HostedReviewDecision } from './source-control/hosted-review/hosted-review-contracts'
|
||||
|
||||
// Why: flat owner/repo is inadequate — projects nest (`group/subgroup/project`) and self-hosted hosts must travel with the path for URL/glab targeting.
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { BrowserProfileScope } from './browser/profiles/browser-profile-sco
|
||||
import type { GlobalSettingsBase } from './global-settings-base'
|
||||
import type { ExecutionHostId } from './execution-host'
|
||||
import type { OrcaWorkspaceLayout } from './orca-workspace-layout'
|
||||
import type { GitHubProjectSettings } from './github/project-types'
|
||||
import type { GitHubProjectSettings } from './github/projects/project-types'
|
||||
import type { VoiceSettings } from './speech-types'
|
||||
import type { AiVaultSearchSettings } from './ai-vault/search/ai-vault-search-settings'
|
||||
import type { GitLabProjectSettings } from './gitlab-types'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { parseGitHubIssueOrPRLink, type RepoSlug } from '../../github/links'
|
||||
import { parseGitHubIssueOrPRLink, type RepoSlug } from '../../github/repositories/links'
|
||||
import { parseGitLabIssueOrMRLink, type ProjectSlug } from '../../new-workspace/gitlab-links'
|
||||
import type { NativeChatMessage } from '../native-chat-types'
|
||||
import { nativeChatToolCallScript } from './native-chat-tool-call-script'
|
||||
|
||||
@@ -2,11 +2,9 @@ import {
|
||||
type GitHubIssueOrPRLink,
|
||||
parseGitHubIssueOrPRLink,
|
||||
parseGitHubIssueOrPRNumber
|
||||
} from '../github/links'
|
||||
} from '../github/repositories/links'
|
||||
import { isWorkItemLinkQueryTooLarge } from './work-item-link-query-bounds'
|
||||
|
||||
export * from '../github/links'
|
||||
|
||||
const HTTP_URL_PREFIX_RE = /^https?:\/\//i
|
||||
|
||||
export type GitHubLinkQuery = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { parseGitHubIssueOrPRLink } from './github-links'
|
||||
import { parseGitHubIssueOrPRLink } from '../github/repositories/links'
|
||||
|
||||
export type GitHubWorkItemIdentity = {
|
||||
type: 'issue' | 'pr'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GitHubWorkItem } from '../github/work-item-types'
|
||||
import type { GitHubWorkItem } from '../github/work-items/work-item-types'
|
||||
import type { GitLabWorkItem } from '../gitlab-types'
|
||||
import type { JiraIssue } from '../jira/jira-types'
|
||||
import type { LinearIssue } from '../linear/issue-types'
|
||||
@@ -6,7 +6,7 @@ import type { LinearCollectionResult } from '../linear/workspace-types'
|
||||
import type { BaseRefSearchResult } from '../repo-types'
|
||||
import { parseJiraIssueUrl } from '../jira/jira-issue-url'
|
||||
import { buildJiraTextMatchJql } from '../jira/jira-search-input-jql'
|
||||
import type { GitHubIssueOrPRLink } from '../github/links'
|
||||
import type { GitHubIssueOrPRLink } from '../github/repositories/links'
|
||||
import {
|
||||
buildSmartWorkspaceUrlSourceRows,
|
||||
type SmartWorkspaceGitLabUrlIntent
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { parseGitHubIssueOrPRLink, type GitHubIssueOrPRLink } from '../github/links'
|
||||
import { githubRepoIdentityKey } from '../github/repository-identity-key'
|
||||
import type { GitHubWorkItem } from '../github/work-item-types'
|
||||
import { parseGitHubIssueOrPRLink, type GitHubIssueOrPRLink } from '../github/repositories/links'
|
||||
import { githubRepoIdentityKey } from '../github/repositories/repository-identity-key'
|
||||
import type { GitHubWorkItem } from '../github/work-items/work-item-types'
|
||||
import type { GitLabWorkItem } from '../gitlab-types'
|
||||
import type { LinearIssue } from '../linear/issue-types'
|
||||
import { parseGitLabIssueOrMRLink } from './gitlab-links'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { parseGitHubIssueOrPRLink, parseGitHubIssueOrPRNumber } from './github-links'
|
||||
import { parseGitHubIssueOrPRLink, parseGitHubIssueOrPRNumber } from '../github/repositories/links'
|
||||
import { parseGitLabIssueOrMRLink } from './gitlab-links'
|
||||
import { parseJiraIssueUrl } from '../jira/jira-issue-url'
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { DiffComment } from './diff-comment-types'
|
||||
import type { FolderWorkspace } from './folder-workspaces/folder-workspace-types'
|
||||
import type { WorkspaceKey } from './workspace-scope'
|
||||
import type { GlobalSettings } from './global-settings-types'
|
||||
import type { IssueInfo, PRInfo } from './github/pull-request-types'
|
||||
import type { IssueInfo, PRInfo } from './github/pull-requests/pull-request-types'
|
||||
import type { OnboardingState } from './onboarding-state-types'
|
||||
import type { PersistedUIState } from './persisted-ui-state-types'
|
||||
import type { ProjectGroup } from './project-group-types'
|
||||
|
||||
@@ -4,7 +4,10 @@ import {
|
||||
normalizeProjectRow
|
||||
} from './project-catalog-row-normalization'
|
||||
import { normalizeGitHubRemoteHost } from './git/remotes/git-remote-host-alias'
|
||||
import { githubRepoIdentityKey, isDefaultGitHubHost } from './github/repository-identity-key'
|
||||
import {
|
||||
githubRepoIdentityKey,
|
||||
isDefaultGitHubHost
|
||||
} from './github/repositories/repository-identity-key'
|
||||
import type { Project, ProjectHostSetup, ProjectProviderIdentity } from './project-types'
|
||||
import type { Repo } from './repo-types'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DictationTerm } from './dictation-dictionary'
|
||||
import type { RepoIcon } from './repo-icon'
|
||||
import type { GhAccountBinding } from './github/account-binding'
|
||||
import type { GitHubRepositoryIdentity } from './github/pull-request-types'
|
||||
import type { GhAccountBinding } from './github/accounts/account-binding'
|
||||
import type { GitHubRepositoryIdentity } from './github/repositories/repository-identity'
|
||||
import type { RepoHookSettings } from './orca-yaml-hook-types'
|
||||
import type { ForkSyncMode } from './git/remotes/git-fork-sync'
|
||||
import type { GitRemoteIdentity } from './git/remotes/git-remote-identity'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { HostedReviewState } from './source-control/hosted-review/hosted-review-contracts'
|
||||
import type { CheckStatus } from './github/pull-request-types'
|
||||
import type { CheckStatus } from './github/pull-requests/pull-request-types'
|
||||
|
||||
export const REVIEW_REFRESH_COOLDOWN_MS = 10_000
|
||||
export const CLOSED_REVIEW_REFRESH_INTERVAL_MS = 15 * 60_000
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from 'zod'
|
||||
import type { GitHubPRRefreshReason } from '../github/pull-request-refresh-types'
|
||||
import type { GitHubPRRefreshReason } from '../github/pull-requests/refresh/pull-request-refresh-types'
|
||||
import { OptionalGhAccountExpectation, RepoSelector, SlugRepo } from './github-repo-target-params'
|
||||
import { OptionalString, requiredString } from './rpc-param-primitives'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from 'zod'
|
||||
import { normalizeGhAccountBinding } from '../github/account-binding'
|
||||
import { normalizeGhAccountBinding } from '../github/accounts/account-binding'
|
||||
import { OptionalBoolean, OptionalString, requiredString } from './rpc-param-primitives'
|
||||
import { OptionalExecutionHostId } from './worktree-params'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { z } from 'zod'
|
||||
import { normalizeRepoSourceControlAiOverrides } from '../source-control/ai/settings/source-control-ai-repo-settings'
|
||||
import { normalizeRepoBadgeColor } from '../repo-badge-color'
|
||||
import { sanitizeRepoIcon } from '../repo-icon'
|
||||
import { normalizeGhAccountBinding } from '../github/account-binding'
|
||||
import { normalizeGhAccountBinding } from '../github/accounts/account-binding'
|
||||
import { normalizeJiraProjectReference } from '../jira/jira-project-reference'
|
||||
import {
|
||||
normalizeCustomWorktreeVisibilitySources,
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
import type { AgentMainAgentStatus } from './agent-status/lifecycle/main-agent-status'
|
||||
import type { ProgramStatusFacet } from './program-status/facet'
|
||||
import type { AgentListVerdict } from './agent-status/presentation/agent-list-status'
|
||||
import type { CheckStatus, ProviderCheckSummary } from './github/pull-request-types'
|
||||
import type { CheckStatus, ProviderCheckSummary } from './github/pull-requests/pull-request-types'
|
||||
import type { AgentChildWorkView } from './agent-status/child-work/agent-status-child-work-view'
|
||||
import type { AgentSubagentSnapshot } from './agent-status/contracts/agent-status-subagent-snapshot'
|
||||
import type { RuntimeTerminalInteractiveWait } from './runtime-terminal-contracts'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as z from 'zod'
|
||||
import type { Repo } from '../repo-types'
|
||||
import type { Worktree } from '../worktree/types'
|
||||
import { getGitHubPRCacheKeyCandidates } from '../github/github-cache-key'
|
||||
import { getGitHubPRCacheKeyCandidates } from '../github/cache/github-cache-key'
|
||||
import { isGitHubPRSuppressed } from '../worktree/github-pr-suppression'
|
||||
import { getPRGroupKeyForState, type PRGroupKey } from '../workspace-view/workspace-pr-groups'
|
||||
import type { PairedServerWorkspaceRow } from './paired-server-rows'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { gitLabJobTraceToLogExcerpt } from './gitlab-job-log-excerpt'
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from '../../../github/check-types'
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from '../../../github/checks/check-types'
|
||||
|
||||
export type GitLabJobTraceCheckDetailsStrings = {
|
||||
/** Shown for a job with no log: never ran, waiting on a human, or log erased/expired. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GitLabPipeline, GitLabPipelineJob } from '../../../gitlab-types'
|
||||
import type { PRCheckDetail } from '../../../github/check-types'
|
||||
import type { CheckStatus } from '../../../github/pull-request-types'
|
||||
import type { PRCheckDetail } from '../../../github/checks/check-types'
|
||||
import type { CheckStatus } from '../../../github/pull-requests/pull-request-types'
|
||||
import { checkRunTimes } from '../pr-check-time'
|
||||
|
||||
export function mapGitLabPipelineJobStatusToCheckStatus(status: string): PRCheckDetail['status'] {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRCheckDetail } from '../../github/check-types'
|
||||
import type { PRCheckDetail } from '../../github/checks/check-types'
|
||||
|
||||
// Neutral/skipped carry no signal and must sink below success. Map provider values to avoid prototype-name ranks
|
||||
// (e.g. constructor/toString resolving as functions on plain objects).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRCheckDetail } from '../../github/check-types'
|
||||
import type { PRCheckDetail } from '../../github/checks/check-types'
|
||||
|
||||
export function getCheckConclusion(check: PRCheckDetail): NonNullable<PRCheckDetail['conclusion']> {
|
||||
return check.conclusion ?? 'pending'
|
||||
|
||||
@@ -4,8 +4,11 @@ import {
|
||||
summarizeProviderChecks,
|
||||
type CheckOutcomeInput
|
||||
} from './provider-check-summary'
|
||||
import type { PRCheckDetail } from '../../github/check-types'
|
||||
import type { CheckStatus, ProviderCheckSummary } from '../../github/pull-request-types'
|
||||
import type { PRCheckDetail } from '../../github/checks/check-types'
|
||||
import type {
|
||||
CheckStatus,
|
||||
ProviderCheckSummary
|
||||
} from '../../github/pull-requests/pull-request-types'
|
||||
|
||||
export function derivePRCheckStatus(checks: readonly PRCheckDetail[]): CheckStatus {
|
||||
const { state } = summarizeProviderChecks(checks)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRCheckJob, PRCheckStep } from '../../github/check-types'
|
||||
import type { PRCheckJob, PRCheckStep } from '../../github/checks/check-types'
|
||||
|
||||
export type StepOutcome = 'success' | 'failure' | 'skipped' | 'pending'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRCheckDetail } from '../../github/check-types'
|
||||
import type { PRCheckDetail } from '../../github/checks/check-types'
|
||||
|
||||
// GitHub reports an unset time as the zero date; anything before the epoch is that sentinel, not a run.
|
||||
export function normalizeCheckTimestamp(value: unknown): string | undefined {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { buildFixBrokenChecksPrompt, getCheckDetailsPromptKey } from './pr-checks-fix-prompt'
|
||||
import type { PRCheckDetail, PRCheckJob, PRCheckRunDetails } from '../../github/check-types'
|
||||
import type { PRCheckDetail, PRCheckJob, PRCheckRunDetails } from '../../github/checks/check-types'
|
||||
|
||||
const failingCheck: PRCheckDetail = {
|
||||
name: 'unit',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from '../../github/check-types'
|
||||
import type { PRCheckDetail, PRCheckRunDetails } from '../../github/checks/check-types'
|
||||
import { getCheckStatusLabel } from './pr-check-status-label'
|
||||
|
||||
export const PROMPT_LOG_TAIL_LINES = 150
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { CheckStatus, ProviderCheckSummary } from '../../github/pull-request-types'
|
||||
import type {
|
||||
CheckStatus,
|
||||
ProviderCheckSummary
|
||||
} from '../../github/pull-requests/pull-request-types'
|
||||
|
||||
export type CheckOutcome = 'passed' | 'failed' | 'pending' | 'neutral'
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { GitConflictOperation } from '../../git/status/git-status-types'
|
||||
import type { PRInfo } from '../../github/pull-request-types'
|
||||
import type { PRInfo } from '../../github/pull-requests/pull-request-types'
|
||||
import {
|
||||
resolveGitHubPRMergeState,
|
||||
type GitHubPRMergeStateKind
|
||||
} from '../../github/pull-request-merge-state'
|
||||
import { resolveGitHubPRStackMergeDecision } from '../../github/pull-request-stack-merge'
|
||||
} from '../../github/pull-requests/merge/pull-request-merge-state'
|
||||
import { resolveGitHubPRStackMergeDecision } from '../../github/pull-requests/merge/pull-request-stack-merge'
|
||||
import type { SourceControlCommitAreaPrimaryActionDecision } from './source-control-primary-action-decision-types'
|
||||
|
||||
// What the branch's hosted review creation offers once nothing local is left to do.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HostedReviewCreationEligibility } from '../hosted-review/hosted-review-contracts'
|
||||
import type { GitUpstreamStatus } from '../../git/status/git-status-types'
|
||||
import type { PRState } from '../../github/pull-request-types'
|
||||
import type { PRState } from '../../github/pull-requests/pull-request-types'
|
||||
|
||||
export type SourceControlPrimaryActionKind =
|
||||
| 'commit'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { StackedReviewFailureReason } from './stacked-hosted-review-failure-copy'
|
||||
import type {
|
||||
CheckStatus,
|
||||
GitHubRepositoryIdentity,
|
||||
PRConflictSummary,
|
||||
PRMergeableState,
|
||||
PRReviewDecision,
|
||||
ProviderCheckSummary
|
||||
} from '../../github/pull-request-types'
|
||||
} from '../../github/pull-requests/pull-request-types'
|
||||
import type { GitHubRepositoryIdentity } from '../../github/repositories/repository-identity'
|
||||
|
||||
export type HostedReviewProvider =
|
||||
| 'github'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { projectPRCheckOwner } from '../../github/complete-pr-check-owner'
|
||||
import { projectPRCheckOwner } from '../../github/checks/complete-pr-check-owner'
|
||||
import type { HostedReviewInfo } from './hosted-review-contracts'
|
||||
import type { PRInfo } from '../../github/pull-request-types'
|
||||
import type { PRInfo } from '../../github/pull-requests/pull-request-types'
|
||||
|
||||
export function hostedReviewInfoFromGitHubPRInfo(pr: PRInfo): HostedReviewInfo {
|
||||
const review: HostedReviewInfo = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRComment } from '../../github/comment-types'
|
||||
import type { PRComment } from '../../github/comments/comment-types'
|
||||
import { normalizePRCommentAuthorLogin } from './pr-bot-author-overrides'
|
||||
|
||||
export type PRCommentAudienceFilter = 'all' | 'human' | 'bot'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRComment } from '../../github/comment-types'
|
||||
import type { PRComment } from '../../github/comments/comment-types'
|
||||
|
||||
export type PRCommentGroup =
|
||||
| { kind: 'standalone'; comment: PRComment }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PRComment } from '../../github/comment-types'
|
||||
import type { PRComment } from '../../github/comments/comment-types'
|
||||
import type { PRCommentGroup } from './pr-comment-groups'
|
||||
|
||||
export type PRCommentsResolutionReviewKind = 'PR' | 'MR'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable no-control-regex -- ANSI SGR sequences are raw PTY input. */
|
||||
/** Share chunk carry and dedupe across main’s local/SSH fact scan and renderer remote-runtime/kill-switch byte scans. */
|
||||
|
||||
import { type RepoSlug, parseGitHubIssueOrPRLink } from '../../github/links'
|
||||
import { type RepoSlug, parseGitHubIssueOrPRLink } from '../../github/repositories/links'
|
||||
|
||||
const GITHUB_PR_PATH_MARKER = '/pull/'
|
||||
const TERMINAL_SGR_PATTERN = /\x1b\[[0-?]*[ -/]*m/g
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { githubRepoIdentityKey } from '../github/repository-identity-key'
|
||||
import { githubRepoIdentityKey } from '../github/repositories/repository-identity-key'
|
||||
import type { TaskProvider } from './task-providers'
|
||||
import type { ProjectProviderIdentity } from '../project-types'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GITHUB_IMAGE_ATTACHMENT_CAPABILITY } from '../github/image-attachment'
|
||||
import { GITHUB_IMAGE_ATTACHMENT_CAPABILITY } from '../github/attachments/image-attachment'
|
||||
import { JIRA_AGENT_ACCESS_RUNTIME_CAPABILITY } from '../jira/jira-agent-capability'
|
||||
import {
|
||||
JIRA_CURRENT_SPRINT_RUNTIME_CAPABILITY,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CheckStatus, ProviderCheckSummary } from './github/pull-request-types'
|
||||
import type { CheckStatus, ProviderCheckSummary } from './github/pull-requests/pull-request-types'
|
||||
import type { HostedReviewState } from './source-control/hosted-review/hosted-review-contracts'
|
||||
import {
|
||||
resolveProviderCheckState,
|
||||
|
||||
Reference in New Issue
Block a user