diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts index 5a4e48188313713edac354c1e7f0e89cde9e89fb..4fc9e08e7081739864532457e2647c828f6b31e5 100644 --- a/lib/workers/branch/index.spec.ts +++ b/lib/workers/branch/index.spec.ts @@ -11,7 +11,7 @@ import * as _prWorker from '../pr'; import * as _getUpdated from './get-updated'; import * as _exec from '../../util/exec'; import { defaultConfig, platform, mocked } from '../../../test/util'; -import { BranchConfig } from '../common'; +import { BranchConfig, PrResult } from '../common'; import { MANAGER_LOCKFILE_ERROR, REPOSITORY_CHANGED, @@ -22,7 +22,6 @@ import { PR_STATE_OPEN, } from '../../constants/pull-requests'; import { StatusResult } from '../../platform/git/storage'; -import { PrResult } from '../pr'; jest.mock('./get-updated'); jest.mock('./schedule'); diff --git a/lib/workers/branch/index.ts b/lib/workers/branch/index.ts index b370d1404c3ef7ca56e7501ccef0d73bd5f85b32..bb1941e2334abe4e75acb785947c8544e47f9419 100644 --- a/lib/workers/branch/index.ts +++ b/lib/workers/branch/index.ts @@ -15,11 +15,11 @@ import { getParentBranch } from './parent'; import { tryBranchAutomerge } from './automerge'; import { setStability, setUnpublishable } from './status-checks'; import { prAlreadyExisted } from './check-existing'; -import { ensurePr, checkAutoMerge, PrResult } from '../pr'; +import { ensurePr, checkAutoMerge } from '../pr'; import { RenovateConfig } from '../../config'; import { platform } from '../../platform'; import { emojify } from '../../util/emoji'; -import { BranchConfig, ProcessBranchResult } from '../common'; +import { BranchConfig, ProcessBranchResult, PrResult } from '../common'; import { PLATFORM_AUTHENTICATION_ERROR, PLATFORM_BAD_CREDENTIALS, diff --git a/lib/workers/common.ts b/lib/workers/common.ts index 6d070b2d8c371053e0d57de882028e6fe388dfce..9af7ece0ba1d525350d34d7837ac624f6f5b557b 100644 --- a/lib/workers/common.ts +++ b/lib/workers/common.ts @@ -45,6 +45,18 @@ export interface BranchUpgradeConfig updatedArtifacts?: FileData[]; } +export enum PrResult { + AwaitingBranchAutomerge = 'awaiting-branch-automerge', + AwaitingApproval = 'awaiting-approval', + AwaitingGreenBranch = 'awaiting-green-branch', + AwaitingNotPending = 'awaiting-not-pending', + Created = 'created', + Error = 'error', + ErrorAlreadyExists = 'error-already-exists', + NotUpdated = 'not-updated', + Updated = 'updated', +} + export type ProcessBranchResult = | 'already-existed' | 'automerged' diff --git a/lib/workers/pr/index.spec.ts b/lib/workers/pr/index.spec.ts index cfde5098b16eb3eab1934d97f26c042d80ed0c59..e7c980cba68de3c83fec2948d3987e4cadae8502 100644 --- a/lib/workers/pr/index.spec.ts +++ b/lib/workers/pr/index.spec.ts @@ -5,7 +5,7 @@ import { platform as _platform, Pr } from '../../platform'; import { mocked } from '../../../test/util'; import { BranchStatus } from '../../types'; import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms'; -import { PrResult } from '.'; +import { PrResult } from '../common'; const changelogHelper = mocked(_changelogHelper); const platform = mocked(_platform); diff --git a/lib/workers/pr/index.ts b/lib/workers/pr/index.ts index 84b638b83400729badb0f652b594949f537b0122..d0c3f49c60e060e84d48f556cf74d80d6bba620a 100644 --- a/lib/workers/pr/index.ts +++ b/lib/workers/pr/index.ts @@ -4,7 +4,7 @@ import { logger } from '../../logger'; import { ChangeLogError, getChangeLogJSON } from './changelog'; import { getPrBody } from './body'; import { platform, Pr, PlatformPrOptions } from '../../platform'; -import { BranchConfig } from '../common'; +import { BranchConfig, PrResult } from '../common'; import { PLATFORM_FAILURE, PLATFORM_INTEGRATION_UNAUTHORIZED, @@ -70,18 +70,6 @@ export async function addAssigneesReviewers(config, pr: Pr): Promise<void> { } } -export enum PrResult { - AwaitingBranchAutomerge = 'awaiting-branch-automerge', - AwaitingApproval = 'awaiting-approval', - AwaitingGreenBranch = 'awaiting-green-branch', - AwaitingNotPending = 'awaiting-not-pending', - Created = 'created', - Error = 'error', - ErrorAlreadyExists = 'error-already-exists', - NotUpdated = 'not-updated', - Updated = 'updated', -} - // Ensures that PR exists with matching title/body export async function ensurePr( prConfig: BranchConfig