Skip to content

Commit

Permalink
Merge pull request #1639 from snyk/feat/drop-node-8-support
Browse files Browse the repository at this point in the history
feat: drop node 8 support
  • Loading branch information
Avishagp committed Feb 15, 2021
2 parents dcca7b7 + 92645c5 commit a3b9001
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 46 deletions.
23 changes: 1 addition & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,6 @@ workflows:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v8 support
context: nodejs-install
node_version: '8.17.0'
use_npm7: false
requires:
- Regression Test
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v12 support
context: nodejs-install
Expand Down Expand Up @@ -484,17 +473,7 @@ workflows:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v8 support
context: nodejs-install
node_version: '8.17.0'
use_npm7: false
requires:
- Regression Test
filters:
branches:
ignore:
- master

- release:
name: Release
context: nodejs-app-release
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ jobs:
matrix:
os: [ubuntu, macos, windows]
snyk_install_method: [binary, npm, yarn]
node_version: [8, 10, 12, 14, 15]
node_version: [10, 12, 14, 15]
exclude:
# Skip yarn for Node 8 for now (see https://github.com/snyk/snyk/issues/1270)
- snyk_install_method: yarn
node_version: 8
# Skip yarn for Windows, as it's a bit crazy to get it working in CI environment. Unless we see evidence we need it, I'd avoid it
- snyk_install_method: yarn
os: windows
# For binary, use only the Node 14
- snyk_install_method: binary
node_version: 8
- snyk_install_method: binary
node_version: 10
- snyk_install_method: binary
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
10
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"snyk": "dist/cli/index.js"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"workspaces": [
".",
Expand Down Expand Up @@ -132,7 +132,7 @@
"@types/jest": "^25.2.3",
"@types/lodash": "^4.14.161",
"@types/needle": "^2.0.4",
"@types/node": "8.10.59",
"@types/node": "^10.0.0",
"@types/restify": "^8.4.2",
"@types/sarif": "^2.1.2",
"@types/sinon": "^7.5.0",
Expand Down
6 changes: 4 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ async function saveJsonResultsToFile(
function checkRuntime() {
if (!runtime.isSupported(process.versions.node)) {
console.error(
`${process.versions.node} is an unsupported nodejs ` +
`Node.js version ${process.versions.node} is an unsupported Node.js ` +
`runtime! Supported runtime range is '${runtime.supportedRange}'`,
);
console.error('Please upgrade your nodejs runtime version and try again.');
console.error(
'Please upgrade your Node.js runtime. The last version of Snyk CLI that supports Node.js v8 is v1.454.0.',
);
process.exit(EXIT_CODES.ERROR);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { gte } from 'semver';

const MIN_RUNTIME = '8.0.0';
const MIN_RUNTIME = '10.0.0';

export const supportedRange = `>= ${MIN_RUNTIME}`;

Expand Down
9 changes: 1 addition & 8 deletions src/lib/monitor/dev-count-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,7 @@ export function execShell(
return new Promise((resolve, reject) => {
exec(cmd, options, (error, stdout, stderr) => {
if (error) {
// TODO: we can probably remove this after unshipping Node 8 support
// and then just directly get the error code like `error.code`
let exitCode = 0;
try {
exitCode = parseInt(error['code']);
} catch {
exitCode = -1;
}
const exitCode = error.code;

const e = new ShellOutError(
error.message,
Expand Down
8 changes: 4 additions & 4 deletions test/runtime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ describe('verify supported nodejs runtime versions', () => {
expect(runtime.isSupported(process.versions.node)).toBeTruthy();
});

it('v8.0.0 is supported', async () => {
expect(runtime.isSupported('8.0.0')).toBeTruthy();
});

it('pre-release is supported', async () => {
expect(runtime.isSupported('11.0.0-pre')).toBeTruthy();
});
Expand All @@ -34,4 +30,8 @@ describe('verify unsupported nodejs runtime versions', () => {
it('verifies v6.4.0 is not supported', async () => {
expect(runtime.isSupported('6.4.0')).toBeFalsy();
});

it('verifies v8.0.0 is not supported', async () => {
expect(runtime.isSupported('8.0.0')).toBeFalsy();
});
});

0 comments on commit a3b9001

Please sign in to comment.