fix: Revert "feat(config): templated branchPrefix migration"

This reverts commit 7235c14df6.
This commit is contained in:
Rhys Arkins 2020-08-31 09:33:19 +02:00
parent 7235c14df6
commit 655bdc1dda
4 changed files with 1 additions and 14 deletions

View file

@ -170,8 +170,6 @@ Warning: it's strongly recommended not to configure this field directly. Use at
You can modify this field if you want to change the prefix used. For example if you want branches to be like `deps/eslint-4.x` instead of `renovate/eslint-4.x` then you configure `branchPrefix` = `deps/`. Or if you wish to avoid forward slashes in branch names then you could use `renovate_` instead, for example. You can modify this field if you want to change the prefix used. For example if you want branches to be like `deps/eslint-4.x` instead of `renovate/eslint-4.x` then you configure `branchPrefix` = `deps/`. Or if you wish to avoid forward slashes in branch names then you could use `renovate_` instead, for example.
`branchPrefix` must be configured at the root of the configuration (e.g. not within any package rule) and is not allowed to use template values. e.g. instead of `renovate/{{parentDir}}-`, configure the template part in `additionalBranchPrefix`, like `"additionalBranchPrefix": "{{parentDir}}-"`.
Note that this setting does not change the default _onboarding_ branch name, i.e. `renovate/configure`. If you wish to change that too, you need to also configure the field `onboardingBranch` in your admin bot config. Note that this setting does not change the default _onboarding_ branch name, i.e. `renovate/configure`. If you wish to change that too, you need to also configure the field `onboardingBranch` in your admin bot config.
## branchTopic ## branchTopic

View file

@ -8,14 +8,13 @@ Object {
exports[`config/migration migrateConfig(config, parentConfig) it migrates config 1`] = ` exports[`config/migration migrateConfig(config, parentConfig) it migrates config 1`] = `
Object { Object {
"additionalBranchPrefix": "{{parentDir}}-", "additionalBranchPrefix": "foo",
"autodiscover": true, "autodiscover": true,
"automerge": false, "automerge": false,
"automergeType": "branch", "automergeType": "branch",
"baseBranches": Array [ "baseBranches": Array [
"next", "next",
], ],
"branchPrefix": "renovate/",
"commitMessage": "{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}some commit message", "commitMessage": "{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}some commit message",
"commitMessageExtra": "{{currentValue}} something", "commitMessageExtra": "{{currentValue}} something",
"dependencyDashboard": true, "dependencyDashboard": true,

View file

@ -44,7 +44,6 @@ describe('config/migration', () => {
automergeType: 'branch-push', automergeType: 'branch-push',
baseBranch: 'next', baseBranch: 'next',
managerBranchPrefix: 'foo', managerBranchPrefix: 'foo',
branchPrefix: 'renovate/{{parentDir}}-',
renovateFork: true, renovateFork: true,
ignoreNodeModules: true, ignoreNodeModules: true,
node: { node: {

View file

@ -194,15 +194,6 @@ export function migrateConfig(
isMigrated = true; isMigrated = true;
delete migratedConfig.managerBranchPrefix; delete migratedConfig.managerBranchPrefix;
migratedConfig.additionalBranchPrefix = val; migratedConfig.additionalBranchPrefix = val;
} else if (
key === 'branchPrefix' &&
is.string(val) &&
val.includes('{{')
) {
isMigrated = true;
const templateIndex = val.indexOf(`{{`);
migratedConfig.branchPrefix = val.substring(0, templateIndex);
migratedConfig.additionalBranchPrefix = val.substring(templateIndex);
} else if (key === 'upgradeInRange') { } else if (key === 'upgradeInRange') {
isMigrated = true; isMigrated = true;
delete migratedConfig.upgradeInRange; delete migratedConfig.upgradeInRange;