Skip to content

Commit c818d99

Browse files
ananzhkavilla
andauthored
Bump node version to 14.20.0 (#2101)
* bump node version to 14.20.0 to solve CVE issue Issue: N/a CVE issue: https://nvd.nist.gov/vuln/detail/CVE-2022-32214 [Tests] fix issue with tests and 0 values for node version Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Kawika Avilla <kavilla414@gmail.com> Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
1 parent 55181d4 commit c818d99

File tree

7 files changed

+35
-20
lines changed

7 files changed

+35
-20
lines changed

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.19.1
1+
14.20.0

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.19.1
1+
14.20.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG NODE_VERSION=14.19.1
1+
ARG NODE_VERSION=14.20.0
22
FROM node:${NODE_VERSION} AS base
33

44
ENV HOME '.'

TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In general, we recommend four tiers of tests:
2424

2525
# Requirements
2626
* Install the latest NodeJS, [NPM](https://www.npmjs.com/get-npm) and [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
27-
* `nvm install v14.19.1`
27+
* `nvm install v14.20.0`
2828
* `npm install -g yarn`
2929

3030
# Running tests

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@
454454
"zlib": "^1.0.5"
455455
},
456456
"engines": {
457-
"node": "14.19.1",
457+
"node": "14.20.0",
458458
"yarn": "^1.21.1"
459459
}
460-
}
460+
}

src/setup_node_env/node_version_validator.test.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,46 @@ describe('NodeVersionValidator', function () {
4343
});
4444

4545
it('should run the script WITH error if the patch version is lower', function (done) {
46-
testValidateNodeVersion(done, requiredNodeVersionWithDiff(0, 0, -1), true);
46+
var lowerPatchversion = requiredNodeVersionWithDiff(0, 0, -1);
47+
testValidateNodeVersion(
48+
done,
49+
lowerPatchversion,
50+
REQUIRED_NODE_JS_VERSION !== lowerPatchversion
51+
);
4752
});
4853

4954
it('should run the script WITH error if the major version is higher', function (done) {
5055
testValidateNodeVersion(done, requiredNodeVersionWithDiff(+1, 0, 0), true);
5156
});
5257

5358
it('should run the script WITH error if the major version is lower', function (done) {
54-
testValidateNodeVersion(done, requiredNodeVersionWithDiff(-1, 0, 0), true);
59+
var lowerMajorVersion = requiredNodeVersionWithDiff(-1, 0, 0);
60+
testValidateNodeVersion(
61+
done,
62+
lowerMajorVersion,
63+
REQUIRED_NODE_JS_VERSION !== lowerMajorVersion
64+
);
5565
});
5666

5767
it('should run the script WITH error if the minor version is higher', function (done) {
5868
testValidateNodeVersion(done, requiredNodeVersionWithDiff(0, +1, 0), true);
5969
});
6070

6171
it('should run the script WITH error if the minor version is lower', function (done) {
62-
testValidateNodeVersion(done, requiredNodeVersionWithDiff(0, -1, 0), true);
72+
var lowerMinorVersion = requiredNodeVersionWithDiff(0, -1, 0);
73+
testValidateNodeVersion(
74+
done,
75+
lowerMinorVersion,
76+
REQUIRED_NODE_JS_VERSION !== lowerMinorVersion
77+
);
6378
});
6479
});
6580

6681
function requiredNodeVersionWithDiff(majorDiff, minorDiff, patchDiff) {
6782
var matches = REQUIRED_NODE_JS_VERSION.match(/^v(\d+)\.(\d+)\.(\d+)/);
68-
var major = parseInt(matches[1]) + majorDiff;
69-
var minor = parseInt(matches[2]) + minorDiff;
70-
var patch = parseInt(matches[3]) + patchDiff;
83+
var major = Math.max(parseInt(matches[1], 10) + majorDiff, 0);
84+
var minor = Math.max(parseInt(matches[2], 10) + minorDiff, 0);
85+
var patch = Math.max(parseInt(matches[3], 10) + patchDiff, 0);
7186

7287
return `v${major}.${minor}.${patch}`;
7388
}

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,10 @@
11201120
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
11211121
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==
11221122

1123-
"@elastic/eui@34.6.0":
1124-
version "34.6.0"
1125-
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-34.6.0.tgz#a7188bc97d9c3120cd65e52ed423377872b604bd"
1126-
integrity sha512-uVMSX0jPJU3LLwD4TRHllyJeTr+Uihh+R5qsFSAzKrCCRZjSfKMmMHKffWhzFyYjG97npdWlMvneXG5q0yobCw==
1123+
"@elastic/eui@npm:@opensearch-project/oui@1.0.0":
1124+
version "1.0.0"
1125+
resolved "https://registry.yarnpkg.com/@opensearch-project/oui/-/oui-1.0.0.tgz#bf5e115c8d0f230415b07cc6acfb149ab081c5de"
1126+
integrity sha512-J709UQc7+il4y3aiqpHzeLOJAQhN6xEGLLHq4sUL3WHTsP37acONINXCpRNMa3FxZ+ChOd2ABmY+Ajs+fIgmug==
11271127
dependencies:
11281128
"@types/chroma-js" "^2.0.0"
11291129
"@types/lodash" "^4.14.160"
@@ -1149,7 +1149,7 @@
11491149
react-is "~16.3.0"
11501150
react-virtualized-auto-sizer "^1.0.2"
11511151
react-window "^1.8.5"
1152-
refractor "^3.4.0"
1152+
refractor "^3.6.0"
11531153
rehype-raw "^5.0.0"
11541154
rehype-react "^6.0.0"
11551155
rehype-stringify "^8.0.0"
@@ -1160,7 +1160,7 @@
11601160
text-diff "^1.0.1"
11611161
unified "^9.2.0"
11621162
unist-util-visit "^2.0.3"
1163-
url-parse "^1.5.0"
1163+
url-parse "^1.5.9"
11641164
uuid "^8.3.0"
11651165
vfile "^4.2.0"
11661166

@@ -15010,7 +15010,7 @@ reflect.ownkeys@^0.2.0:
1501015010
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
1501115011
integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=
1501215012

15013-
refractor@^3.4.0:
15013+
refractor@^3.6.0:
1501415014
version "3.6.0"
1501515015
resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.6.0.tgz#ac318f5a0715ead790fcfb0c71f4dd83d977935a"
1501615016
integrity sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==
@@ -17806,7 +17806,7 @@ url-loader@^2.2.0:
1780617806
mime "^2.4.4"
1780717807
schema-utils "^2.5.0"
1780817808

17809-
url-parse@^1.5.0:
17809+
url-parse@^1.5.9:
1781017810
version "1.5.10"
1781117811
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
1781217812
integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==

0 commit comments

Comments
 (0)