From 9616fab1afc30ea053c0ea40515b9e9e11de5ecc Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 6 Jul 2018 07:05:23 +0200
Subject: [PATCH] fix: delete bloat from updateConfig

---
 lib/workers/repository/updates/flatten.js     | 12 ++++++
 .../__snapshots__/flatten.spec.js.snap        | 42 -------------------
 2 files changed, 12 insertions(+), 42 deletions(-)

diff --git a/lib/workers/repository/updates/flatten.js b/lib/workers/repository/updates/flatten.js
index af9ead4240..10ccf0e383 100644
--- a/lib/workers/repository/updates/flatten.js
+++ b/lib/workers/repository/updates/flatten.js
@@ -39,8 +39,20 @@ function flattenUpdates(config, packageFiles) {
               updateConfig,
               updateConfig[updateConfig.updateType]
             );
+            const updateTypes = [
+              'major',
+              'minor',
+              'patch',
+              'pin',
+              'digest',
+              'lockFileMaintenance',
+            ];
+            for (const updateType of updateTypes) {
+              delete updateConfig[updateType];
+            }
             // Apply again in case any were added by the updateType config
             updateConfig = applyPackageRules(updateConfig);
+            delete updateConfig.packageRules;
             updateConfig.depNameSanitized = updateConfig.depName
               ? updateConfig.depName
                   .replace('@types/', '')
diff --git a/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap b/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap
index 51fb5ef63b..31655be597 100644
--- a/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap
+++ b/test/workers/repository/updates/__snapshots__/flatten.spec.js.snap
@@ -32,20 +32,6 @@ Array [
     "groupSlug": null,
     "labels": Array [],
     "lazyGrouping": true,
-    "lockFileMaintenance": Object {
-      "branchTopic": "lock-file-maintenance",
-      "commitMessageAction": "Lock file maintenance",
-      "commitMessageExtra": null,
-      "commitMessageTopic": null,
-      "enabled": true,
-      "groupName": null,
-      "prBody": "This Pull Request updates \`package.json\` lock files to use the latest dependency versions.\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n-   \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n-   \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
-      "rebaseStalePrs": true,
-      "recreateClosed": true,
-      "schedule": Array [
-        "before 5am on monday",
-      ],
-    },
     "manager": "npm",
     "managerBranchPrefix": "",
     "newValue": "1.0.0",
@@ -104,20 +90,6 @@ Array [
     "groupSlug": null,
     "labels": Array [],
     "lazyGrouping": true,
-    "lockFileMaintenance": Object {
-      "branchTopic": "lock-file-maintenance",
-      "commitMessageAction": "Lock file maintenance",
-      "commitMessageExtra": null,
-      "commitMessageTopic": null,
-      "enabled": true,
-      "groupName": null,
-      "prBody": "This Pull Request updates \`package.json\` lock files to use the latest dependency versions.\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n-   \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n-   \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
-      "rebaseStalePrs": true,
-      "recreateClosed": true,
-      "schedule": Array [
-        "before 5am on monday",
-      ],
-    },
     "manager": "npm",
     "managerBranchPrefix": "",
     "newValue": "2.0.0",
@@ -250,20 +222,6 @@ Array [
     "labels": Array [],
     "language": "docker",
     "lazyGrouping": true,
-    "lockFileMaintenance": Object {
-      "branchTopic": "lock-file-maintenance",
-      "commitMessageAction": "Lock file maintenance",
-      "commitMessageExtra": null,
-      "commitMessageTopic": null,
-      "enabled": true,
-      "groupName": null,
-      "prBody": "This Pull Request updates \`package.json\` lock files to use the latest dependency versions.\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n-   \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n-   \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
-      "rebaseStalePrs": true,
-      "recreateClosed": true,
-      "schedule": Array [
-        "before 5am on monday",
-      ],
-    },
     "manager": "docker",
     "managerBranchPrefix": "",
     "newValue": "10.0.1",
-- 
GitLab