diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts index 75be7c8be628f4c6897a5e08a09e5eb8f2b14a2d..2bded2d10f28350f82175022a6afa3926484dacd 100644 --- a/lib/workers/repository/update/branch/index.spec.ts +++ b/lib/workers/repository/update/branch/index.spec.ts @@ -1117,7 +1117,6 @@ describe('workers/repository/update/branch/index', () => { commit.commitFilesToBranch.mockResolvedValueOnce(null); const inconfig = { ...config, - dependencyDashboardChecks: { 'renovate/some-branch': 'true' }, updatedArtifacts: [{ type: 'deletion', path: 'dummy' }], } as BranchConfig; expect(await branchWorker.processBranch(inconfig)).toEqual({ @@ -1194,6 +1193,42 @@ describe('workers/repository/update/branch/index', () => { expect(commit.commitFilesToBranch).toHaveBeenCalled(); }); + it('updates branch if stopUpdatingLabel presents and dependency dashboard box checked', async () => { + getUpdated.getUpdatedPackageFiles.mockResolvedValueOnce( + partial<PackageFilesResult>({ + updatedPackageFiles: [partial<FileChange>({})], + artifactErrors: [], + updatedArtifacts: [], + }) + ); + npmPostExtract.getAdditionalFiles.mockResolvedValueOnce({ + artifactErrors: [], + updatedArtifacts: [partial<FileChange>({})], + } as WriteExistingFilesResult); + git.branchExists.mockReturnValue(true); + platform.getBranchPr.mockResolvedValueOnce({ + title: 'rebase!', + state: PrState.Open, + labels: ['stop-updating'], + bodyStruct: { hash: hashBody(`- [ ] <!-- rebase-check -->`) }, + } as Pr); + git.isBranchModified.mockResolvedValueOnce(true); + schedule.isScheduledNow.mockReturnValueOnce(false); + commit.commitFilesToBranch.mockResolvedValueOnce(null); + const inconfig = { + ...config, + dependencyDashboardChecks: { 'renovate/some-branch': 'true' }, + updatedArtifacts: [{ type: 'deletion', path: 'dummy' }], + } as BranchConfig; + expect(await branchWorker.processBranch(inconfig)).toEqual({ + branchExists: true, + prNo: undefined, + result: 'done', + commitSha: null, + }); + expect(commit.commitFilesToBranch).toHaveBeenCalled(); + }); + it('executes post-upgrade tasks if trust is high', async () => { const updatedPackageFile: FileChange = { type: 'addition', diff --git a/lib/workers/repository/update/branch/index.ts b/lib/workers/repository/update/branch/index.ts index d9d7082c49a6313b4d4953d6453c5c65e9879317..a0692ecae05e96bfc5768009b0aa6a36115792da 100644 --- a/lib/workers/repository/update/branch/index.ts +++ b/lib/workers/repository/update/branch/index.ts @@ -489,7 +489,7 @@ export async function processBranch( const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested; - if (branchExists && dependencyDashboardCheck && config.stopUpdating) { + if (branchExists && !dependencyDashboardCheck && config.stopUpdating) { if (!prRebaseChecked) { logger.info( 'Branch updating is skipped because stopUpdatingLabel is present in config'