Skip to content
Snippets Groups Projects
Commit 19949f26 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix: migrate automergeMajor automergeMinor automergePatch (#922)

This is a misconfiguration by a user but no harm in adding it to migrations.
parent ad3f8d94
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,21 @@ function migrateConfig(config, parentConfig) { ...@@ -33,6 +33,21 @@ function migrateConfig(config, parentConfig) {
if (removedOptions.includes(key)) { if (removedOptions.includes(key)) {
isMigrated = true; isMigrated = true;
delete migratedConfig[key]; delete migratedConfig[key];
} else if (key === 'automergeMinor') {
isMigrated = true;
migratedConfig.minor = migratedConfig.minor || {};
migratedConfig.minor.automerge = val;
delete migratedConfig[key];
} else if (key === 'automergeMajor') {
isMigrated = true;
migratedConfig.major = migratedConfig.major || {};
migratedConfig.major.automerge = val;
delete migratedConfig[key];
} else if (key === 'automergePatch') {
isMigrated = true;
migratedConfig.patch = migratedConfig.patch || {};
migratedConfig.patch.automerge = val;
delete migratedConfig[key];
} else if (key === 'ignoreNodeModules') { } else if (key === 'ignoreNodeModules') {
isMigrated = true; isMigrated = true;
delete migratedConfig.ignoreNodeModules; delete migratedConfig.ignoreNodeModules;
......
...@@ -26,6 +26,12 @@ Object { ...@@ -26,6 +26,12 @@ Object {
"lockFileConfig": Object { "lockFileConfig": Object {
"automerge": true, "automerge": true,
}, },
"major": Object {
"automerge": false,
},
"minor": Object {
"automerge": true,
},
"onboarding": false, "onboarding": false,
"optionalDependencies": Object { "optionalDependencies": Object {
"major": Object { "major": Object {
...@@ -58,6 +64,9 @@ Object { ...@@ -58,6 +64,9 @@ Object {
], ],
}, },
], ],
"patch": Object {
"automerge": true,
},
"prTitle": "some pr title", "prTitle": "some pr title",
"schedule": "on the first day of the month", "schedule": "on the first day of the month",
"semanticPrefix": "fix(deps):", "semanticPrefix": "fix(deps):",
......
...@@ -9,6 +9,9 @@ describe('config/migration', () => { ...@@ -9,6 +9,9 @@ describe('config/migration', () => {
maintainYarnLock: true, maintainYarnLock: true,
onboarding: 'false', onboarding: 'false',
automerge: 'none', automerge: 'none',
automergeMajor: false,
automergeMinor: true,
automergePatch: true,
ignoreNodeModules: true, ignoreNodeModules: true,
autodiscover: 'true', autodiscover: 'true',
schedule: 'on the last day of the month', schedule: 'on the last day of the month',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment