Skip to content

Commit 455da6a

Browse files
committed
add supported versions file for integrations
1 parent 0136851 commit 455da6a

File tree

3 files changed

+160
-3
lines changed

3 files changed

+160
-3
lines changed

packages/dd-trace/test/plugins/versions/index.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
const { subset } = require('semver')
44
const latests = require('./package.json').dependencies
5+
const supported = require('./supported.json')
56

7+
const dir = 'packages/dd-trace/test/plugins/versions'
68
const exactVersionExp = /^=?\d+\.\d+\.\d+/
79

810
/**
@@ -25,7 +27,7 @@ function capSubrange (name, subrange) {
2527

2628
if (!latests[name]) {
2729
throw new Error(
28-
`Latest version for '${name}' needs to be defined in 'packages/dd-trace/test/plugins/versions/package.json'.`
30+
`Latest version for '${name}' needs to be defined in '${dir}/package.json'.`
2931
)
3032
}
3133

@@ -40,6 +42,25 @@ function capSubrange (name, subrange) {
4042
return `${subrange} <=${latests[name]}`
4143
}
4244

45+
/**
46+
* @param {string} name
47+
* @param {string} subrange
48+
*/
49+
function assertSupported (name, subrange) {
50+
if (!supported[name]) {
51+
throw new Error(
52+
`Supported version range for '${name}' needs to be defined in '${dir}/supported.json'.`
53+
)
54+
}
55+
56+
if (!subset(subrange, supported[name])) {
57+
throw new Error(
58+
`Version range '${subrange}' for '${name}' is lower than supported range defined in '${dir}/supported.json'.`
59+
)
60+
}
61+
}
62+
4363
module.exports = {
44-
getCappedRange
64+
getCappedRange,
65+
assertSupported
4566
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"@apollo/gateway": ">=2.3",
3+
"@apollo/server": ">=4",
4+
"@aws-sdk/smithy-client": ">=3",
5+
"@azure/functions": ">=4",
6+
"@azure/service-bus": ">=7.9.2",
7+
"@confluentinc/kafka-javascript": ">=1",
8+
"@cucumber/cucumber": ">=7",
9+
"@elastic/elasticsearch": ">=5.6.16",
10+
"@elastic/transport": ">=8",
11+
"@google-cloud/pubsub": ">=1.2",
12+
"@google-cloud/vertexai": ">=1",
13+
"@graphql-tools/executor": ">=0.0.14",
14+
"@grpc/grpc-js": ">=1.0.3",
15+
"@hapi/hapi": ">=17.9",
16+
"@jest/core": ">=24.8",
17+
"@jest/reporters": ">=24.8",
18+
"@jest/test-sequencer": ">=28",
19+
"@jest/transform": ">=24.8",
20+
"@koa/router": ">=8",
21+
"@langchain/core": ">=0.1",
22+
"@node-redis/client": ">=1",
23+
"@opensearch-project/opensearch": ">=1",
24+
"@prisma/client": ">=6.1",
25+
"@redis/client": ">=1.1",
26+
"@smithy/smithy-client": ">=1.0.3",
27+
"@vitest/runner": ">=1.6",
28+
"aerospike": ">=4",
29+
"amqp10": ">=3",
30+
"amqplib": ">=0.5.0",
31+
"apollo-server-core": ">=3",
32+
"avsc": ">=5",
33+
"aws-sdk": ">=2.1.35",
34+
"bluebird": ">=2.0.2",
35+
"body-parser": ">=1.4",
36+
"bunyan": ">=1",
37+
"cassandra-driver": ">=3",
38+
"child_process": null,
39+
"connect": ">=2.2.2",
40+
"cookie": ">=0.4",
41+
"cookie-parser": ">=1",
42+
"couchbase": ">=2.6.12",
43+
"crypto": null,
44+
"cypress": ">=10.2",
45+
"dd-trace-api": null,
46+
"dns": null,
47+
"elasticsearch": ">=10",
48+
"express": ">=4",
49+
"express-mongo-sanitize": ">=1",
50+
"express-session": ">=1.5",
51+
"fastify": ">=1",
52+
"find-my-way": ">=1",
53+
"fs": null,
54+
"generic-pool": ">=2",
55+
"graphql": ">=0.10",
56+
"handlebars": ">=4",
57+
"hapi": ">=16",
58+
"hono": ">=4",
59+
"http": null,
60+
"http2": null,
61+
"https": null,
62+
"ioredis": ">=2",
63+
"iovalkey": ">=0.0.1",
64+
"jest-circus": ">=24.8",
65+
"jest-config": ">=24.8",
66+
"jest-environment-jsdom": ">=24.8",
67+
"jest-environment-node": ">=24.8",
68+
"jest-runtime": ">=24.8",
69+
"jest-worker": ">=24.9",
70+
"kafkajs": ">=1.4",
71+
"knex": ">=0.8",
72+
"koa": ">=2",
73+
"koa-router": ">=7",
74+
"ldapjs": ">=2",
75+
"limitd-client": ">=2.8",
76+
"lodash": ">=4",
77+
"mariadb": ">=2.0.4",
78+
"memcached": ">=2.2",
79+
"microgateway-core": ">=2.1",
80+
"mocha": ">=5.2",
81+
"mocha-each": ">=2.0.1",
82+
"moleculer": ">=0.14",
83+
"mongodb": ">=3.3",
84+
"mongodb-core": ">=2",
85+
"mongoose": ">=4.6.4",
86+
"mquery": ">=5",
87+
"multer": ">=1.4.4",
88+
"mysql": ">=2",
89+
"mysql2": ">=1",
90+
"net": null,
91+
"next": ">=10.2",
92+
"node-serialize": ">=0.0.4",
93+
"node:child_process": null,
94+
"node:crypto": null,
95+
"node:dns": null,
96+
"node:fs": null,
97+
"node:http": null,
98+
"node:http2": null,
99+
"node:https": null,
100+
"node:net": null,
101+
"node:url": null,
102+
"nyc": ">=17",
103+
"openai": ">=3",
104+
"oracledb": ">=5",
105+
"passport": ">=0.3",
106+
"passport-http": ">=0.3",
107+
"passport-local": ">=1",
108+
"pg": ">=8.0.3",
109+
"pino": ">=2",
110+
"pino-pretty": ">=1",
111+
"playwright": ">=1.38",
112+
"playwright-core": ">=1.38",
113+
"promise": ">=7",
114+
"promise-js": ">=0.0.3",
115+
"protobufjs": ">=6.8",
116+
"pug": ">=2.0.4",
117+
"q": ">=1",
118+
"redis": ">=0.12",
119+
"restify": ">=3",
120+
"rhea": ">=1",
121+
"router": ">=1",
122+
"selenium-webdriver": ">=4.11",
123+
"sequelize": ">=4",
124+
"sharedb": ">=1",
125+
"tedious": ">=1",
126+
"undici": ">=4.4.1",
127+
"url": null,
128+
"vitest": ">=1.6",
129+
"when": ">=3",
130+
"winston": ">=1",
131+
"workerpool": ">=6"
132+
}

scripts/install_plugin_modules.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const semver = require('semver')
88
const exec = require('./helpers/exec')
99
const externals = require('../packages/dd-trace/test/plugins/externals.json')
1010
const { getInstrumentation } = require('../packages/dd-trace/test/setup/helpers/load-inst')
11-
const { getCappedRange } = require('../packages/dd-trace/test/plugins/versions')
11+
const { assertSupported, getCappedRange } = require('../packages/dd-trace/test/plugins/versions')
1212

1313
const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json')
1414

@@ -112,6 +112,10 @@ async function assertFolder (name, version) {
112112
* @param {boolean} external
113113
*/
114114
async function assertPackage (name, version, dependencyVersionRange, external) {
115+
if (!external) {
116+
assertSupported(name, dependencyVersionRange)
117+
}
118+
115119
const dependencies = {
116120
[name]: getCappedRange(name, dependencyVersionRange)
117121
}

0 commit comments

Comments
 (0)