From 3a1980811c335edaaee8814f9b54fd34851a5ee5 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 9 Apr 2021 16:15:43 +0200 Subject: [PATCH] feat: group:Nodejs (#9469) Remove hardcoded Node.js rules from docker extract and instead add group:nodeJs to group:recommended BREAKING CHANGE: node images founds in Dockerfiles will no longer have hardcoded commitMessageTopic. Add group:Nodejs or config:base to extends for backwards compatibility. --- lib/config/presets/internal/group.ts | 14 +++++++++++++ .../__snapshots__/extract.spec.ts.snap | 5 ----- .../__snapshots__/extract.spec.ts.snap | 1 - .../__snapshots__/extract.spec.ts.snap | 2 -- .../__snapshots__/extract.spec.ts.snap | 20 ------------------- lib/manager/dockerfile/extract.ts | 8 -------- .../__snapshots__/extract.spec.ts.snap | 1 - .../__snapshots__/extract.spec.ts.snap | 1 - .../__snapshots__/extract.spec.ts.snap | 1 - 9 files changed, 14 insertions(+), 39 deletions(-) diff --git a/lib/config/presets/internal/group.ts b/lib/config/presets/internal/group.ts index edfcd3b643464b..20a4c9a135f8b7 100644 --- a/lib/config/presets/internal/group.ts +++ b/lib/config/presets/internal/group.ts @@ -29,10 +29,24 @@ const staticGroups = { }, ], }, + nodeJs: { + description: + "Group anything that looks like Node.js together so that it's updated together", + packageRules: [ + { + matchDatasources: ['docker'], + matchPackageNames: ['node'], + matchPackagePatterns: ['/node$'], + excludePackageNames: ['calico/node'], + commitMessageTopic: 'Node.js', + }, + ], + }, recommended: { description: 'Use curated list of recommended non-monorepo package groupings', extends: [ + 'group:nodeJs', 'group:allApollographql', 'group:fortawesome', 'group:fusionjs', diff --git a/lib/manager/circleci/__snapshots__/extract.spec.ts.snap b/lib/manager/circleci/__snapshots__/extract.spec.ts.snap index 099414ce7920f5..e6ff11b229c9b1 100644 --- a/lib/manager/circleci/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/circleci/__snapshots__/extract.spec.ts.snap @@ -4,7 +4,6 @@ exports[`manager/circleci/extract extractPackageFile() extracts image without le Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "14.8.0", "datasource": "docker", @@ -20,7 +19,6 @@ exports[`manager/circleci/extract extractPackageFile() extracts multiple image l Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": undefined, "datasource": "docker", @@ -31,7 +29,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "4", "datasource": "docker", @@ -42,7 +39,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "6", "datasource": "docker", @@ -53,7 +49,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8.9.0", "datasource": "docker", diff --git a/lib/manager/cloudbuild/__snapshots__/extract.spec.ts.snap b/lib/manager/cloudbuild/__snapshots__/extract.spec.ts.snap index ffd3d8a3be8486..6bffda93dcec3e 100644 --- a/lib/manager/cloudbuild/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/cloudbuild/__snapshots__/extract.spec.ts.snap @@ -12,7 +12,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "12", "datasource": "docker", diff --git a/lib/manager/docker-compose/__snapshots__/extract.spec.ts.snap b/lib/manager/docker-compose/__snapshots__/extract.spec.ts.snap index ce8eb2b879c7e3..6867cb5fa55d5f 100644 --- a/lib/manager/docker-compose/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/docker-compose/__snapshots__/extract.spec.ts.snap @@ -12,7 +12,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "10.0.0", "datasource": "docker", @@ -148,7 +147,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "10.0.0", "datasource": "docker", diff --git a/lib/manager/dockerfile/__snapshots__/extract.spec.ts.snap b/lib/manager/dockerfile/__snapshots__/extract.spec.ts.snap index c1ebae9f7b88c3..7b7696e59e5ab1 100644 --- a/lib/manager/dockerfile/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/dockerfile/__snapshots__/extract.spec.ts.snap @@ -4,7 +4,6 @@ exports[`manager/dockerfile/extract extractPackageFile() detects ["stage"] and [ Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8.15.1-alpine", "datasource": "docker", @@ -123,7 +122,6 @@ exports[`manager/dockerfile/extract extractPackageFile() extracts images on adja Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": "sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d", "currentValue": "8.11.3-alpine", "datasource": "docker", @@ -147,7 +145,6 @@ exports[`manager/dockerfile/extract extractPackageFile() extracts multiple FROM Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "6.12.3", "datasource": "docker", @@ -185,7 +182,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles abnormal spacin Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8.7.0", "datasource": "docker", @@ -214,7 +210,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles comments 1`] = Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": undefined, "datasource": "docker", @@ -229,7 +224,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles custom hosts 1` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8", "datasource": "docker", @@ -244,7 +238,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles custom hosts an Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8-alpine", "datasource": "docker", @@ -259,7 +252,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles custom hosts wi Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8", "datasource": "docker", @@ -274,7 +266,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles custom hosts wi Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8", "datasource": "docker", @@ -289,7 +280,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles custom hosts wi Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": undefined, "datasource": "docker", @@ -304,7 +294,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles digest 1`] = ` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063", "currentValue": undefined, "datasource": "docker", @@ -319,7 +308,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles from as 1`] = ` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8.9.0-alpine", "datasource": "docker", @@ -334,7 +322,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles naked dep 1`] = Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": undefined, "datasource": "docker", @@ -349,7 +336,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles namespaced imag Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8", "datasource": "docker", @@ -364,7 +350,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles tag 1`] = ` Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "8.9.0-alpine", "datasource": "docker", @@ -379,7 +364,6 @@ exports[`manager/dockerfile/extract extractPackageFile() handles tag and digest Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063", "currentValue": "8.9.0", "datasource": "docker", @@ -409,7 +393,6 @@ exports[`manager/dockerfile/extract extractPackageFile() is case insensitive 1`] Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": undefined, "datasource": "docker", @@ -424,7 +407,6 @@ exports[`manager/dockerfile/extract extractPackageFile() skips index reference C Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "6.12.3", "datasource": "docker", @@ -439,7 +421,6 @@ exports[`manager/dockerfile/extract extractPackageFile() skips named multistage Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "6.12.3", "datasource": "docker", @@ -454,7 +435,6 @@ exports[`manager/dockerfile/extract extractPackageFile() skips named multistage Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "6.12.3", "datasource": "docker", diff --git a/lib/manager/dockerfile/extract.ts b/lib/manager/dockerfile/extract.ts index fae09b1aff9eab..01d9e58af7be95 100644 --- a/lib/manager/dockerfile/extract.ts +++ b/lib/manager/dockerfile/extract.ts @@ -48,14 +48,6 @@ export function getDep( '{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}'; } dep.datasource = datasourceDocker.id; - if ( - dep.depName && - (dep.depName === 'node' || dep.depName.endsWith('/node')) && - dep.depName !== 'calico/node' - ) { - dep.commitMessageTopic = 'Node.js'; - } - if (dep.depName === 'ubuntu') { dep.versioning = ubuntuVersioning.id; } diff --git a/lib/manager/droneci/__snapshots__/extract.spec.ts.snap b/lib/manager/droneci/__snapshots__/extract.spec.ts.snap index 3723edeab59ae7..4d74cfdddd02b0 100644 --- a/lib/manager/droneci/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/droneci/__snapshots__/extract.spec.ts.snap @@ -13,7 +13,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": "sha256:36adc17e9cceab32179d3314da9cb9c737ffb11f0de4e688f407ad6d9ca32201", "currentValue": "10.0.0", "datasource": "docker", diff --git a/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap b/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap index 900449a8c59363..d7d3f17dee9b11 100644 --- a/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap @@ -67,7 +67,6 @@ Array [ }, Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": "sha256:7b65413af120ec5328077775022c78101f103258a1876ec2f83890bce416e896", "currentValue": "6", "datasource": "docker", diff --git a/lib/manager/gitlabci/__snapshots__/extract.spec.ts.snap b/lib/manager/gitlabci/__snapshots__/extract.spec.ts.snap index 0cb54034e6210a..89a2a0259235a0 100644 --- a/lib/manager/gitlabci/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/gitlabci/__snapshots__/extract.spec.ts.snap @@ -148,7 +148,6 @@ Array [ "deps": Array [ Object { "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", - "commitMessageTopic": "Node.js", "currentDigest": undefined, "currentValue": "12", "datasource": "docker",