Skip to content

Commit 1dbb911

Browse files
dotkasandrei-cacio
andauthored
feat: dropping EOL Node support, bumping shescape (#270)
* feat: dropping EOL Node support * fix: fixed failing tests * fix: bumping shescape, removing shell, after author fix * fix: increase context deadline * chore: increase test timeouts to 3 minutes * chore: bumping major version BREAKING CHANGE: This plugin now requires at least Node 20 to run. * chore: OK how about 10 minutes? --------- Co-authored-by: Andrei Cacio <[email protected]>
1 parent 321e556 commit 1dbb911

File tree

9 files changed

+27
-21
lines changed

9 files changed

+27
-21
lines changed

.circleci/config.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
node: circleci/node@5.1.0
4+
node: circleci/node@7.1.0
55
prodsec: snyk/prodsec-orb@1
66

77
defaults: &defaults
@@ -49,6 +49,7 @@ jobs:
4949
steps:
5050
- run:
5151
name: Run tests
52+
no_output_timeout: 30m
5253
command: |
5354
BUILDKIT_PROGRESS=plain \
5455
DOCKER_BUILDKIT=1 \
@@ -69,6 +70,7 @@ jobs:
6970
steps:
7071
- run:
7172
name: Run tests
73+
no_output_timeout: 30m
7274
command: |
7375
BUILDKIT_PROGRESS=plain \
7476
DOCKER_BUILDKIT=1 \
@@ -147,9 +149,9 @@ workflows:
147149
matrix:
148150
parameters:
149151
node_version: [
150-
'14',
151-
'16',
152-
'18',
152+
'24',
153+
'22',
154+
'20',
153155
]
154156
python_version: [
155157
'3.8',

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.16.0
1+
20

lib/dependencies/sub-process.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { spawn, spawnSync, SpawnOptions } from 'child_process';
2-
import { quoteAll } from 'shescape';
1+
import { spawn, SpawnOptions, spawnSync } from 'child_process';
2+
import { quoteAll } from 'shescape/stateless';
33

44
interface ProcessOptions {
55
cwd?: string;
@@ -39,7 +39,7 @@ export function execute(
3939
options?: ProcessOptions
4040
): Promise<string> {
4141
const spawnOptions = makeSpawnOptions(options);
42-
args = quoteAll(args, spawnOptions);
42+
args = quoteAll(args, { flagProtection: false });
4343
return new Promise((resolve, reject) => {
4444
let stdout = '';
4545
let stderr = '';
@@ -67,7 +67,7 @@ export function executeSync(
6767
options?: ProcessOptions
6868
) {
6969
const spawnOptions = makeSpawnOptions(options);
70-
args = quoteAll(args, spawnOptions);
70+
args = quoteAll(args, { flagProtection: false });
7171

7272
return spawnSync(command, args, spawnOptions);
7373
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"dependencies": {
2727
"@snyk/cli-interface": "^2.11.2",
2828
"@snyk/dep-graph": "^1.28.1",
29-
"shescape": "1.6.1",
29+
"shescape": "2.1.4",
3030
"snyk-poetry-lockfile-parser": "^1.9.0",
3131
"tmp": "0.2.3"
3232
},
3333
"devDependencies": {
3434
"@types/jest": "^28.1.3",
35-
"@types/node": "^16.11.66",
35+
"@types/node": "^20",
3636
"@types/tmp": "^0.1.0",
3737
"@typescript-eslint/eslint-plugin": "^4.33.0",
3838
"@typescript-eslint/parser": "^4.33.0",
@@ -46,6 +46,6 @@
4646
"sinon": "^2.3.2",
4747
"ts-jest": "^28.0.8",
4848
"ts-node": "^8.10.2",
49-
"typescript": "^4.8.4"
49+
"typescript": "^5.8.3"
5050
}
5151
}

test/system/inspect.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as fs from 'fs';
1414
import * as path from 'path';
1515

1616
// Usually the setup of virtual environments can run for a while
17-
jest.setTimeout(120000);
17+
jest.setTimeout(180000);
1818

1919
interface Labels {
2020
pkgIdProvenance?: string;
@@ -251,7 +251,7 @@ describe('inspect', () => {
251251
pkg: {
252252
name: 'jsonschema',
253253
},
254-
directDeps: ['openapi-spec-validator'],
254+
directDeps: ['jsonschema', 'openapi-spec-validator'],
255255
},
256256
],
257257
},
@@ -347,7 +347,8 @@ describe('inspect', () => {
347347
const result = await inspect('.', FILENAMES.pip.manifest, pluginOpts);
348348

349349
compareTransitiveLines(result.dependencyGraph, expected);
350-
}
350+
},
351+
900000
351352
);
352353

353354
it.each([
@@ -632,7 +633,7 @@ describe('inspect', () => {
632633
pkg: {
633634
name: 'jsonschema',
634635
},
635-
directDeps: ['openapi-spec-validator'],
636+
directDeps: ['jsonschema', 'openapi-spec-validator'],
636637
},
637638
],
638639
},

test/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function updateSetuptools() {
176176

177177
function setupPyInstall() {
178178
updateSetuptools();
179-
const proc = subProcess.executeSync('pip', ['install', '.']);
179+
const proc = subProcess.executeSync('pip', ['install', '-e', '.']);
180180
if (proc.status !== 0) {
181181
console.log('' + proc.stderr);
182182
throw new Error(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
openapi_spec_validator
2+
jsonschema==4.23.0

test/workspaces/pip-app/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ testtools==\
88
2.3.0 # this has a cycle (fixtures ==> testtools);
99
./packages/prometheus_client-0.6.0
1010
opentelemetry-distro[otlp] == 0.35b0
11+
jsonschema==4.23.0

test/workspaces/setup_py-app/setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from distutils.core import setup
3+
from setuptools import setup, find_packages
44

55
setup(
66
name="test_package",
@@ -9,8 +9,9 @@
99
"Django==1.6.1",
1010
"python-etcd==0.4.5",
1111
"urllib3==1.26.16",
12-
"Django-Select2==6.0.1", # this version installs with lowercase so it catches a previous bug in pip_resolve.py
13-
"irc==16.2", # this has a cyclic dependency (internal jaraco.text <==> jaraco.collections)
14-
"testtools==2.3.0", # this has a cycle (fixtures ==> testtools)
12+
"Django-Select2==6.0.1",
13+
"irc==16.2",
14+
"testtools==2.3.0",
15+
"jsonschema==4.23.0"
1516
],
1617
)

0 commit comments

Comments
 (0)