Skip to content

Commit

Permalink
fix(baseBranches): resolve presets within base branch config (#22958)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 24, 2023
1 parent 5db51f5 commit 4e78c17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/workers/repository/process/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ describe('workers/repository/process/index', () => {

it('reads config from branches in baseBranches if useBaseBranchConfig specified', async () => {
scm.branchExists.mockResolvedValue(true);
platform.getJsonFile = jest.fn().mockResolvedValue({});
platform.getJsonFile = jest
.fn()
.mockResolvedValue({ extends: [':approveMajorUpdates'] });
config.baseBranches = ['master', 'dev'];
config.useBaseBranchConfig = 'merge';
getCache().configFileName = 'renovate.json';
Expand Down
2 changes: 2 additions & 0 deletions lib/workers/repository/process/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO #7154
import { mergeChildConfig } from '../../../config';
import { GlobalConfig } from '../../../config/global';
import { resolveConfigPresets } from '../../../config/presets';
import type { RenovateConfig } from '../../../config/types';
import { CONFIG_VALIDATION } from '../../../constants/error-messages';
import { addMeta, logger, removeMeta } from '../../../logger';
Expand Down Expand Up @@ -58,6 +59,7 @@ async function getBaseBranchConfig(
throw error;
}

baseBranchConfig = await resolveConfigPresets(baseBranchConfig, config);
baseBranchConfig = mergeChildConfig(config, baseBranchConfig);

// istanbul ignore if
Expand Down

0 comments on commit 4e78c17

Please sign in to comment.