Skip to content

Commit

Permalink
fix(config): don't skip migration PR if closed PR found (#16380)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Jul 2, 2022
1 parent 54fa53b commit b18d31b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
15 changes: 0 additions & 15 deletions lib/workers/repository/config-migration/pr/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,6 @@ describe('workers/repository/config-migration/pr/index', () => {
expect(platform.createPr).toHaveBeenCalledTimes(0);
});

it('Founds a closed PR and exit', async () => {
platform.getBranchPr.mockResolvedValueOnce(null);
platform.findPr.mockResolvedValueOnce(
mock<Pr>({
title: 'Config Migration',
})
);
await ensureConfigMigrationPr(config, migratedData);
expect(platform.updatePr).toHaveBeenCalledTimes(0);
expect(platform.createPr).toHaveBeenCalledTimes(0);
expect(logger.debug).toHaveBeenCalledWith(
'Found closed migration PR, exiting...'
);
});

it('Dry runs and does not update out of date PR', async () => {
GlobalConfig.set({
dryRun: 'full',
Expand Down
10 changes: 0 additions & 10 deletions lib/workers/repository/config-migration/pr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { RenovateConfig } from '../../../../config/types';
import { logger } from '../../../../logger';
import { platform } from '../../../../modules/platform';
import { hashBody } from '../../../../modules/platform/pr-body';
import { PrState } from '../../../../types';
import { emojify } from '../../../../util/emoji';
import { deleteBranch } from '../../../../util/git';
import * as template from '../../../../util/template';
Expand All @@ -27,11 +26,6 @@ export async function ensureConfigMigrationPr(
const branchName = getMigrationBranchName(config);
const prTitle = 'Migrate Renovate config';
const existingPr = await platform.getBranchPr(branchName);
const closedPr = await platform.findPr({
branchName,
prTitle,
state: PrState.Closed,
});
const filename = migratedConfigData.filename;
logger.debug('Filling in config migration PR template');
let prBody = `The Renovate config in this repository needs migrating. Typically this is because one or more configuration options you are using have been renamed.
Expand Down Expand Up @@ -83,10 +77,6 @@ ${
}
return;
}
if (closedPr) {
logger.debug('Found closed migration PR, exiting...');
return;
}
logger.debug('Creating migration PR');
const labels = prepareLabels(config);
try {
Expand Down

0 comments on commit b18d31b

Please sign in to comment.