From 4ec98c617c81e476fdaa99997c3c5034ec3b9900 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Thu, 9 May 2024 23:09:58 -0400 Subject: [PATCH 01/58] check for outdated integrations --- package.json | 1 + .../src/playwright.js | 3 +- scripts/helpers/versioning.js | 78 +++++++++++++++++++ scripts/install_plugin_modules.js | 60 ++------------ scripts/outdated.js | 58 ++++++++++++++ 5 files changed, 145 insertions(+), 55 deletions(-) create mode 100644 scripts/helpers/versioning.js create mode 100644 scripts/outdated.js diff --git a/package.json b/package.json index b81e26fdcae..c01c7fe2ddb 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "bench:e2e:ci-visibility": "node benchmark/e2e-ci/benchmark-run.js", "type:doc": "cd docs && yarn && yarn build", "type:test": "cd docs && yarn && yarn test", + "outdated-integrations": "node scripts/outdated.js", "lint": "node scripts/check_licenses.js && eslint . && yarn audit", "lint-fix": "node scripts/check_licenses.js && eslint . --fix && yarn audit", "services": "node ./scripts/install_plugin_modules && node packages/dd-trace/test/setup/services", diff --git a/packages/datadog-instrumentations/src/playwright.js b/packages/datadog-instrumentations/src/playwright.js index e8332d65c8d..1dee90e07ce 100644 --- a/packages/datadog-instrumentations/src/playwright.js +++ b/packages/datadog-instrumentations/src/playwright.js @@ -502,7 +502,8 @@ addHook({ addHook({ name: '@playwright/test', file: 'lib/runner/runner.js', - versions: ['>=1.31.0 <1.38.0'] + versions: ['>=1.31.0 <1.38.0'], + pinned: true }, runnerHook) // From >=1.38.0 diff --git a/scripts/helpers/versioning.js b/scripts/helpers/versioning.js new file mode 100644 index 00000000000..b51eaafee8b --- /dev/null +++ b/scripts/helpers/versioning.js @@ -0,0 +1,78 @@ +const fs = require('fs') +const path = require('path') +const childProcess = require('child_process') +const proxyquire = require('proxyquire') + +const versionLists = {} +const names = [] + +const filter = process.env.hasOwnProperty('PLUGINS') && process.env.PLUGINS.split('|') + +fs.readdirSync(path.join(__dirname, '../../packages/datadog-instrumentations/src')) + .filter(file => file.endsWith('js')) + .forEach(file => { + file = file.replace('.js', '') + + if (!filter || filter.includes(file)) { + names.push(file) + } + }) + +async function getVersionList (name) { + if (versionLists[name]) { + return versionLists[name] + } + const list = await npmView(`${name} versions`) + versionLists[name] = list + return list +} + +function npmView (input) { + return new Promise((resolve, reject) => { + childProcess.exec(`npm view ${input} --json`, (err, stdout) => { + if (err) { + reject(err) + return + } + resolve(JSON.parse(stdout.toString('utf8'))) + }) + }) +} + +function loadInstFile (file, instrumentations) { + const instrument = { + addHook (instrumentation) { + instrumentations.push(instrumentation) + } + } + + const instPath = path.join(__dirname, `../../packages/datadog-instrumentations/src/${file}`) + + proxyquire.noPreserveCache()(instPath, { + './helpers/instrument': instrument, + '../helpers/instrument': instrument + }) +} + +function getInternals () { + return names.map(key => { + const instrumentations = [] + const name = key + + try { + loadInstFile(`${name}/server.js`, instrumentations) + loadInstFile(`${name}/client.js`, instrumentations) + } catch (e) { + loadInstFile(`${name}.js`, instrumentations) + } + + return instrumentations + }).reduce((prev, next) => prev.concat(next), []) +} + +module.exports = { + getVersionList, + npmView, + loadInstFile, + getInternals +} diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index 682e2d3c5ad..422ec70a4b0 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -5,10 +5,13 @@ const os = require('os') const path = require('path') const crypto = require('crypto') const semver = require('semver') -const proxyquire = require('proxyquire') const exec = require('./helpers/exec') -const childProcess = require('child_process') const externals = require('../packages/dd-trace/test/plugins/externals') +const { + getVersionList, + getInternals, + npmView +} = require('./helpers/versioning') const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json') @@ -16,7 +19,6 @@ const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require // Can remove couchbase after removing support for couchbase <= 3.2.0 const excludeList = os.arch() === 'arm64' ? ['aerospike', 'couchbase', 'grpc', 'oracledb'] : [] const workspaces = new Set() -const versionLists = {} const deps = {} const filter = process.env.hasOwnProperty('PLUGINS') && process.env.PLUGINS.split('|') @@ -46,21 +48,7 @@ async function run () { } async function assertVersions () { - const internals = names - .map(key => { - const instrumentations = [] - const name = key - - try { - loadInstFile(`${name}/server.js`, instrumentations) - loadInstFile(`${name}/client.js`, instrumentations) - } catch (e) { - loadInstFile(`${name}.js`, instrumentations) - } - - return instrumentations - }) - .reduce((prev, next) => prev.concat(next), []) + const internals = getInternals() for (const inst of internals) { await assertInstrumentation(inst, false) @@ -158,27 +146,6 @@ async function addDependencies (dependencies, name, versionRange) { } } -async function getVersionList (name) { - if (versionLists[name]) { - return versionLists[name] - } - const list = await npmView(`${name} versions`) - versionLists[name] = list - return list -} - -function npmView (input) { - return new Promise((resolve, reject) => { - childProcess.exec(`npm view ${input} --json`, (err, stdout) => { - if (err) { - reject(err) - return - } - resolve(JSON.parse(stdout.toString('utf8'))) - }) - }) -} - function assertIndex (name, version) { const index = `'use strict' @@ -234,18 +201,3 @@ function sha1 (str) { shasum.update(str) return shasum.digest('hex') } - -function loadInstFile (file, instrumentations) { - const instrument = { - addHook (instrumentation) { - instrumentations.push(instrumentation) - } - } - - const instPath = path.join(__dirname, `../packages/datadog-instrumentations/src/${file}`) - - proxyquire.noPreserveCache()(instPath, { - './helpers/instrument': instrument, - '../helpers/instrument': instrument - }) -} diff --git a/scripts/outdated.js b/scripts/outdated.js new file mode 100644 index 00000000000..b2d70297306 --- /dev/null +++ b/scripts/outdated.js @@ -0,0 +1,58 @@ +/* eslint-disable no-console */ + +const semver = require('semver') +const { + getInternals, + npmView +} = require('./helpers/versioning') + +function satisfiesAny (version, versions) { + for (const ver of versions) { + if (semver.satisfies(version, ver)) { + return true + } + } + return false +} + +async function run () { + const internals = consolidateInternals(getInternals()) + for (const inst in internals) { + const distTags = await npmView(inst + ' dist-tags') + const satisfied = satisfiesAny(distTags.latest, internals[inst]) + if (!satisfied) { + console.log( + `latest version of "${inst}" (${distTags.latest}) not supported in ranges: ${ + Array.from(internals[inst]).map(x => `"${x}"`).join(', ') + }` + ) + if (internals[inst].pinned) { + console.log(`^----- "${inst}" pinned intentionally`) + } else { + process.exitCode = 1 + } + } + } +} + +function consolidateInternals (internals) { + const consolidated = {} + for (const inst of internals) { + if (Array.isArray(inst.name)) continue + if (inst.name.startsWith('node:')) continue + if (!inst.versions) continue + if (!consolidated[inst.name] && inst.versions.length > 0) { + consolidated[inst.name] = new Set(inst.versions) + } else { + for (const ver of inst.versions) { + consolidated[inst.name].add(ver) + } + } + if (inst.pinned) { + consolidated[inst.name].pinned = true + } + } + return consolidated +} + +run() From 030334d6ae8d4a3760e7adb06d698364b460961c Mon Sep 17 00:00:00 2001 From: Bryan English Date: Fri, 10 May 2024 16:17:11 -0400 Subject: [PATCH 02/58] pin everything --- packages/datadog-instrumentations/src/generic-pool.js | 3 ++- packages/datadog-instrumentations/src/redis.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/datadog-instrumentations/src/generic-pool.js b/packages/datadog-instrumentations/src/generic-pool.js index 067a9c7f2b3..198b44a9c5a 100644 --- a/packages/datadog-instrumentations/src/generic-pool.js +++ b/packages/datadog-instrumentations/src/generic-pool.js @@ -33,7 +33,8 @@ function createWrapPool () { addHook({ name: 'generic-pool', - versions: ['^2.4'] + versions: ['^2.4'], + pinned: true }, genericPool => { shimmer.wrap(genericPool.Pool.prototype, 'acquire', createWrapAcquire()) return genericPool diff --git a/packages/datadog-instrumentations/src/redis.js b/packages/datadog-instrumentations/src/redis.js index 8da93ae08ab..06c8d90fa2f 100644 --- a/packages/datadog-instrumentations/src/redis.js +++ b/packages/datadog-instrumentations/src/redis.js @@ -115,7 +115,7 @@ addHook({ name: 'redis', versions: ['>=2.6 <4'] }, redis => { return redis }) -addHook({ name: 'redis', versions: ['>=0.12 <2.6'] }, redis => { +addHook({ name: 'redis', versions: ['>=0.12 <2.6'], pinned: true }, redis => { shimmer.wrap(redis.RedisClient.prototype, 'send_command', sendCommand => function (command, args, callback) { if (!startCh.hasSubscribers) { return sendCommand.apply(this, arguments) From f6d7609a70b866093d021d93222d42886f6bd25b Mon Sep 17 00:00:00 2001 From: Bryan English Date: Sat, 11 May 2024 00:16:10 -0400 Subject: [PATCH 03/58] switch to a big json list of package max versions --- .../src/generic-pool.js | 3 +- .../src/helpers/latests.json | 101 ++++++++++++++++++ .../src/helpers/register.js | 14 ++- .../src/playwright.js | 3 +- .../datadog-instrumentations/src/redis.js | 2 +- scripts/install_plugin_modules.js | 13 ++- scripts/outdated.js | 81 +++++++------- 7 files changed, 166 insertions(+), 51 deletions(-) create mode 100644 packages/datadog-instrumentations/src/helpers/latests.json diff --git a/packages/datadog-instrumentations/src/generic-pool.js b/packages/datadog-instrumentations/src/generic-pool.js index 198b44a9c5a..067a9c7f2b3 100644 --- a/packages/datadog-instrumentations/src/generic-pool.js +++ b/packages/datadog-instrumentations/src/generic-pool.js @@ -33,8 +33,7 @@ function createWrapPool () { addHook({ name: 'generic-pool', - versions: ['^2.4'], - pinned: true + versions: ['^2.4'] }, genericPool => { shimmer.wrap(genericPool.Pool.prototype, 'acquire', createWrapAcquire()) return genericPool diff --git a/packages/datadog-instrumentations/src/helpers/latests.json b/packages/datadog-instrumentations/src/helpers/latests.json new file mode 100644 index 00000000000..d773ba64f50 --- /dev/null +++ b/packages/datadog-instrumentations/src/helpers/latests.json @@ -0,0 +1,101 @@ +{ + "pinned": [ + "generic-pool", + "@playwright/test", + "redis" + ], + "latests": { + "aerospike": "5.12.0", + "amqp10": "3.6.0", + "amqplib": "0.10.4", + "apollo-server-core": "3.13.0", + "@apollo/server": "4.10.4", + "@apollo/gateway": "2.7.7", + "@smithy/smithy-client": "3.0.0", + "@aws-sdk/smithy-client": "3.374.0", + "aws-sdk": "2.1618.0", + "bluebird": "3.7.2", + "body-parser": "1.20.2", + "bunyan": "1.8.15", + "cassandra-driver": "4.7.2", + "connect": "3.7.0", + "cookie-parser": "1.4.6", + "cookie": "0.6.0", + "couchbase": "4.3.1", + "@cucumber/cucumber": "10.6.0", + "cypress": "13.9.0", + "@elastic/transport": "8.5.1", + "@elastic/elasticsearch": "8.13.1", + "elasticsearch": "16.7.3", + "express-mongo-sanitize": "2.2.0", + "express": "4.19.2", + "fastify": "4.27.0", + "find-my-way": "8.2.0", + "fs": "0.0.1-security", + "generic-pool": "3.9.0", + "@google-cloud/pubsub": "4.4.0", + "@graphql-tools/executor": "1.2.6", + "graphql": "16.8.1", + "@grpc/grpc-js": "1.10.7", + "@hapi/hapi": "21.3.9", + "hapi": "18.1.0", + "ioredis": "5.4.1", + "jest-environment-node": "29.7.0", + "jest-environment-jsdom": "29.7.0", + "@jest/core": "29.7.0", + "@jest/test-sequencer": "29.7.0", + "@jest/reporters": "29.7.0", + "jest-circus": "29.7.0", + "@jest/transform": "29.7.0", + "jest-config": "29.7.0", + "jest-runtime": "29.7.0", + "jest-worker": "29.7.0", + "kafkajs": "2.2.4", + "knex": "3.1.0", + "koa": "2.15.3", + "@koa/router": "12.0.1", + "koa-router": "12.0.1", + "ldapjs": "3.0.7", + "limitd-client": "2.14.1", + "mariadb": "3.3.0", + "memcached": "2.2.2", + "microgateway-core": "3.3.3", + "mocha": "10.4.0", + "mocha-each": "2.0.1", + "moleculer": "0.14.33", + "mongodb-core": "3.2.7", + "mongodb": "6.6.1", + "mongoose": "8.3.4", + "mquery": "5.0.0", + "mysql": "2.18.1", + "mysql2": "3.9.7", + "next": "14.2.3", + "openai": "4.44.0", + "@opensearch-project/opensearch": "2.8.0", + "oracledb": "6.5.0", + "paperplane": "3.1.2", + "passport-http": "0.3.0", + "passport-local": "1.0.0", + "pg": "8.11.5", + "pino": "9.0.0", + "pino-pretty": "11.0.0", + "@playwright/test": "1.44.0", + "playwright": "1.44.0", + "promise-js": "0.0.7", + "promise": "8.3.0", + "q": "1.5.1", + "qs": "6.12.1", + "@node-redis/client": "1.0.6", + "@redis/client": "1.5.14", + "redis": "4.6.13", + "restify": "11.1.0", + "rhea": "3.0.2", + "router": "1.3.8", + "selenium-webdriver": "4.20.0", + "sequelize": "6.37.3", + "sharedb": "4.1.4", + "tedious": "18.2.0", + "when": "3.7.8", + "winston": "3.13.0" + } +} \ No newline at end of file diff --git a/packages/datadog-instrumentations/src/helpers/register.js b/packages/datadog-instrumentations/src/helpers/register.js index 4b4185423c0..ded220aef9a 100644 --- a/packages/datadog-instrumentations/src/helpers/register.js +++ b/packages/datadog-instrumentations/src/helpers/register.js @@ -16,6 +16,7 @@ const { const hooks = require('./hooks') const instrumentations = require('./instrumentations') +const latests = require('./latests.json') const names = Object.keys(hooks) const pathSepExpr = new RegExp(`\\${path.sep}`, 'g') const disabledInstrumentations = new Set( @@ -111,7 +112,7 @@ for (const packageName of names) { namesAndSuccesses[`${name}@${version}`] = false } - if (matchVersion(version, versions)) { + if (matchVersion(version, versions) && matchesLatestSupported(name, version)) { // Check if the hook already has a set moduleExport if (hook[HOOK_SYMBOL].has(moduleExports)) { namesAndSuccesses[`${name}@${version}`] = true @@ -155,6 +156,17 @@ for (const packageName of names) { }) } +function matchesLatestSupported (name, version) { + if (latest.pinned.includes(name)) { + // These ones are deliberately pinned to a specific version. That + // means we can skip this check, since it will already have been checked + // to be lower than latest. + return true + } + const latest = latests.latests[name] + return matchVersion(version, ['<=' + latest]) +} + function matchVersion (version, ranges) { return !version || (ranges && ranges.some(range => semver.satisfies(semver.coerce(version), range))) } diff --git a/packages/datadog-instrumentations/src/playwright.js b/packages/datadog-instrumentations/src/playwright.js index 1dee90e07ce..e8332d65c8d 100644 --- a/packages/datadog-instrumentations/src/playwright.js +++ b/packages/datadog-instrumentations/src/playwright.js @@ -502,8 +502,7 @@ addHook({ addHook({ name: '@playwright/test', file: 'lib/runner/runner.js', - versions: ['>=1.31.0 <1.38.0'], - pinned: true + versions: ['>=1.31.0 <1.38.0'] }, runnerHook) // From >=1.38.0 diff --git a/packages/datadog-instrumentations/src/redis.js b/packages/datadog-instrumentations/src/redis.js index 06c8d90fa2f..8da93ae08ab 100644 --- a/packages/datadog-instrumentations/src/redis.js +++ b/packages/datadog-instrumentations/src/redis.js @@ -115,7 +115,7 @@ addHook({ name: 'redis', versions: ['>=2.6 <4'] }, redis => { return redis }) -addHook({ name: 'redis', versions: ['>=0.12 <2.6'], pinned: true }, redis => { +addHook({ name: 'redis', versions: ['>=0.12 <2.6'] }, redis => { shimmer.wrap(redis.RedisClient.prototype, 'send_command', sendCommand => function (command, args, callback) { if (!startCh.hasSubscribers) { return sendCommand.apply(this, arguments) diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index 422ec70a4b0..4ddbf813bab 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -12,6 +12,7 @@ const { getInternals, npmView } = require('./helpers/versioning') +const latests = require('../packages/datadog-instrumentations/src/helpers/latests.json') const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json') @@ -133,7 +134,17 @@ async function assertPackage (name, version, dependency, external) { } async function addDependencies (dependencies, name, versionRange) { - const versionList = await getVersionList(name) + let versionList = await getVersionList(name) + if (!latests.pinned.includes(name)) { + const maxVersion = latests.latests[name] + versionList = versionList.map(version => { + if (version.startsWith('>=') && !version.includes('<')) { + return version + ' <=' + maxVersion + } else { + return version + } + }) + } const version = semver.maxSatisfying(versionList, versionRange) const pkgJson = await npmView(`${name}@${version}`) for (const dep of deps[name]) { diff --git a/scripts/outdated.js b/scripts/outdated.js index b2d70297306..c2b4b93d27e 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -1,58 +1,51 @@ -/* eslint-disable no-console */ - -const semver = require('semver') const { getInternals, npmView } = require('./helpers/versioning') +const path = require('path') +const fs = require('fs') -function satisfiesAny (version, versions) { - for (const ver of versions) { - if (semver.satisfies(version, ver)) { - return true - } - } - return false -} +const latestsPath = path.join( + __dirname, + '..', + 'packages', + 'datadog-instrumentations', + 'src', + 'helpers', + 'latests.json' +) +const latestsJson = require(latestsPath) +const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) + .filter(x => typeof x === 'string' && x !== 'child_process' && !x.startsWith('node:')) -async function run () { - const internals = consolidateInternals(getInternals()) - for (const inst in internals) { - const distTags = await npmView(inst + ' dist-tags') - const satisfied = satisfiesAny(distTags.latest, internals[inst]) - if (!satisfied) { - console.log( - `latest version of "${inst}" (${distTags.latest}) not supported in ranges: ${ - Array.from(internals[inst]).map(x => `"${x}"`).join(', ') - }` - ) - if (internals[inst].pinned) { - console.log(`^----- "${inst}" pinned intentionally`) - } else { - process.exitCode = 1 - } - } +// TODO A lot of this can be optimized by using `npm outdated`. + +async function fix () { + const latests = {} + for (const name of internalsNames) { + const distTags = await npmView(name + ' dist-tags') + const latest = distTags.latest + latests[name] = latest } + latestsJson.latests = latests + fs.writeFileSync(latestsPath, JSON.stringify(latestsJson, null, 2)) } -function consolidateInternals (internals) { - const consolidated = {} - for (const inst of internals) { - if (Array.isArray(inst.name)) continue - if (inst.name.startsWith('node:')) continue - if (!inst.versions) continue - if (!consolidated[inst.name] && inst.versions.length > 0) { - consolidated[inst.name] = new Set(inst.versions) - } else { - for (const ver of inst.versions) { - consolidated[inst.name].add(ver) - } +async function check () { + for (const name of internalsNames) { + const latest = latestsJson.latests[name] + if (!latest) { + console.log(`No latest version found for "${name}"`) + process.exitCode = 1 } - if (inst.pinned) { - consolidated[inst.name].pinned = true + const distTags = await npmView(name + ' dist-tags') + const npmLatest = distTags.latest + if (npmLatest !== latest) { + console.log(`"latests.json: is not up to date for "${name}": expected "${npmLatest}", got "${latest}"`) + process.exitCode = 1 } } - return consolidated } -run() +if (process.argv.includes('fix')) fix() +else check() From 69cbf215e56ac003722bcc0774c0d582be9b9867 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Sat, 11 May 2024 00:42:06 -0400 Subject: [PATCH 04/58] run outdated checker a bunch of times per day --- .github/workflows/outdated-integrations.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/outdated-integrations.yml diff --git a/.github/workflows/outdated-integrations.yml b/.github/workflows/outdated-integrations.yml new file mode 100644 index 00000000000..41173c23005 --- /dev/null +++ b/.github/workflows/outdated-integrations.yml @@ -0,0 +1,18 @@ +name: Outdated Integrations + +on: + pull_request: + push: + branches: [master] + schedule: + # Yes, this runs a _lot_. We don't want to be out of date for very long. + - cron: '37 12,16,22 * * *' + +jobs: + outdated-integrations: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/node/setup + - run: yarn install + - run: yarn outdated-integrations From b3b80d21b1731065171043b46fb79ff1087ccf7c Mon Sep 17 00:00:00 2001 From: Bryan English Date: Sat, 11 May 2024 00:44:33 -0400 Subject: [PATCH 05/58] typo --- packages/datadog-instrumentations/src/helpers/register.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datadog-instrumentations/src/helpers/register.js b/packages/datadog-instrumentations/src/helpers/register.js index ded220aef9a..b67b6f84f54 100644 --- a/packages/datadog-instrumentations/src/helpers/register.js +++ b/packages/datadog-instrumentations/src/helpers/register.js @@ -157,7 +157,7 @@ for (const packageName of names) { } function matchesLatestSupported (name, version) { - if (latest.pinned.includes(name)) { + if (latests.pinned.includes(name)) { // These ones are deliberately pinned to a specific version. That // means we can skip this check, since it will already have been checked // to be lower than latest. From 0e5cd60d4d16433039c4f971950074db3719dbdc Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 17 Sep 2024 11:13:05 -0400 Subject: [PATCH 06/58] fix: update latests.json --- .../src/helpers/latests.json | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/latests.json b/packages/datadog-instrumentations/src/helpers/latests.json index d773ba64f50..2598fb52d12 100644 --- a/packages/datadog-instrumentations/src/helpers/latests.json +++ b/packages/datadog-instrumentations/src/helpers/latests.json @@ -5,39 +5,39 @@ "redis" ], "latests": { - "aerospike": "5.12.0", + "aerospike": "5.12.1", "amqp10": "3.6.0", "amqplib": "0.10.4", "apollo-server-core": "3.13.0", - "@apollo/server": "4.10.4", - "@apollo/gateway": "2.7.7", - "@smithy/smithy-client": "3.0.0", + "@apollo/server": "4.11.0", + "@apollo/gateway": "2.9.0", + "@smithy/smithy-client": "3.3.2", "@aws-sdk/smithy-client": "3.374.0", - "aws-sdk": "2.1618.0", + "aws-sdk": "2.1691.0", "bluebird": "3.7.2", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "bunyan": "1.8.15", "cassandra-driver": "4.7.2", "connect": "3.7.0", "cookie-parser": "1.4.6", "cookie": "0.6.0", - "couchbase": "4.3.1", - "@cucumber/cucumber": "10.6.0", - "cypress": "13.9.0", - "@elastic/transport": "8.5.1", - "@elastic/elasticsearch": "8.13.1", + "couchbase": "4.4.1", + "@cucumber/cucumber": "11.0.1", + "cypress": "13.14.2", + "@elastic/transport": "8.7.1", + "@elastic/elasticsearch": "8.15.0", "elasticsearch": "16.7.3", "express-mongo-sanitize": "2.2.0", - "express": "4.19.2", - "fastify": "4.27.0", - "find-my-way": "8.2.0", + "express": "4.21.0", + "fastify": "5.0.0", + "find-my-way": "9.0.1", "fs": "0.0.1-security", "generic-pool": "3.9.0", - "@google-cloud/pubsub": "4.4.0", - "@graphql-tools/executor": "1.2.6", - "graphql": "16.8.1", - "@grpc/grpc-js": "1.10.7", - "@hapi/hapi": "21.3.9", + "@google-cloud/pubsub": "4.7.2", + "@graphql-tools/executor": "1.3.1", + "graphql": "16.9.0", + "@grpc/grpc-js": "1.11.2", + "@hapi/hapi": "21.3.10", "hapi": "18.1.0", "ioredis": "5.4.1", "jest-environment-node": "29.7.0", @@ -53,49 +53,49 @@ "kafkajs": "2.2.4", "knex": "3.1.0", "koa": "2.15.3", - "@koa/router": "12.0.1", - "koa-router": "12.0.1", + "@koa/router": "13.0.1", + "koa-router": "13.0.1", "ldapjs": "3.0.7", "limitd-client": "2.14.1", - "mariadb": "3.3.0", + "mariadb": "3.3.1", "memcached": "2.2.2", - "microgateway-core": "3.3.3", - "mocha": "10.4.0", + "microgateway-core": "3.3.4", + "mocha": "10.7.3", "mocha-each": "2.0.1", - "moleculer": "0.14.33", + "moleculer": "0.14.34", "mongodb-core": "3.2.7", - "mongodb": "6.6.1", - "mongoose": "8.3.4", + "mongodb": "6.9.0", + "mongoose": "8.6.2", "mquery": "5.0.0", "mysql": "2.18.1", - "mysql2": "3.9.7", - "next": "14.2.3", - "openai": "4.44.0", - "@opensearch-project/opensearch": "2.8.0", - "oracledb": "6.5.0", + "mysql2": "3.11.3", + "next": "14.2.11", + "openai": "4.61.1", + "@opensearch-project/opensearch": "2.12.0", + "oracledb": "6.6.0", "paperplane": "3.1.2", "passport-http": "0.3.0", "passport-local": "1.0.0", - "pg": "8.11.5", - "pino": "9.0.0", - "pino-pretty": "11.0.0", - "@playwright/test": "1.44.0", - "playwright": "1.44.0", + "pg": "8.13.0", + "pino": "9.4.0", + "pino-pretty": "11.2.2", + "@playwright/test": "1.47.1", + "playwright": "1.47.1", "promise-js": "0.0.7", "promise": "8.3.0", "q": "1.5.1", - "qs": "6.12.1", + "qs": "6.13.0", "@node-redis/client": "1.0.6", - "@redis/client": "1.5.14", - "redis": "4.6.13", + "@redis/client": "1.6.0", + "redis": "4.7.0", "restify": "11.1.0", "rhea": "3.0.2", "router": "1.3.8", - "selenium-webdriver": "4.20.0", + "selenium-webdriver": "4.24.1", "sequelize": "6.37.3", - "sharedb": "4.1.4", - "tedious": "18.2.0", + "sharedb": "5.0.4", + "tedious": "18.6.1", "when": "3.7.8", - "winston": "3.13.0" + "winston": "3.14.2" } } \ No newline at end of file From 3b200e01214f5ad2a62f30a17bb40e5d083d894a Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 17 Sep 2024 12:49:06 -0400 Subject: [PATCH 07/58] adding creating a pr from outdated integrations --- .github/workflows/outdated-integrations.yml | 3 --- scripts/outdated.js | 24 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/outdated-integrations.yml b/.github/workflows/outdated-integrations.yml index 41173c23005..7a0512545f3 100644 --- a/.github/workflows/outdated-integrations.yml +++ b/.github/workflows/outdated-integrations.yml @@ -1,9 +1,6 @@ name: Outdated Integrations on: - pull_request: - push: - branches: [master] schedule: # Yes, this runs a _lot_. We don't want to be out of date for very long. - cron: '37 12,16,22 * * *' diff --git a/scripts/outdated.js b/scripts/outdated.js index c2b4b93d27e..0ea82a4ab3e 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -4,6 +4,7 @@ const { } = require('./helpers/versioning') const path = require('path') const fs = require('fs') +const { execSync } = require('child_process') const latestsPath = path.join( __dirname, @@ -20,6 +21,12 @@ const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) // TODO A lot of this can be optimized by using `npm outdated`. +function makeAPR (branchName) { + const title = 'Fix: Update Outdated Versions' + const body = 'Checking for and updating outdated integration versions' + execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) +} + async function fix () { const latests = {} for (const name of internalsNames) { @@ -29,6 +36,23 @@ async function fix () { } latestsJson.latests = latests fs.writeFileSync(latestsPath, JSON.stringify(latestsJson, null, 2)) + + const result = execSync('git status').toString() + + if (result.includes(latestsPath)) { + const branchName = 'fix_outdated_integrations' + try { + execSync(`git checkout -b ${branchName}`) + execSync(`git add ${latestsPath}`) + execSync('git commit -m "fix: update integr latests.json"') + execSync(`git push origin ${branchName}`) + + makeAPR(branchName) + } catch (e) { + console.log('ERROR', e) + process.exitCode = 1 + } + } } async function check () { From 673cdcfc8eaa9160878211832b6ad60997bc4528 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 17 Sep 2024 12:52:06 -0400 Subject: [PATCH 08/58] removing work to update modules --- scripts/install_plugin_modules.js | 73 +++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index 4ddbf813bab..682e2d3c5ad 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -5,14 +5,10 @@ const os = require('os') const path = require('path') const crypto = require('crypto') const semver = require('semver') +const proxyquire = require('proxyquire') const exec = require('./helpers/exec') +const childProcess = require('child_process') const externals = require('../packages/dd-trace/test/plugins/externals') -const { - getVersionList, - getInternals, - npmView -} = require('./helpers/versioning') -const latests = require('../packages/datadog-instrumentations/src/helpers/latests.json') const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json') @@ -20,6 +16,7 @@ const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require // Can remove couchbase after removing support for couchbase <= 3.2.0 const excludeList = os.arch() === 'arm64' ? ['aerospike', 'couchbase', 'grpc', 'oracledb'] : [] const workspaces = new Set() +const versionLists = {} const deps = {} const filter = process.env.hasOwnProperty('PLUGINS') && process.env.PLUGINS.split('|') @@ -49,7 +46,21 @@ async function run () { } async function assertVersions () { - const internals = getInternals() + const internals = names + .map(key => { + const instrumentations = [] + const name = key + + try { + loadInstFile(`${name}/server.js`, instrumentations) + loadInstFile(`${name}/client.js`, instrumentations) + } catch (e) { + loadInstFile(`${name}.js`, instrumentations) + } + + return instrumentations + }) + .reduce((prev, next) => prev.concat(next), []) for (const inst of internals) { await assertInstrumentation(inst, false) @@ -134,17 +145,7 @@ async function assertPackage (name, version, dependency, external) { } async function addDependencies (dependencies, name, versionRange) { - let versionList = await getVersionList(name) - if (!latests.pinned.includes(name)) { - const maxVersion = latests.latests[name] - versionList = versionList.map(version => { - if (version.startsWith('>=') && !version.includes('<')) { - return version + ' <=' + maxVersion - } else { - return version - } - }) - } + const versionList = await getVersionList(name) const version = semver.maxSatisfying(versionList, versionRange) const pkgJson = await npmView(`${name}@${version}`) for (const dep of deps[name]) { @@ -157,6 +158,27 @@ async function addDependencies (dependencies, name, versionRange) { } } +async function getVersionList (name) { + if (versionLists[name]) { + return versionLists[name] + } + const list = await npmView(`${name} versions`) + versionLists[name] = list + return list +} + +function npmView (input) { + return new Promise((resolve, reject) => { + childProcess.exec(`npm view ${input} --json`, (err, stdout) => { + if (err) { + reject(err) + return + } + resolve(JSON.parse(stdout.toString('utf8'))) + }) + }) +} + function assertIndex (name, version) { const index = `'use strict' @@ -212,3 +234,18 @@ function sha1 (str) { shasum.update(str) return shasum.digest('hex') } + +function loadInstFile (file, instrumentations) { + const instrument = { + addHook (instrumentation) { + instrumentations.push(instrumentation) + } + } + + const instPath = path.join(__dirname, `../packages/datadog-instrumentations/src/${file}`) + + proxyquire.noPreserveCache()(instPath, { + './helpers/instrument': instrument, + '../helpers/instrument': instrument + }) +} From 9d604805fed9104e0e966254e18173df87ae4ca6 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 09:55:32 -0400 Subject: [PATCH 09/58] adding ability to modify plugin yaml --- .github/workflows/plugins.yml | 152 +++++++++++++++++- .../src/helpers/latests.json | 21 +-- scripts/outdated.js | 19 +++ 3 files changed, 178 insertions(+), 14 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index c71ff2a2441..5cb74fdc782 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -58,7 +58,7 @@ jobs: range: ['5.2.0 - 5.7.0'] include: - node-version: 20 - range: '>=5.8.0' + range: ['5.12.1'] runs-on: ubuntu-latest services: aerospike: @@ -97,6 +97,9 @@ jobs: - uses: codecov/codecov-action@v3 amqp10: + strategy: + matrix: + range: ['3.6.0'] runs-on: ubuntu-latest services: qpid: @@ -115,6 +118,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream amqplib: + strategy: + matrix: + range: ['0.10.4' ] runs-on: ubuntu-latest services: rabbitmq: @@ -129,6 +135,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream apollo: + strategy: + matrix: + range: ['2.9.0'] runs-on: ubuntu-latest env: PLUGINS: apollo @@ -149,6 +158,7 @@ jobs: strategy: matrix: node-version: ['18', 'latest'] + range: ['2.1691.0'] runs-on: ubuntu-latest services: localstack: @@ -214,6 +224,9 @@ jobs: - uses: ./.github/actions/plugins/test bluebird: + strategy: + matrix: + range: ['3.7.2'] runs-on: ubuntu-latest env: PLUGINS: bluebird @@ -230,6 +243,9 @@ jobs: - uses: ./.github/actions/plugins/test bunyan: + strategy: + matrix: + range: ['1.8.15'] runs-on: ubuntu-latest env: PLUGINS: bunyan @@ -238,6 +254,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream cassandra: + strategy: + matrix: + range: ['>=3.0.0 <=4.7.2'] runs-on: ubuntu-latest services: cassandra: @@ -279,10 +298,10 @@ jobs: strategy: matrix: node-version: [16] - range: ['^2.6.12', '^3.0.7', '>=4.0.0 <4.2.0'] + range: ['^2.6.12', '^3.0.7', '4.4.1'] include: - node-version: 18 - range: '>=4.2.0' + range: '4.4.1' runs-on: ubuntu-latest services: couchbase: @@ -307,6 +326,9 @@ jobs: - uses: codecov/codecov-action@v3 connect: + strategy: + matrix: + range: ['3.7.0'] runs-on: ubuntu-latest env: PLUGINS: connect @@ -315,6 +337,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream cucumber: + strategy: + matrix: + range: ['11.0.1'] runs-on: ubuntu-latest env: PLUGINS: cucumber @@ -324,6 +349,9 @@ jobs: # TODO: fix performance issues and test more Node versions cypress: + strategy: + matrix: + range: ['13.14.2'] runs-on: ubuntu-latest env: PLUGINS: cypress @@ -357,6 +385,9 @@ jobs: - uses: codecov/codecov-action@v3 elasticsearch: + strategy: + matrix: + range: ['16.7.3'] runs-on: ubuntu-latest services: elasticsearch: @@ -380,6 +411,9 @@ jobs: - uses: codecov/codecov-action@v3 express: + strategy: + matrix: + range: ['4.21.0'] runs-on: ubuntu-latest env: PLUGINS: express @@ -403,6 +437,9 @@ jobs: - uses: ./.github/actions/plugins/test fastify: + strategy: + matrix: + range: ['4.28.1'] runs-on: ubuntu-latest env: PLUGINS: fastify @@ -419,6 +456,9 @@ jobs: - uses: ./.github/actions/plugins/test generic-pool: + strategy: + matrix: + range: ['3.9.0'] runs-on: ubuntu-latest env: PLUGINS: generic-pool @@ -427,6 +467,9 @@ jobs: - uses: ./.github/actions/plugins/test google-cloud-pubsub: + strategy: + matrix: + range: ['4.7.2'] runs-on: ubuntu-latest services: pubsub: @@ -441,6 +484,9 @@ jobs: - uses: ./.github/actions/plugins/test graphql: + strategy: + matrix: + range: ['16.9.0'] runs-on: ubuntu-latest env: PLUGINS: graphql @@ -449,6 +495,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream grpc: + strategy: + matrix: + range: ['1.11.2'] runs-on: ubuntu-latest env: PLUGINS: grpc @@ -457,6 +506,9 @@ jobs: - uses: ./.github/actions/plugins/test hapi: + strategy: + matrix: + range: ['18.1.0'] runs-on: ubuntu-latest env: PLUGINS: hapi @@ -505,6 +557,9 @@ jobs: # TODO: fix performance issues and test more Node versions jest: + strategy: + matrix: + range: ['29.7.0'] runs-on: ubuntu-latest env: PLUGINS: jest @@ -519,6 +574,9 @@ jobs: - uses: codecov/codecov-action@v3 kafkajs: + strategy: + matrix: + range: ['2.2.4'] runs-on: ubuntu-latest services: kafka: @@ -546,6 +604,9 @@ jobs: - uses: ./.github/actions/plugins/test knex: + strategy: + matrix: + range: ['3.1.0'] runs-on: ubuntu-latest env: PLUGINS: knex @@ -554,6 +615,9 @@ jobs: - uses: ./.github/actions/plugins/test koa: + strategy: + matrix: + range: ['2.15.3'] runs-on: ubuntu-latest env: PLUGINS: koa @@ -562,6 +626,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream limitd-client: + strategy: + matrix: + range: ['2.14.1'] runs-on: ubuntu-latest services: limitd: @@ -597,6 +664,9 @@ jobs: - uses: ./.github/actions/plugins/test memcached: + strategy: + matrix: + range: ['2.2.2'] runs-on: ubuntu-latest services: memcached: @@ -611,6 +681,9 @@ jobs: - uses: ./.github/actions/plugins/test microgateway-core: + strategy: + matrix: + range: ['3.3.4'] runs-on: ubuntu-latest env: PLUGINS: microgateway-core @@ -619,6 +692,9 @@ jobs: - uses: ./.github/actions/plugins/test mocha: + strategy: + matrix: + range: ['10.7.3'] runs-on: ubuntu-latest env: PLUGINS: mocha @@ -627,6 +703,9 @@ jobs: - uses: ./.github/actions/plugins/test moleculer: + strategy: + matrix: + range: ['0.14.34'] runs-on: ubuntu-latest env: PLUGINS: moleculer @@ -635,6 +714,9 @@ jobs: - uses: ./.github/actions/plugins/test mongodb: + strategy: + matrix: + range: ['6.9.0'] runs-on: ubuntu-latest services: mongodb: @@ -650,6 +732,9 @@ jobs: - uses: ./.github/actions/plugins/test mongodb-core: + strategy: + matrix: + range: ['3.2.7'] runs-on: ubuntu-latest services: mongodb: @@ -665,6 +750,9 @@ jobs: - uses: ./.github/actions/plugins/test mongoose: + strategy: + matrix: + range: ['8.6.2'] runs-on: ubuntu-latest services: mongodb: @@ -679,6 +767,9 @@ jobs: - uses: ./.github/actions/plugins/test mysql: + strategy: + matrix: + range: ['2.18.1'] runs-on: ubuntu-latest services: mysql: @@ -738,7 +829,7 @@ jobs: version: - 18 - latest - range: ['9.5.0', '11.1.4', '13.2.0', '14.2.6'] + range: ['14.2.6'] runs-on: ubuntu-latest env: PLUGINS: next @@ -754,6 +845,9 @@ jobs: - uses: codecov/codecov-action@v3 openai: + strategy: + matrix: + range: ['4.61.1'] runs-on: ubuntu-latest env: PLUGINS: openai @@ -762,6 +856,9 @@ jobs: - uses: ./.github/actions/plugins/test opensearch: + strategy: + matrix: + range: ['2.12.0'] runs-on: ubuntu-latest services: opensearch: @@ -781,6 +878,9 @@ jobs: # TODO: Install the Oracle client on the host and test Node >=16. # TODO: Figure out why nyc stopped working with EACCESS errors. oracledb: + strategy: + matrix: + range: ['6.6.0'] runs-on: ubuntu-latest container: bengl/node-12-with-oracle-client services: @@ -819,6 +919,9 @@ jobs: - uses: codecov/codecov-action@v2 paperplane: + strategy: + matrix: + range: ['3.1.2'] runs-on: ubuntu-latest env: PLUGINS: paperplane @@ -835,6 +938,9 @@ jobs: # TODO: re-enable upstream tests if it ever stops being flaky pino: + strategy: + matrix: + range: ['9.4.0'] runs-on: ubuntu-latest env: PLUGINS: pino @@ -853,6 +959,9 @@ jobs: - uses: codecov/codecov-action@v3 postgres: + strategy: + matrix: + range: ['8.13.0'] runs-on: ubuntu-latest services: postgres: @@ -870,6 +979,9 @@ jobs: - uses: ./.github/actions/plugins/test promise: + strategy: + matrix: + range: ['8.3.0'] runs-on: ubuntu-latest env: PLUGINS: promise @@ -878,6 +990,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream promise-js: + strategy: + matrix: + range: ['0.0.7'] runs-on: ubuntu-latest env: PLUGINS: promise-js @@ -895,6 +1010,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream q: + strategy: + matrix: + range: ['1.5.1'] runs-on: ubuntu-latest env: PLUGINS: q @@ -903,6 +1021,9 @@ jobs: - uses: ./.github/actions/plugins/test redis: + strategy: + matrix: + range: ['4.7.0'] runs-on: ubuntu-latest services: redis: @@ -917,6 +1038,9 @@ jobs: - uses: ./.github/actions/plugins/test restify: + strategy: + matrix: + range: ['11.1.0'] runs-on: ubuntu-latest env: PLUGINS: restify @@ -943,6 +1067,9 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream router: + strategy: + matrix: + range: ['1.3.8'] runs-on: ubuntu-latest env: PLUGINS: router @@ -951,6 +1078,9 @@ jobs: - uses: ./.github/actions/plugins/test sharedb: + strategy: + matrix: + range: ['5.0.4'] runs-on: ubuntu-latest env: PLUGINS: sharedb @@ -966,6 +1096,9 @@ jobs: - uses: codecov/codecov-action@v3 tedious: + strategy: + matrix: + range: ['18.6.1'] runs-on: ubuntu-latest services: mssql: @@ -992,6 +1125,9 @@ jobs: - uses: codecov/codecov-action@v3 undici: + strategy: + matrix: + range: ['4.16.0', '5.28.4', '6.19.8'] runs-on: ubuntu-latest env: PLUGINS: undici @@ -1000,6 +1136,9 @@ jobs: - uses: ./.github/actions/plugins/test when: + strategy: + matrix: + range: ['3.7.8'] runs-on: ubuntu-latest env: PLUGINS: when @@ -1008,9 +1147,12 @@ jobs: - uses: ./.github/actions/plugins/test winston: + strategy: + matrix: + range: ['3.14.2'] runs-on: ubuntu-latest env: PLUGINS: winston steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/plugins/test + - uses: ./.github/actions/plugins/test \ No newline at end of file diff --git a/packages/datadog-instrumentations/src/helpers/latests.json b/packages/datadog-instrumentations/src/helpers/latests.json index 2598fb52d12..72a7975014e 100644 --- a/packages/datadog-instrumentations/src/helpers/latests.json +++ b/packages/datadog-instrumentations/src/helpers/latests.json @@ -10,7 +10,7 @@ "amqplib": "0.10.4", "apollo-server-core": "3.13.0", "@apollo/server": "4.11.0", - "@apollo/gateway": "2.9.0", + "@apollo/gateway": "2.9.1", "@smithy/smithy-client": "3.3.2", "@aws-sdk/smithy-client": "3.374.0", "aws-sdk": "2.1691.0", @@ -36,7 +36,7 @@ "@google-cloud/pubsub": "4.7.2", "@graphql-tools/executor": "1.3.1", "graphql": "16.9.0", - "@grpc/grpc-js": "1.11.2", + "@grpc/grpc-js": "1.11.3", "@hapi/hapi": "21.3.10", "hapi": "18.1.0", "ioredis": "5.4.1", @@ -53,24 +53,24 @@ "kafkajs": "2.2.4", "knex": "3.1.0", "koa": "2.15.3", - "@koa/router": "13.0.1", + "@koa/router": "13.1.0", "koa-router": "13.0.1", "ldapjs": "3.0.7", "limitd-client": "2.14.1", - "mariadb": "3.3.1", + "lodash": "4.17.21", + "mariadb": "3.3.2", "memcached": "2.2.2", "microgateway-core": "3.3.4", - "mocha": "10.7.3", - "mocha-each": "2.0.1", "moleculer": "0.14.34", "mongodb-core": "3.2.7", "mongodb": "6.9.0", - "mongoose": "8.6.2", + "mongoose": "8.6.3", "mquery": "5.0.0", "mysql": "2.18.1", "mysql2": "3.11.3", - "next": "14.2.11", - "openai": "4.61.1", + "next": "14.2.12", + "nyc": "17.0.0", + "openai": "4.62.1", "@opensearch-project/opensearch": "2.12.0", "oracledb": "6.6.0", "paperplane": "3.1.2", @@ -95,6 +95,9 @@ "sequelize": "6.37.3", "sharedb": "5.0.4", "tedious": "18.6.1", + "undici": "6.19.8", + "vitest": "2.1.1", + "@vitest/runner": "2.1.1", "when": "3.7.8", "winston": "3.14.2" } diff --git a/scripts/outdated.js b/scripts/outdated.js index 0ea82a4ab3e..007223c9e32 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -5,6 +5,7 @@ const { const path = require('path') const fs = require('fs') const { execSync } = require('child_process') +const yaml = require('js-yaml') const latestsPath = path.join( __dirname, @@ -15,6 +16,14 @@ const latestsPath = path.join( 'helpers', 'latests.json' ) + +const yamlPath = path.join( + __dirname, + '..', + '.github', + 'workflows', + 'plugins.yml' +) const latestsJson = require(latestsPath) const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) .filter(x => typeof x === 'string' && x !== 'child_process' && !x.startsWith('node:')) @@ -27,7 +36,17 @@ function makeAPR (branchName) { execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) } +function updatePluginsYaml () { + const plugins = yaml.load(fs.readFileSync(yamlPath, 'utf-8')) + const jobs = plugins.jobs + + for (const job in jobs) { + if (jobs[job]?.strategy?.matrix?.range) { console.log('found range', job, jobs[job]?.strategy?.matrix?.range) } + } +} + async function fix () { + updatePluginsYaml() const latests = {} for (const name of internalsNames) { const distTags = await npmView(name + ' dist-tags') From 5a72dba5120a2ec21550f23d1e1b33035ac93242 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:32:30 -0400 Subject: [PATCH 10/58] reworking ci --- .github/workflows/plugins.yml | 27 +++++++++++++------ .../src/helpers/latests.json | 7 +++++ .../src/helpers/matrices.json | 9 +++++++ packages/dd-trace/test/setup/mocha.js | 3 +++ scripts/install_plugin_modules.js | 3 +++ 5 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 packages/datadog-instrumentations/src/helpers/matrices.json diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 5cb74fdc782..4d105ce6af4 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -15,6 +15,14 @@ concurrency: jobs: + versions: + runs-on: ubuntu-latest + outputs: + matrices: ${{steps.plugins.outputs.matrices}} + steps: + - name: plugins + run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json)" >> $GITHUB_OUTPUT + aerospike-node-16: runs-on: ubuntu-latest services: @@ -296,12 +304,7 @@ jobs: couchbase: strategy: - matrix: - node-version: [16] - range: ['^2.6.12', '^3.0.7', '4.4.1'] - include: - - node-version: 18 - range: '4.4.1' + matrix: ${{fromJson(needs.versions.outputs.matrices.couchbase)}} runs-on: ubuntu-latest services: couchbase: @@ -829,11 +832,11 @@ jobs: version: - 18 - latest - range: ['14.2.6'] + range: ['14.2.5'] runs-on: ubuntu-latest env: PLUGINS: next - PACKAGE_VERSION_RANGE: ${{ matrix.range }} + PACKAGE_VERSION_RANGE: ['14.2.5'] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start @@ -843,6 +846,7 @@ jobs: - if: always() uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 + // reads latest json and openai: strategy: @@ -938,12 +942,19 @@ jobs: # TODO: re-enable upstream tests if it ever stops being flaky pino: +<<<<<<< Updated upstream strategy: matrix: range: ['9.4.0'] +======= + # strategy: + # matrix: + # range: ['9.3.2'] +>>>>>>> Stashed changes runs-on: ubuntu-latest env: PLUGINS: pino + PACKAGE_VERSION_RANGE: ['2.0.0 <9.3.2'] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start diff --git a/packages/datadog-instrumentations/src/helpers/latests.json b/packages/datadog-instrumentations/src/helpers/latests.json index 72a7975014e..31f6595bb36 100644 --- a/packages/datadog-instrumentations/src/helpers/latests.json +++ b/packages/datadog-instrumentations/src/helpers/latests.json @@ -100,5 +100,12 @@ "@vitest/runner": "2.1.1", "when": "3.7.8", "winston": "3.14.2" + }, + "matrices": { + "couchbase": { + "node-version": [16], + "range": [["2.6.12 ", "2.6.12"], ["3.0.7", "3.2.7"], ["4.0.0", "4.4.1"] ], + "include": [{"node-version" : 18}, ["4.4.1", "4.4.1"]] + } } } \ No newline at end of file diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json new file mode 100644 index 00000000000..e199b508c00 --- /dev/null +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -0,0 +1,9 @@ +{ + "matrices": { + "couchbase": { + "node-version": [16], + "range": [["2.6.12 ", "2.6.12"], ["3.0.7", "3.2.7"], ["4.0.0", "4.4.1"] ], + "include": [{"node-version" : 18}, ["4.4.1", "4.4.1"]] + } + } +} \ No newline at end of file diff --git a/packages/dd-trace/test/setup/mocha.js b/packages/dd-trace/test/setup/mocha.js index d3520c3fe1c..db5544e1d41 100644 --- a/packages/dd-trace/test/setup/mocha.js +++ b/packages/dd-trace/test/setup/mocha.js @@ -204,6 +204,8 @@ function withVersions (plugin, modules, range, cb) { instrumentations .filter(instrumentation => instrumentation.name === moduleName) .forEach(instrumentation => { + console.log('rabe', process.env.PACKAGE_VERSION_RANGE) + console.log('rabe', process.env.PLUGINS) const versions = process.env.PACKAGE_VERSION_RANGE ? [process.env.PACKAGE_VERSION_RANGE] : instrumentation.versions @@ -221,6 +223,7 @@ function withVersions (plugin, modules, range, cb) { testVersions.set(max, { range: version, test: version }) }) }) + console.log('TEST VERSIONS', testVersions) Array.from(testVersions) .filter(v => !range || semver.satisfies(v[0], range)) diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index 682e2d3c5ad..1b72ceb00a8 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -145,8 +145,10 @@ async function assertPackage (name, version, dependency, external) { } async function addDependencies (dependencies, name, versionRange) { + console.log('VERSION RANGE', versionRange) const versionList = await getVersionList(name) const version = semver.maxSatisfying(versionList, versionRange) + // console.log('VERSION', version) const pkgJson = await npmView(`${name}@${version}`) for (const dep of deps[name]) { for (const section of ['devDependencies', 'peerDependencies']) { @@ -164,6 +166,7 @@ async function getVersionList (name) { } const list = await npmView(`${name} versions`) versionLists[name] = list + console.log('LIST', list[309]) return list } From a2929231b27c674474b8f0edc6b917152c427a30 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:34:11 -0400 Subject: [PATCH 11/58] reworking ci --- .github/workflows/plugins.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 4d105ce6af4..1f328157a08 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -846,7 +846,6 @@ jobs: - if: always() uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 - // reads latest json and openai: strategy: From 6f4b13b0977f66f15e32872b4c8dea06323617cb Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:35:28 -0400 Subject: [PATCH 12/58] reworking ci --- .github/workflows/plugins.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 1f328157a08..4bfd64b8a54 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -941,15 +941,9 @@ jobs: # TODO: re-enable upstream tests if it ever stops being flaky pino: -<<<<<<< Updated upstream strategy: matrix: range: ['9.4.0'] -======= - # strategy: - # matrix: - # range: ['9.3.2'] ->>>>>>> Stashed changes runs-on: ubuntu-latest env: PLUGINS: pino From 559515b189f34e29311236e97c44e79b7330e685 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:37:42 -0400 Subject: [PATCH 13/58] reworking ci --- .github/workflows/plugins.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 4bfd64b8a54..add35560101 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -836,7 +836,7 @@ jobs: runs-on: ubuntu-latest env: PLUGINS: next - PACKAGE_VERSION_RANGE: ['14.2.5'] + PACKAGE_VERSION_RANGE: ${{matrix.range}} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start @@ -947,7 +947,6 @@ jobs: runs-on: ubuntu-latest env: PLUGINS: pino - PACKAGE_VERSION_RANGE: ['2.0.0 <9.3.2'] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start From d9e4580e2a4d3cd42fe41b1ee3d68d2f2d0a6977 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:41:04 -0400 Subject: [PATCH 14/58] reworking ci --- .github/workflows/plugins.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index add35560101..b01c9ef8403 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -303,6 +303,7 @@ jobs: - uses: ./.github/actions/plugins/test couchbase: + needs: versions strategy: matrix: ${{fromJson(needs.versions.outputs.matrices.couchbase)}} runs-on: ubuntu-latest From aab81c80b844ae72043a478a64da42ccd58365fd Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:48:27 -0400 Subject: [PATCH 15/58] reworking ci --- .github/workflows/plugins.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b01c9ef8403..2ade97bf357 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -20,6 +20,7 @@ jobs: outputs: matrices: ${{steps.plugins.outputs.matrices}} steps: + - uses: actions/checkout@v4 - name: plugins run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json)" >> $GITHUB_OUTPUT @@ -303,7 +304,8 @@ jobs: - uses: ./.github/actions/plugins/test couchbase: - needs: versions + needs: + - versions strategy: matrix: ${{fromJson(needs.versions.outputs.matrices.couchbase)}} runs-on: ubuntu-latest From 80155424f1f2e3a6fe57403e65ec5fe26b59d8b1 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:52:02 -0400 Subject: [PATCH 16/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 2ade97bf357..b0edad1b08e 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: plugins - run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json)" >> $GITHUB_OUTPUT + run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT aerospike-node-16: runs-on: ubuntu-latest From d55b7ffb35b6ac83fdac830151ba24f9d43848dc Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 13:56:22 -0400 Subject: [PATCH 17/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b0edad1b08e..f7cd0bacc0e 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -21,7 +21,7 @@ jobs: matrices: ${{steps.plugins.outputs.matrices}} steps: - uses: actions/checkout@v4 - - name: plugins + - id: plugins run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT aerospike-node-16: From 39363cea9c820650bb9027b9702057f6aaa343d1 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:00:41 -0400 Subject: [PATCH 18/58] reworking ci --- packages/datadog-instrumentations/src/helpers/matrices.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index e199b508c00..263f595ee40 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,9 +1,7 @@ { - "matrices": { "couchbase": { "node-version": [16], "range": [["2.6.12 ", "2.6.12"], ["3.0.7", "3.2.7"], ["4.0.0", "4.4.1"] ], "include": [{"node-version" : 18}, ["4.4.1", "4.4.1"]] } - } } \ No newline at end of file From cd6e9d568ba7295b4efd3e9abc5cbb1d918bd8ba Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:07:10 -0400 Subject: [PATCH 19/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index f7cd0bacc0e..1bfd445879b 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - id: plugins - run: echo "json=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: echo "matrices=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT aerospike-node-16: runs-on: ubuntu-latest From 5b9abbc8e5e8bceb089357973657d6be0d36b448 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:11:09 -0400 Subject: [PATCH 20/58] reworking ci --- .github/workflows/plugins.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 1bfd445879b..e7634761608 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -13,7 +13,6 @@ concurrency: # TODO: upstream jobs - jobs: versions: runs-on: ubuntu-latest From 9c38a473af9736b0a84512d51d392324432abc7c Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:14:57 -0400 Subject: [PATCH 21/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index e7634761608..fa97a33b094 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -306,7 +306,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices.couchbase)}} + matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} runs-on: ubuntu-latest services: couchbase: From 2a9e474fa6c8c0bbbe104670ee56729f1fa593c3 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:17:32 -0400 Subject: [PATCH 22/58] reworking ci --- .github/workflows/plugins.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index fa97a33b094..cb473d4b6bd 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -22,6 +22,7 @@ jobs: - uses: actions/checkout@v4 - id: plugins run: echo "matrices=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT + - run: echo $GITHUB_OUTPUT aerospike-node-16: runs-on: ubuntu-latest From 2d8b885b295569e3dd59d67eac29e32c6e57efb8 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:24:39 -0400 Subject: [PATCH 23/58] reworking ci --- .github/workflows/plugins.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index cb473d4b6bd..d8e4669c230 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -21,8 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - id: plugins - run: echo "matrices=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ')" >> $GITHUB_OUTPUT - - run: echo $GITHUB_OUTPUT + run: | + content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') + echo "matrices=$content" >> $GITHUB_OUTPUT + echo $content aerospike-node-16: runs-on: ubuntu-latest From 50237fafee998074f8332c1b5626eb046dfb6001 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:27:42 -0400 Subject: [PATCH 24/58] reworking ci --- packages/datadog-instrumentations/src/helpers/matrices.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 263f595ee40..c8431264b52 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -2,6 +2,6 @@ "couchbase": { "node-version": [16], "range": [["2.6.12 ", "2.6.12"], ["3.0.7", "3.2.7"], ["4.0.0", "4.4.1"] ], - "include": [{"node-version" : 18}, ["4.4.1", "4.4.1"]] + "include": [{"node-version" : 18, "range":["4.4.1", "4.4.1"]}] } } \ No newline at end of file From 5a354d25e508ab01f7c485f49de8b7c2b9812319 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 19 Sep 2024 14:34:48 -0400 Subject: [PATCH 25/58] reworking ci --- packages/datadog-instrumentations/src/helpers/matrices.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index c8431264b52..feb574fbd27 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,7 +1,7 @@ { "couchbase": { "node-version": [16], - "range": [["2.6.12 ", "2.6.12"], ["3.0.7", "3.2.7"], ["4.0.0", "4.4.1"] ], - "include": [{"node-version" : 18, "range":["4.4.1", "4.4.1"]}] + "range": ["2.6.12 - 2.6.12", "3.0.7 - 3.2.7", "4.0.0 - 4.4.1" ], + "include": [{"node-version": 18, "range": "4.4.1 - 4.4.1"}] } } \ No newline at end of file From 61ffa4496fa20e84562cbe0a469832d21b9b8226 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 17:44:00 -0400 Subject: [PATCH 26/58] reworking updating script to create matrices for plugins --- .github/workflows/plugins.yml | 3 +- .../src/helpers/matrices.json | 712 +++++++++++++++++- packages/dd-trace/test/setup/mocha.js | 3 - scripts/install_plugin_modules.js | 3 - scripts/outdated.js | 85 ++- 5 files changed, 775 insertions(+), 31 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index d8e4669c230..d764f4442aa 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -109,8 +109,7 @@ jobs: amqp10: strategy: - matrix: - range: ['3.6.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10}} runs-on: ubuntu-latest services: qpid: diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index feb574fbd27..5f8d2d28e0d 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,7 +1,713 @@ { + "pinned": [ + "generic-pool", + "@playwright/test", + "redis" + ], + "matrices": { "couchbase": { - "node-version": [16], - "range": ["2.6.12 - 2.6.12", "3.0.7 - 3.2.7", "4.0.0 - 4.4.1" ], - "include": [{"node-version": 18, "range": "4.4.1 - 4.4.1"}] + "min-version": "2.4.2", + "node-version": [ + 16 + ], + "range": [ + "2.4.2 - 2.6.12", + "3.0.0 - 3.2.7", + "4.0.0 - 4.4.1" + ], + "include": [ + { + "node-version": 18 + }, + [ + "4.4.1", + "4.4.1" + ] + ] + }, + "aerospike": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.0.5", + "5.0.0 - 5.12.1" + ] + }, + "amqp10": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.6.0" + ] + }, + "amqplib": { + "min-version": "0.5.0", + "range": [ + "0.5.0 - 0.10.4" + ] + }, + "@apollo/gateway": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.54.1", + "2.0.0 - 2.9.1" + ] + }, + "@aws-sdk/smithy-client": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.374.0" + ] + }, + "aws-sdk": { + "min-version": "2.1.35", + "range": [ + "2.1.35 - 2.1691.0" + ] + }, + "bluebird": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.11.0", + "3.0.0 - 3.7.2" + ] + }, + "body-parser": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.20.3" + ] + }, + "bunyan": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.8.15" + ] + }, + "cassandra-driver": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.6.0", + "4.0.0 - 4.7.2" + ] + }, + "connect": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.30.2", + "3.0.0 - 3.7.0" + ] + }, + "cookie-parser": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.4.6" + ] + }, + "cookie": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.6.0" + ] + }, + "@cucumber/cucumber": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.3.2", + "8.0.0 - 8.11.1", + "9.0.0 - 9.6.0", + "10.0.0 - 10.9.0", + "11.0.0 - 11.0.1" + ] + }, + "cypress": { + "min-version": "0.0.1", + "range": [ + "0.0.1 - 0.20.3", + "1.0.0 - 1.4.2", + "2.0.0 - 2.1.0", + "3.0.0 - 3.8.3", + "4.0.0 - 4.12.1", + "5.0.0 - 5.6.0", + "6.0.0 - 6.9.1", + "7.0.0 - 7.7.0", + "8.0.0 - 8.7.0", + "9.0.0 - 9.7.0", + "10.0.0 - 10.11.0", + "11.0.0 - 11.2.0", + "12.0.0 - 12.17.4", + "13.0.0 - 13.14.2" + ] + }, + "@elastic/elasticsearch": { + "min-version": "5.6.16", + "range": [ + "5.6.16 - 5.6.22", + "6.7.0 - 6.8.8", + "7.0.0 - 7.17.14", + "8.0.0 - 8.14.1" + ] + }, + "elasticsearch": { + "min-version": "0.2.0", + "range": [ + "0.2.0 - 0.3.9", + "1.0.0 - 1.5.14", + "2.0.0 - 2.4.3", + "3.0.0 - 3.1.4", + "4.0.0 - 4.1.0", + "5.0.0 - 5.0.0", + "6.0.0 - 6.1.0", + "8.0.1 - 8.2.0", + "9.0.0 - 9.0.2", + "10.0.0 - 10.1.3", + "11.0.0 - 11.0.1", + "12.0.0 - 12.1.3", + "13.0.0 - 13.3.1", + "14.0.0 - 14.2.2", + "15.0.0 - 15.5.0", + "16.0.0 - 16.7.3" + ] + }, + "express-mongo-sanitize": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.3.2", + "2.0.0 - 2.2.0" + ] + }, + "express": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.21.0" + ] + }, + "fastify": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.14.6", + "2.0.0 - 2.15.3", + "3.0.0 - 3.29.5", + "4.0.0 - 4.28.1", + "5.0.0 - 5.0.0" + ] + }, + "find-my-way": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.18.1", + "2.0.0 - 2.2.5", + "3.0.0 - 3.0.5", + "4.0.0 - 4.5.1", + "5.0.0 - 5.6.0", + "6.0.0 - 6.4.0", + "7.0.0 - 7.7.0", + "8.0.0 - 8.2.2", + "9.0.0 - 9.0.1" + ] + }, + "generic-pool": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.5.4", + "3.0.0 - 3.9.0" + ] + }, + "@google-cloud/pubsub": { + "min-version": "1.2.0", + "range": [ + "1.2.0 - 1.7.3", + "2.0.0 - 2.19.4", + "3.0.0 - 3.7.5", + "4.0.0 - 4.7.2" + ] + }, + "@graphql-tools/executor": { + "min-version": "0.0.14", + "range": [ + "0.0.14 - 0.0.20", + "1.0.0 - 1.3.1" + ] + }, + "graphql": { + "min-version": "0.10.0", + "range": [ + "0.10.0 - 0.13.2", + "14.0.0 - 14.7.0", + "15.0.0 - 15.9.0", + "16.0.0 - 16.9.0" + ] + }, + "@grpc/grpc-js": { + "min-version": "1.0.3", + "range": [ + "1.0.3 - 1.11.3" + ] + }, + "@hapi/hapi": { + "min-version": "17.9.0", + "range": [ + "17.9.0 - 17.9.0", + "18.2.0 - 18.4.1", + "19.0.0 - 19.2.0", + "20.0.0 - 20.3.0", + "21.0.0 - 21.3.10" + ] + }, + "hapi": { + "min-version": "16.0.0", + "range": [ + "16.0.0 - 16.8.4", + "17.0.0 - 17.8.5", + "18.0.0 - 18.1.0" + ] + }, + "ioredis": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.5.0", + "3.0.0 - 3.2.2", + "4.0.0 - 4.28.5", + "5.0.0 - 5.4.1" + ] + }, + "jest-environment-node": { + "min-version": "24.8.0", + "range": [ + "24.8.0 - 24.9.0", + "25.0.0 - 25.5.0", + "26.0.0 - 26.6.2", + "27.0.0 - 27.5.1", + "28.0.0 - 28.1.3", + "29.0.0 - 29.7.0" + ] + }, + "kafkajs": { + "min-version": "1.4.0", + "range": [ + "1.4.0 - 1.16.0", + "2.0.0 - 2.2.4" + ] + }, + "knex": { + "min-version": "0.8.0", + "range": [ + "0.8.0 - 0.95.15", + "1.0.0 - 1.0.7", + "2.0.0 - 2.5.1", + "3.0.0 - 3.1.0" + ] + }, + "koa": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.15.3" + ] + }, + "@koa/router": { + "min-version": "8.0.0", + "range": [ + "8.0.0 - 8.0.8", + "9.0.1 - 9.4.0", + "10.0.0 - 10.1.1", + "11.0.0 - 11.0.2", + "12.0.0 - 12.0.2", + "13.0.0 - 13.1.0" + ] + }, + "koa-router": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.4.0", + "8.0.6 - 8.0.8", + "9.0.1 - 9.4.0", + "10.0.0 - 10.1.1", + "11.0.0 - 11.0.2", + "12.0.0 - 12.0.1", + "13.0.1 - 13.0.1" + ] + }, + "ldapjs": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.8.0", + "1.0.0 - 1.0.2", + "2.0.0 - 2.3.3", + "3.0.0 - 3.0.7" + ] + }, + "limitd-client": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.13.1", + "2.0.0 - 2.14.1" + ] + }, + "lodash": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.10.0", + "1.0.0 - 1.0.2", + "2.0.0 - 2.4.2", + "3.0.0 - 3.10.1", + "4.0.0 - 4.17.21" + ] + }, + "mariadb": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.3.2" + ] + }, + "memcached": { + "min-version": "2.2.0", + "range": [ + "2.2.0 - 2.2.2" + ] + }, + "microgateway-core": { + "min-version": "2.1.0", + "range": [ + "2.1.0 - 2.5.17", + "3.0.0 - 3.3.4" + ] + }, + "moleculer": { + "min-version": "0.14.0", + "range": [ + "0.14.0 - 0.14.34" + ] + }, + "mongodb-core": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.1.20", + "3.0.0 - 3.2.7" + ] + }, + "mongodb": { + "min-version": "3.3.0", + "range": [ + "3.3.0 - 3.7.4", + "4.0.0 - 4.17.2", + "5.0.0 - 5.9.2", + "6.0.0 - 6.9.0" + ] + }, + "mongoose": { + "min-version": "4.6.4", + "range": [ + "4.6.4 - 4.13.21", + "5.0.0 - 5.13.22", + "6.0.0 - 6.13.2", + "7.0.0 - 7.8.1", + "8.0.0 - 8.6.3" + ] + }, + "mquery": { + "min-version": "0.0.1", + "range": [ + "0.0.1 - 0.9.0", + "1.0.0 - 1.11.0", + "2.0.0 - 2.3.3", + "3.0.0 - 3.2.5", + "4.0.0 - 4.0.3", + "5.0.0 - 5.0.0" + ] + }, + "mysql": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.18.1" + ] + }, + "mysql2": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.6.6", + "2.0.0 - 2.3.3", + "3.0.0 - 3.11.3" + ] + }, + "next": { + "min-version": "9.5.0", + "range": [ + "9.5.0 - 9.5.5", + "10.0.0 - 10.2.3", + "11.0.0 - 11.1.4", + "12.0.0 - 12.3.4", + "13.0.0 - 13.5.7", + "14.0.0 - 14.2.13" + ] + }, + "openai": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.3.0", + "4.0.0 - 4.63.0" + ] + }, + "@opensearch-project/opensearch": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.2.0", + "2.0.0 - 2.12.0" + ] + }, + "oracledb": { + "min-version": "5.0.0", + "range": [ + "5.0.0 - 5.5.0", + "6.0.0 - 6.6.0" + ] + }, + "paperplane": { + "min-version": "2.3.0", + "range": [ + "2.3.0 - 2.3.2", + "3.0.0 - 3.1.2" + ] + }, + "passport-http": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.3.0" + ] + }, + "passport-local": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.1.6", + "1.0.0 - 1.0.0" + ] + }, + "pg": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.5.7", + "5.0.0 - 5.2.1", + "6.0.0 - 6.4.2", + "7.0.0 - 7.18.2", + "8.0.0 - 8.13.0" + ] + }, + "pino": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.16.0", + "3.0.0 - 3.4.0", + "4.0.0 - 4.17.6", + "5.0.0 - 5.17.0", + "6.0.0 - 6.14.0", + "7.0.0 - 7.11.0", + "8.0.0 - 8.21.0", + "9.0.0 - 9.4.0" + ] + }, + "pino-pretty": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.1", + "2.0.0 - 2.6.1", + "3.0.0 - 3.6.1", + "4.0.0 - 4.8.0", + "5.0.0 - 5.1.3", + "6.0.0 - 6.0.0", + "7.0.0 - 7.6.1", + "8.0.0 - 8.1.0", + "9.0.0 - 9.4.1", + "10.0.0 - 10.3.1", + "11.0.0 - 11.2.2" + ] + }, + "@playwright/test": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.1111.0", + "1.12.0 - 1.47.2" + ] + }, + "playwright": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.18.0", + "1.0.0 - 1.47.2" + ] + }, + "promise-js": { + "min-version": "0.0.3", + "range": [ + "0.0.3 - 0.0.7" + ] + }, + "promise": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.3.1", + "8.0.0 - 8.3.0" + ] + }, + "q": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.5.1" + ] + }, + "qs": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.6.6", + "1.0.0 - 1.2.2", + "2.0.0 - 2.4.2", + "3.0.0 - 3.1.0", + "4.0.0 - 4.0.0", + "5.0.0 - 5.2.1", + "6.0.0 - 6.13.0" + ] + }, + "@node-redis/client": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.6" + ] + }, + "@redis/client": { + "min-version": "1.1.0", + "range": [ + "1.1.0 - 1.6.0" + ] + }, + "redis": { + "min-version": "0.12.0", + "range": [ + "0.12.0 - 0.12.1", + "1.0.0 - 1.0.0", + "2.0.0 - 2.8.0", + "3.0.0 - 3.1.2", + "4.0.0 - 4.7.0" + ] + }, + "restify": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.0.3", + "4.0.0 - 4.3.4", + "5.0.0 - 5.2.1", + "6.0.0 - 6.4.0", + "7.0.0 - 7.7.0", + "8.0.0 - 8.6.1", + "9.0.0 - 9.1.0", + "10.0.0 - 10.0.0", + "11.0.0 - 11.1.0" + ] + }, + "rhea": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.24", + "2.0.0 - 2.0.8", + "3.0.0 - 3.0.3" + ] + }, + "router": { + "min-version": "0.2.1", + "range": [ + "0.2.1 - 0.6.2", + "1.0.0 - 1.3.8" + ] + }, + "selenium-webdriver": { + "min-version": "2.29.0", + "range": [ + "2.29.0 - 2.53.3", + "3.0.0 - 3.6.0", + "4.0.0 - 4.25.0" + ] + }, + "sequelize": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.4.3", + "1.0.0 - 1.7.11", + "2.0.0 - 2.1.3", + "3.0.0 - 3.35.1", + "4.0.0 - 4.44.4", + "5.1.0 - 5.22.5", + "6.1.0 - 6.37.3" + ] + }, + "sharedb": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.9.2", + "2.0.0 - 2.2.6", + "3.0.0 - 3.3.2", + "4.0.0 - 4.1.5", + "5.0.0 - 5.0.4" + ] + }, + "tedious": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.15.0", + "2.0.0 - 2.7.1", + "3.0.0 - 3.0.1", + "4.0.0 - 4.2.0", + "5.0.0 - 5.0.3", + "6.0.0 - 6.7.1", + "7.0.0 - 7.0.0", + "8.0.0 - 8.3.1", + "9.0.0 - 9.2.3", + "10.0.0 - 10.0.0", + "11.0.0 - 11.8.0", + "12.0.0 - 12.3.0", + "13.0.0 - 13.2.0", + "14.0.0 - 14.7.0", + "15.0.0 - 15.1.3", + "16.0.0 - 16.7.1", + "17.0.0 - 17.0.0", + "18.0.0 - 18.6.2" + ] + }, + "undici": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.5.0", + "1.0.0 - 1.3.1", + "2.0.0 - 2.2.1", + "3.0.0 - 3.3.6", + "4.0.0 - 4.16.0", + "5.0.0 - 5.28.4", + "6.0.0 - 6.19.8" + ] + }, + "vitest": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.34.6", + "1.0.0 - 1.6.0", + "2.0.0 - 2.1.1" + ] + }, + "@vitest/runner": { + "min-version": "0.28.0", + "range": [ + "0.28.0 - 0.34.7", + "1.0.0 - 1.6.0", + "2.0.0 - 2.1.1" + ] + }, + "when": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.7.8" + ] + }, + "winston": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.1.2", + "2.0.0 - 2.4.7", + "3.0.0 - 3.14.2" + ] } + } } \ No newline at end of file diff --git a/packages/dd-trace/test/setup/mocha.js b/packages/dd-trace/test/setup/mocha.js index db5544e1d41..d3520c3fe1c 100644 --- a/packages/dd-trace/test/setup/mocha.js +++ b/packages/dd-trace/test/setup/mocha.js @@ -204,8 +204,6 @@ function withVersions (plugin, modules, range, cb) { instrumentations .filter(instrumentation => instrumentation.name === moduleName) .forEach(instrumentation => { - console.log('rabe', process.env.PACKAGE_VERSION_RANGE) - console.log('rabe', process.env.PLUGINS) const versions = process.env.PACKAGE_VERSION_RANGE ? [process.env.PACKAGE_VERSION_RANGE] : instrumentation.versions @@ -223,7 +221,6 @@ function withVersions (plugin, modules, range, cb) { testVersions.set(max, { range: version, test: version }) }) }) - console.log('TEST VERSIONS', testVersions) Array.from(testVersions) .filter(v => !range || semver.satisfies(v[0], range)) diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index 1b72ceb00a8..682e2d3c5ad 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -145,10 +145,8 @@ async function assertPackage (name, version, dependency, external) { } async function addDependencies (dependencies, name, versionRange) { - console.log('VERSION RANGE', versionRange) const versionList = await getVersionList(name) const version = semver.maxSatisfying(versionList, versionRange) - // console.log('VERSION', version) const pkgJson = await npmView(`${name}@${version}`) for (const dep of deps[name]) { for (const section of ['devDependencies', 'peerDependencies']) { @@ -166,7 +164,6 @@ async function getVersionList (name) { } const list = await npmView(`${name} versions`) versionLists[name] = list - console.log('LIST', list[309]) return list } diff --git a/scripts/outdated.js b/scripts/outdated.js index 007223c9e32..d4f5098512e 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -17,17 +17,23 @@ const latestsPath = path.join( 'latests.json' ) -const yamlPath = path.join( +const matricesPath = path.join( __dirname, '..', - '.github', - 'workflows', - 'plugins.yml' + 'packages', + 'datadog-instrumentations', + 'src', + 'helpers', + 'matrices.json' ) + const latestsJson = require(latestsPath) const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) .filter(x => typeof x === 'string' && x !== 'child_process' && !x.startsWith('node:')) +const matricesJson = require(matricesPath) +const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) + // TODO A lot of this can be optimized by using `npm outdated`. function makeAPR (branchName) { @@ -36,33 +42,72 @@ function makeAPR (branchName) { execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) } -function updatePluginsYaml () { - const plugins = yaml.load(fs.readFileSync(yamlPath, 'utf-8')) - const jobs = plugins.jobs +function maxVersion (range) { + if (typeof range === 'string') { + return range + } + return range.pop() +} + +function minVersion (range) { + if (typeof range === 'string') { + return range + } + return range.shift() +} + +function splitting (element) { + return +element.split('.')[0] +} + +async function ranges (name, minimum) { + const distTags = await npmView(`${name} dist-tags`) + const latestVersion = splitting(distTags?.latest) + + const splitMin = splitting(minimum) + + const ranges = [] + let versionRange + let maxRange + let minRange + + for (let major = splitMin; major <= latestVersion; major++) { + try { + versionRange = await npmView(`${name}@${major} version`) + maxRange = maxVersion(versionRange) + minRange = minVersion(versionRange) - for (const job in jobs) { - if (jobs[job]?.strategy?.matrix?.range) { console.log('found range', job, jobs[job]?.strategy?.matrix?.range) } + if (major === splitMin) { + ranges.push(`${minimum} - ${maxRange}`) + } else if (versionRange !== undefined) { + ranges.push(`${minRange} - ${maxRange}`) + } + } catch (e) { + console.log(`No version range found for "${name}" at version ${major}`) + } } + return ranges } async function fix () { - updatePluginsYaml() - const latests = {} - for (const name of internalsNames) { - const distTags = await npmView(name + ' dist-tags') - const latest = distTags.latest - latests[name] = latest + let latests + + for (const name of pluginsNames) { + latests = matricesJson.matrices[name] + const minVersion = latests['min-version'] + const versions = await ranges(name, minVersion) + + latests.range = versions } - latestsJson.latests = latests - fs.writeFileSync(latestsPath, JSON.stringify(latestsJson, null, 2)) + fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) const result = execSync('git status').toString() - if (result.includes(latestsPath)) { - const branchName = 'fix_outdated_integrations' + if (result.includes(matricesPath)) { + const branchName = 'update_outdated_integrations' try { execSync(`git checkout -b ${branchName}`) - execSync(`git add ${latestsPath}`) + execSync(`git add ${matricesPath}`) execSync('git commit -m "fix: update integr latests.json"') execSync(`git push origin ${branchName}`) From d55455dedd439bba2d90f6576bf63ecdbd64b9bb Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:15:45 -0400 Subject: [PATCH 27/58] reworking ci --- .github/workflows/plugins.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index d764f4442aa..baf3036461b 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -109,7 +109,7 @@ jobs: amqp10: strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10}} + matrix: ${{fromJson(needs.versions.outputs).amqp10}} runs-on: ubuntu-latest services: qpid: @@ -308,7 +308,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} + matrix: ${{fromJson(needs.versions.outputs).couchbase}} runs-on: ubuntu-latest services: couchbase: From 58218bd9e287a96f38ee0e37a1eebe2c2f33779b Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:20:16 -0400 Subject: [PATCH 28/58] reworking ci --- .github/workflows/plugins.yml | 2 +- packages/datadog-instrumentations/src/helpers/matrices.json | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index baf3036461b..994c1ea9295 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -109,7 +109,7 @@ jobs: amqp10: strategy: - matrix: ${{fromJson(needs.versions.outputs).amqp10}} + matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10}} runs-on: ubuntu-latest services: qpid: diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 5f8d2d28e0d..a084afae55f 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,9 +1,4 @@ { - "pinned": [ - "generic-pool", - "@playwright/test", - "redis" - ], "matrices": { "couchbase": { "min-version": "2.4.2", From 9a1cf96778c9a99197aea6aede3f169a1927b90f Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:28:30 -0400 Subject: [PATCH 29/58] reworking ci --- .github/workflows/plugins.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 994c1ea9295..80f2822d9c4 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,6 +25,7 @@ jobs: content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content + echo $matrices aerospike-node-16: runs-on: ubuntu-latest @@ -126,6 +127,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream + - run: | + echo $strategy.matrix amqplib: strategy: From d2b945924c9b48a947a4d6a1321670f5e3cf537b Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:31:29 -0400 Subject: [PATCH 30/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 80f2822d9c4..c07c59fb517 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,7 +25,7 @@ jobs: content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content - echo $matrices + echo $outputs.matrices aerospike-node-16: runs-on: ubuntu-latest From 4b6740abb0ab73b8197dacee0a631e8d999bcc4a Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:42:28 -0400 Subject: [PATCH 31/58] reworking ci --- .github/workflows/plugins.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index c07c59fb517..1c892daecc6 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,7 +25,7 @@ jobs: content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content - echo $outputs.matrices + echo $outputs aerospike-node-16: runs-on: ubuntu-latest @@ -311,7 +311,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs).couchbase}} + matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} runs-on: ubuntu-latest services: couchbase: From a937581045a5bba595fadb680f7b7b1c2308668c Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:47:42 -0400 Subject: [PATCH 32/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 1c892daecc6..095a4dd7914 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -311,7 +311,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} + matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase.range}} runs-on: ubuntu-latest services: couchbase: From 0f2bc4040823b82c8bb5eeddb9df0db3ce3d55ea Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:50:43 -0400 Subject: [PATCH 33/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 095a4dd7914..0cb4189effc 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -110,7 +110,7 @@ jobs: amqp10: strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10}} + matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10.range}} runs-on: ubuntu-latest services: qpid: From ef00386029070d0fca5b797852dc79f535a49f78 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:57:40 -0400 Subject: [PATCH 34/58] reworking ci --- .../src/helpers/matrices.json | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index a084afae55f..b940e44b9d4 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,24 +1,9 @@ { "matrices": { "couchbase": { - "min-version": "2.4.2", - "node-version": [ - 16 - ], - "range": [ - "2.4.2 - 2.6.12", - "3.0.0 - 3.2.7", - "4.0.0 - 4.4.1" - ], - "include": [ - { - "node-version": 18 - }, - [ - "4.4.1", - "4.4.1" - ] - ] + "node-version": [16], + "range": ["2.4.2 - 2.6.12", "3.0.0 - 3.2.7", "4.0.0 - 4.4.1"], + "include": [{"node-version": 18}, ["4.4.1 - 4.4.1"]] }, "aerospike": { "min-version": "4.0.0", From 6aa685321af0207191c7e849724c919611fce776 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Mon, 23 Sep 2024 18:59:46 -0400 Subject: [PATCH 35/58] reworking ci --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 0cb4189effc..b16920f7cf3 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -311,7 +311,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase.range}} + matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} runs-on: ubuntu-latest services: couchbase: From 315238ffb5af6dd60fc75f33d87d0fcd47e22d39 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 24 Sep 2024 10:08:21 -0400 Subject: [PATCH 36/58] reworking ci --- .github/workflows/plugins.yml | 2 +- packages/datadog-instrumentations/src/helpers/matrices.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b16920f7cf3..a4d2eaca6c7 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,7 +25,7 @@ jobs: content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content - echo $outputs + echo $matrices aerospike-node-16: runs-on: ubuntu-latest diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index b940e44b9d4..cac200a0208 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -13,10 +13,7 @@ ] }, "amqp10": { - "min-version": "3.0.0", - "range": [ - "3.0.0 - 3.6.0" - ] + "range": [ "3.0.0 - 3.6.0" ] }, "amqplib": { "min-version": "0.5.0", From fce4e51968150fe84648af74ff1e5370d5465b3b Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 24 Sep 2024 10:18:46 -0400 Subject: [PATCH 37/58] reworking ci --- .github/workflows/plugins.yml | 1 + packages/datadog-instrumentations/src/helpers/matrices.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index a4d2eaca6c7..55345145397 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -124,6 +124,7 @@ jobs: PLUGINS: amqp10 SERVICES: qpid DD_DATA_STREAMS_ENABLED: true + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index cac200a0208..5c1082a247e 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -3,7 +3,7 @@ "couchbase": { "node-version": [16], "range": ["2.4.2 - 2.6.12", "3.0.0 - 3.2.7", "4.0.0 - 4.4.1"], - "include": [{"node-version": 18}, ["4.4.1 - 4.4.1"]] + "include": [{"node-version": 18, "range":"4.4.1 - 4.4.1"}] }, "aerospike": { "min-version": "4.0.0", From 12c51985b9a7a9ee73c2c35b13b19cbb2f5d2aa9 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 24 Sep 2024 10:27:52 -0400 Subject: [PATCH 38/58] reworking ci --- .github/workflows/plugins.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 55345145397..a4d2eaca6c7 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -124,7 +124,6 @@ jobs: PLUGINS: amqp10 SERVICES: qpid DD_DATA_STREAMS_ENABLED: true - PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream From a8b72349a9155ca8d5763d495cbff6ad20d90035 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 24 Sep 2024 10:35:45 -0400 Subject: [PATCH 39/58] reworking ci --- .github/workflows/plugins.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index a4d2eaca6c7..311f96e15db 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,7 +25,6 @@ jobs: content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content - echo $matrices aerospike-node-16: runs-on: ubuntu-latest @@ -311,7 +310,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).couchbase}} + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.couchbase}} runs-on: ubuntu-latest services: couchbase: From f6039d85f52cdb931336755dbe0abca86c109134 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 24 Sep 2024 18:01:23 -0400 Subject: [PATCH 40/58] adding script to create matrix --- .github/workflows/plugins.yml | 19 +- .../src/helpers/matrices.json | 105 +-- .../src/helpers/versions.json | 701 ++++++++++++++++++ scripts/create_matrix.js | 83 +++ scripts/outdated.js | 118 ++- 5 files changed, 897 insertions(+), 129 deletions(-) create mode 100644 packages/datadog-instrumentations/src/helpers/versions.json create mode 100644 scripts/create_matrix.js diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 311f96e15db..80cc7391aa7 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -107,9 +107,11 @@ jobs: uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 - amqp10: + amqp10: # TODO: move rhea to its own job + needs: + - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).amqp10.range}} + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.amqp10}} runs-on: ubuntu-latest services: qpid: @@ -123,6 +125,7 @@ jobs: PLUGINS: amqp10 SERVICES: qpid DD_DATA_STREAMS_ENABLED: true + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream @@ -130,9 +133,10 @@ jobs: echo $strategy.matrix amqplib: + needs: + - versions strategy: - matrix: - range: ['0.10.4' ] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.amqplib}} runs-on: ubuntu-latest services: rabbitmq: @@ -142,17 +146,20 @@ jobs: env: PLUGINS: amqplib SERVICES: rabbitmq + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream apollo: + needs: + - versions strategy: - matrix: - range: ['2.9.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.apollo}} runs-on: ubuntu-latest env: PLUGINS: apollo + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 5c1082a247e..c0b12098fe0 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -1,92 +1,96 @@ { "matrices": { "couchbase": { - "node-version": [16], - "range": ["2.4.2 - 2.6.12", "3.0.0 - 3.2.7", "4.0.0 - 4.4.1"], - "include": [{"node-version": 18, "range":"4.4.1 - 4.4.1"}] + "node-version": [ + "16" + ], + "range": [ + "2.4.2 - 2.6.12", + "3.0.7 - 3.2.7", + "4.0.0 - 4.4.2" + ], + "include": [ + { + "node-version": [ + "18" + ], + "range": [ + "4.4.1 - 4.4.2" + ] + } + ] }, "aerospike": { - "min-version": "4.0.0", "range": [ "4.0.0 - 4.0.5", "5.0.0 - 5.12.1" ] }, "amqp10": { - "range": [ "3.0.0 - 3.6.0" ] + "range": [ + "3.0.0 - 3.6.0" + ] }, "amqplib": { - "min-version": "0.5.0", "range": [ "0.5.0 - 0.10.4" ] }, "@apollo/gateway": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.54.1", "2.0.0 - 2.9.1" ] }, "@aws-sdk/smithy-client": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.374.0" ] }, "aws-sdk": { - "min-version": "2.1.35", "range": [ "2.1.35 - 2.1691.0" ] }, "bluebird": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.11.0", "3.0.0 - 3.7.2" ] }, "body-parser": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.20.3" ] }, "bunyan": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.8.15" ] }, "cassandra-driver": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.6.0", "4.0.0 - 4.7.2" ] }, "connect": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.30.2", "3.0.0 - 3.7.0" ] }, "cookie-parser": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.4.6" ] }, "cookie": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.6.0" ] }, "@cucumber/cucumber": { - "min-version": "7.0.0", "range": [ "7.0.0 - 7.3.2", "8.0.0 - 8.11.1", @@ -96,7 +100,6 @@ ] }, "cypress": { - "min-version": "0.0.1", "range": [ "0.0.1 - 0.20.3", "1.0.0 - 1.4.2", @@ -115,7 +118,6 @@ ] }, "@elastic/elasticsearch": { - "min-version": "5.6.16", "range": [ "5.6.16 - 5.6.22", "6.7.0 - 6.8.8", @@ -124,7 +126,6 @@ ] }, "elasticsearch": { - "min-version": "0.2.0", "range": [ "0.2.0 - 0.3.9", "1.0.0 - 1.5.14", @@ -145,20 +146,17 @@ ] }, "express-mongo-sanitize": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.3.2", "2.0.0 - 2.2.0" ] }, "express": { - "min-version": "4.0.0", "range": [ "4.0.0 - 4.21.0" ] }, "fastify": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.14.6", "2.0.0 - 2.15.3", @@ -168,7 +166,6 @@ ] }, "find-my-way": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.18.1", "2.0.0 - 2.2.5", @@ -182,14 +179,12 @@ ] }, "generic-pool": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.5.4", "3.0.0 - 3.9.0" ] }, "@google-cloud/pubsub": { - "min-version": "1.2.0", "range": [ "1.2.0 - 1.7.3", "2.0.0 - 2.19.4", @@ -198,14 +193,12 @@ ] }, "@graphql-tools/executor": { - "min-version": "0.0.14", "range": [ "0.0.14 - 0.0.20", "1.0.0 - 1.3.1" ] }, "graphql": { - "min-version": "0.10.0", "range": [ "0.10.0 - 0.13.2", "14.0.0 - 14.7.0", @@ -214,13 +207,11 @@ ] }, "@grpc/grpc-js": { - "min-version": "1.0.3", "range": [ "1.0.3 - 1.11.3" ] }, "@hapi/hapi": { - "min-version": "17.9.0", "range": [ "17.9.0 - 17.9.0", "18.2.0 - 18.4.1", @@ -230,7 +221,6 @@ ] }, "hapi": { - "min-version": "16.0.0", "range": [ "16.0.0 - 16.8.4", "17.0.0 - 17.8.5", @@ -238,7 +228,6 @@ ] }, "ioredis": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.5.0", "3.0.0 - 3.2.2", @@ -247,7 +236,6 @@ ] }, "jest-environment-node": { - "min-version": "24.8.0", "range": [ "24.8.0 - 24.9.0", "25.0.0 - 25.5.0", @@ -258,14 +246,12 @@ ] }, "kafkajs": { - "min-version": "1.4.0", "range": [ "1.4.0 - 1.16.0", "2.0.0 - 2.2.4" ] }, "knex": { - "min-version": "0.8.0", "range": [ "0.8.0 - 0.95.15", "1.0.0 - 1.0.7", @@ -274,13 +260,11 @@ ] }, "koa": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.15.3" ] }, "@koa/router": { - "min-version": "8.0.0", "range": [ "8.0.0 - 8.0.8", "9.0.1 - 9.4.0", @@ -291,7 +275,6 @@ ] }, "koa-router": { - "min-version": "7.0.0", "range": [ "7.0.0 - 7.4.0", "8.0.6 - 8.0.8", @@ -303,7 +286,6 @@ ] }, "ldapjs": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.8.0", "1.0.0 - 1.0.2", @@ -312,14 +294,12 @@ ] }, "limitd-client": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.13.1", "2.0.0 - 2.14.1" ] }, "lodash": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.10.0", "1.0.0 - 1.0.2", @@ -329,39 +309,33 @@ ] }, "mariadb": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.3.2" ] }, "memcached": { - "min-version": "2.2.0", "range": [ "2.2.0 - 2.2.2" ] }, "microgateway-core": { - "min-version": "2.1.0", "range": [ "2.1.0 - 2.5.17", "3.0.0 - 3.3.4" ] }, "moleculer": { - "min-version": "0.14.0", "range": [ "0.14.0 - 0.14.34" ] }, "mongodb-core": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.1.20", "3.0.0 - 3.2.7" ] }, "mongodb": { - "min-version": "3.3.0", "range": [ "3.3.0 - 3.7.4", "4.0.0 - 4.17.2", @@ -370,17 +344,15 @@ ] }, "mongoose": { - "min-version": "4.6.4", "range": [ "4.6.4 - 4.13.21", "5.0.0 - 5.13.22", - "6.0.0 - 6.13.2", + "6.0.0 - 6.13.3", "7.0.0 - 7.8.1", "8.0.0 - 8.6.3" ] }, "mquery": { - "min-version": "0.0.1", "range": [ "0.0.1 - 0.9.0", "1.0.0 - 1.11.0", @@ -391,13 +363,11 @@ ] }, "mysql": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.18.1" ] }, "mysql2": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.6.6", "2.0.0 - 2.3.3", @@ -405,7 +375,6 @@ ] }, "next": { - "min-version": "9.5.0", "range": [ "9.5.0 - 9.5.5", "10.0.0 - 10.2.3", @@ -416,48 +385,41 @@ ] }, "openai": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.3.0", "4.0.0 - 4.63.0" ] }, "@opensearch-project/opensearch": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.2.0", "2.0.0 - 2.12.0" ] }, "oracledb": { - "min-version": "5.0.0", "range": [ "5.0.0 - 5.5.0", "6.0.0 - 6.6.0" ] }, "paperplane": { - "min-version": "2.3.0", "range": [ "2.3.0 - 2.3.2", "3.0.0 - 3.1.2" ] }, "passport-http": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.3.0" ] }, "passport-local": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.1.6", "1.0.0 - 1.0.0" ] }, "pg": { - "min-version": "4.0.0", "range": [ "4.0.0 - 4.5.7", "5.0.0 - 5.2.1", @@ -467,7 +429,6 @@ ] }, "pino": { - "min-version": "2.0.0", "range": [ "2.0.0 - 2.16.0", "3.0.0 - 3.4.0", @@ -480,7 +441,6 @@ ] }, "pino-pretty": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.0.1", "2.0.0 - 2.6.1", @@ -496,40 +456,34 @@ ] }, "@playwright/test": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.1111.0", "1.12.0 - 1.47.2" ] }, "playwright": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.18.0", "1.0.0 - 1.47.2" ] }, "promise-js": { - "min-version": "0.0.3", "range": [ "0.0.3 - 0.0.7" ] }, "promise": { - "min-version": "7.0.0", "range": [ "7.0.0 - 7.3.1", "8.0.0 - 8.3.0" ] }, "q": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.5.1" ] }, "qs": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.6.6", "1.0.0 - 1.2.2", @@ -541,19 +495,16 @@ ] }, "@node-redis/client": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.0.6" ] }, "@redis/client": { - "min-version": "1.1.0", "range": [ "1.1.0 - 1.6.0" ] }, "redis": { - "min-version": "0.12.0", "range": [ "0.12.0 - 0.12.1", "1.0.0 - 1.0.0", @@ -563,7 +514,6 @@ ] }, "restify": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.0.3", "4.0.0 - 4.3.4", @@ -577,7 +527,6 @@ ] }, "rhea": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.0.24", "2.0.0 - 2.0.8", @@ -585,14 +534,12 @@ ] }, "router": { - "min-version": "0.2.1", "range": [ "0.2.1 - 0.6.2", "1.0.0 - 1.3.8" ] }, "selenium-webdriver": { - "min-version": "2.29.0", "range": [ "2.29.0 - 2.53.3", "3.0.0 - 3.6.0", @@ -600,7 +547,6 @@ ] }, "sequelize": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.4.3", "1.0.0 - 1.7.11", @@ -612,7 +558,6 @@ ] }, "sharedb": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.9.2", "2.0.0 - 2.2.6", @@ -622,7 +567,6 @@ ] }, "tedious": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.15.0", "2.0.0 - 2.7.1", @@ -645,7 +589,6 @@ ] }, "undici": { - "min-version": "0.1.0", "range": [ "0.1.0 - 0.5.0", "1.0.0 - 1.3.1", @@ -657,7 +600,6 @@ ] }, "vitest": { - "min-version": "0.0.0", "range": [ "0.0.0 - 0.34.6", "1.0.0 - 1.6.0", @@ -665,7 +607,6 @@ ] }, "@vitest/runner": { - "min-version": "0.28.0", "range": [ "0.28.0 - 0.34.7", "1.0.0 - 1.6.0", @@ -673,13 +614,11 @@ ] }, "when": { - "min-version": "3.0.0", "range": [ "3.0.0 - 3.7.8" ] }, "winston": { - "min-version": "1.0.0", "range": [ "1.0.0 - 1.1.2", "2.0.0 - 2.4.7", diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json new file mode 100644 index 00000000000..552e4814db7 --- /dev/null +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -0,0 +1,701 @@ +{ + "matrices": { + "couchbase": { + "min-version": "2.4.2", + "by-node-version": true, + "node-versions": { + "16": [ + "2.4.2 - 2.6.12", + "3.0.7 - 3.2.7", + "4.0.0 - 4.4.2" + ], + "18": [ + "4.4.1 - 4.4.2" + ] + } + }, + "aerospike": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.0.5", + "5.0.0 - 5.12.1" + ] + }, + "amqp10": { + "range": [ + "3.0.0 - 3.6.0" + ] + }, + "amqplib": { + "min-version": "0.5.0", + "range": [ + "0.5.0 - 0.10.4" + ] + }, + "@apollo/gateway": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.54.1", + "2.0.0 - 2.9.1" + ] + }, + "@aws-sdk/smithy-client": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.374.0" + ] + }, + "aws-sdk": { + "min-version": "2.1.35", + "range": [ + "2.1.35 - 2.1691.0" + ] + }, + "bluebird": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.11.0", + "3.0.0 - 3.7.2" + ] + }, + "body-parser": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.20.3" + ] + }, + "bunyan": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.8.15" + ] + }, + "cassandra-driver": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.6.0", + "4.0.0 - 4.7.2" + ] + }, + "connect": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.30.2", + "3.0.0 - 3.7.0" + ] + }, + "cookie-parser": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.4.6" + ] + }, + "cookie": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.6.0" + ] + }, + "@cucumber/cucumber": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.3.2", + "8.0.0 - 8.11.1", + "9.0.0 - 9.6.0", + "10.0.0 - 10.9.0", + "11.0.0 - 11.0.1" + ] + }, + "cypress": { + "min-version": "0.0.1", + "range": [ + "0.0.1 - 0.20.3", + "1.0.0 - 1.4.2", + "2.0.0 - 2.1.0", + "3.0.0 - 3.8.3", + "4.0.0 - 4.12.1", + "5.0.0 - 5.6.0", + "6.0.0 - 6.9.1", + "7.0.0 - 7.7.0", + "8.0.0 - 8.7.0", + "9.0.0 - 9.7.0", + "10.0.0 - 10.11.0", + "11.0.0 - 11.2.0", + "12.0.0 - 12.17.4", + "13.0.0 - 13.14.2" + ] + }, + "@elastic/elasticsearch": { + "min-version": "5.6.16", + "range": [ + "5.6.16 - 5.6.22", + "6.7.0 - 6.8.8", + "7.0.0 - 7.17.14", + "8.0.0 - 8.14.1" + ] + }, + "elasticsearch": { + "min-version": "0.2.0", + "range": [ + "0.2.0 - 0.3.9", + "1.0.0 - 1.5.14", + "2.0.0 - 2.4.3", + "3.0.0 - 3.1.4", + "4.0.0 - 4.1.0", + "5.0.0 - 5.0.0", + "6.0.0 - 6.1.0", + "8.0.1 - 8.2.0", + "9.0.0 - 9.0.2", + "10.0.0 - 10.1.3", + "11.0.0 - 11.0.1", + "12.0.0 - 12.1.3", + "13.0.0 - 13.3.1", + "14.0.0 - 14.2.2", + "15.0.0 - 15.5.0", + "16.0.0 - 16.7.3" + ] + }, + "express-mongo-sanitize": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.3.2", + "2.0.0 - 2.2.0" + ] + }, + "express": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.21.0" + ] + }, + "fastify": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.14.6", + "2.0.0 - 2.15.3", + "3.0.0 - 3.29.5", + "4.0.0 - 4.28.1", + "5.0.0 - 5.0.0" + ] + }, + "find-my-way": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.18.1", + "2.0.0 - 2.2.5", + "3.0.0 - 3.0.5", + "4.0.0 - 4.5.1", + "5.0.0 - 5.6.0", + "6.0.0 - 6.4.0", + "7.0.0 - 7.7.0", + "8.0.0 - 8.2.2", + "9.0.0 - 9.0.1" + ] + }, + "generic-pool": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.5.4", + "3.0.0 - 3.9.0" + ] + }, + "@google-cloud/pubsub": { + "min-version": "1.2.0", + "range": [ + "1.2.0 - 1.7.3", + "2.0.0 - 2.19.4", + "3.0.0 - 3.7.5", + "4.0.0 - 4.7.2" + ] + }, + "@graphql-tools/executor": { + "min-version": "0.0.14", + "range": [ + "0.0.14 - 0.0.20", + "1.0.0 - 1.3.1" + ] + }, + "graphql": { + "min-version": "0.10.0", + "range": [ + "0.10.0 - 0.13.2", + "14.0.0 - 14.7.0", + "15.0.0 - 15.9.0", + "16.0.0 - 16.9.0" + ] + }, + "@grpc/grpc-js": { + "min-version": "1.0.3", + "range": [ + "1.0.3 - 1.11.3" + ] + }, + "@hapi/hapi": { + "min-version": "17.9.0", + "range": [ + "17.9.0 - 17.9.0", + "18.2.0 - 18.4.1", + "19.0.0 - 19.2.0", + "20.0.0 - 20.3.0", + "21.0.0 - 21.3.10" + ] + }, + "hapi": { + "min-version": "16.0.0", + "range": [ + "16.0.0 - 16.8.4", + "17.0.0 - 17.8.5", + "18.0.0 - 18.1.0" + ] + }, + "ioredis": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.5.0", + "3.0.0 - 3.2.2", + "4.0.0 - 4.28.5", + "5.0.0 - 5.4.1" + ] + }, + "jest-environment-node": { + "min-version": "24.8.0", + "range": [ + "24.8.0 - 24.9.0", + "25.0.0 - 25.5.0", + "26.0.0 - 26.6.2", + "27.0.0 - 27.5.1", + "28.0.0 - 28.1.3", + "29.0.0 - 29.7.0" + ] + }, + "kafkajs": { + "min-version": "1.4.0", + "range": [ + "1.4.0 - 1.16.0", + "2.0.0 - 2.2.4" + ] + }, + "knex": { + "min-version": "0.8.0", + "range": [ + "0.8.0 - 0.95.15", + "1.0.0 - 1.0.7", + "2.0.0 - 2.5.1", + "3.0.0 - 3.1.0" + ] + }, + "koa": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.15.3" + ] + }, + "@koa/router": { + "min-version": "8.0.0", + "range": [ + "8.0.0 - 8.0.8", + "9.0.1 - 9.4.0", + "10.0.0 - 10.1.1", + "11.0.0 - 11.0.2", + "12.0.0 - 12.0.2", + "13.0.0 - 13.1.0" + ] + }, + "koa-router": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.4.0", + "8.0.6 - 8.0.8", + "9.0.1 - 9.4.0", + "10.0.0 - 10.1.1", + "11.0.0 - 11.0.2", + "12.0.0 - 12.0.1", + "13.0.1 - 13.0.1" + ] + }, + "ldapjs": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.8.0", + "1.0.0 - 1.0.2", + "2.0.0 - 2.3.3", + "3.0.0 - 3.0.7" + ] + }, + "limitd-client": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.13.1", + "2.0.0 - 2.14.1" + ] + }, + "lodash": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.10.0", + "1.0.0 - 1.0.2", + "2.0.0 - 2.4.2", + "3.0.0 - 3.10.1", + "4.0.0 - 4.17.21" + ] + }, + "mariadb": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.3.2" + ] + }, + "memcached": { + "min-version": "2.2.0", + "range": [ + "2.2.0 - 2.2.2" + ] + }, + "microgateway-core": { + "min-version": "2.1.0", + "range": [ + "2.1.0 - 2.5.17", + "3.0.0 - 3.3.4" + ] + }, + "moleculer": { + "min-version": "0.14.0", + "range": [ + "0.14.0 - 0.14.34" + ] + }, + "mongodb-core": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.1.20", + "3.0.0 - 3.2.7" + ] + }, + "mongodb": { + "min-version": "3.3.0", + "range": [ + "3.3.0 - 3.7.4", + "4.0.0 - 4.17.2", + "5.0.0 - 5.9.2", + "6.0.0 - 6.9.0" + ] + }, + "mongoose": { + "min-version": "4.6.4", + "range": [ + "4.6.4 - 4.13.21", + "5.0.0 - 5.13.22", + "6.0.0 - 6.13.3", + "7.0.0 - 7.8.1", + "8.0.0 - 8.6.3" + ] + }, + "mquery": { + "min-version": "0.0.1", + "range": [ + "0.0.1 - 0.9.0", + "1.0.0 - 1.11.0", + "2.0.0 - 2.3.3", + "3.0.0 - 3.2.5", + "4.0.0 - 4.0.3", + "5.0.0 - 5.0.0" + ] + }, + "mysql": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.18.1" + ] + }, + "mysql2": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.6.6", + "2.0.0 - 2.3.3", + "3.0.0 - 3.11.3" + ] + }, + "next": { + "min-version": "9.5.0", + "range": [ + "9.5.0 - 9.5.5", + "10.0.0 - 10.2.3", + "11.0.0 - 11.1.4", + "12.0.0 - 12.3.4", + "13.0.0 - 13.5.7", + "14.0.0 - 14.2.13" + ] + }, + "openai": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.3.0", + "4.0.0 - 4.63.0" + ] + }, + "@opensearch-project/opensearch": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.2.0", + "2.0.0 - 2.12.0" + ] + }, + "oracledb": { + "min-version": "5.0.0", + "range": [ + "5.0.0 - 5.5.0", + "6.0.0 - 6.6.0" + ] + }, + "paperplane": { + "min-version": "2.3.0", + "range": [ + "2.3.0 - 2.3.2", + "3.0.0 - 3.1.2" + ] + }, + "passport-http": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.3.0" + ] + }, + "passport-local": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.1.6", + "1.0.0 - 1.0.0" + ] + }, + "pg": { + "min-version": "4.0.0", + "range": [ + "4.0.0 - 4.5.7", + "5.0.0 - 5.2.1", + "6.0.0 - 6.4.2", + "7.0.0 - 7.18.2", + "8.0.0 - 8.13.0" + ] + }, + "pino": { + "min-version": "2.0.0", + "range": [ + "2.0.0 - 2.16.0", + "3.0.0 - 3.4.0", + "4.0.0 - 4.17.6", + "5.0.0 - 5.17.0", + "6.0.0 - 6.14.0", + "7.0.0 - 7.11.0", + "8.0.0 - 8.21.0", + "9.0.0 - 9.4.0" + ] + }, + "pino-pretty": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.1", + "2.0.0 - 2.6.1", + "3.0.0 - 3.6.1", + "4.0.0 - 4.8.0", + "5.0.0 - 5.1.3", + "6.0.0 - 6.0.0", + "7.0.0 - 7.6.1", + "8.0.0 - 8.1.0", + "9.0.0 - 9.4.1", + "10.0.0 - 10.3.1", + "11.0.0 - 11.2.2" + ] + }, + "@playwright/test": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.1111.0", + "1.12.0 - 1.47.2" + ] + }, + "playwright": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.18.0", + "1.0.0 - 1.47.2" + ] + }, + "promise-js": { + "min-version": "0.0.3", + "range": [ + "0.0.3 - 0.0.7" + ] + }, + "promise": { + "min-version": "7.0.0", + "range": [ + "7.0.0 - 7.3.1", + "8.0.0 - 8.3.0" + ] + }, + "q": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.5.1" + ] + }, + "qs": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.6.6", + "1.0.0 - 1.2.2", + "2.0.0 - 2.4.2", + "3.0.0 - 3.1.0", + "4.0.0 - 4.0.0", + "5.0.0 - 5.2.1", + "6.0.0 - 6.13.0" + ] + }, + "@node-redis/client": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.6" + ] + }, + "@redis/client": { + "min-version": "1.1.0", + "range": [ + "1.1.0 - 1.6.0" + ] + }, + "redis": { + "min-version": "0.12.0", + "range": [ + "0.12.0 - 0.12.1", + "1.0.0 - 1.0.0", + "2.0.0 - 2.8.0", + "3.0.0 - 3.1.2", + "4.0.0 - 4.7.0" + ] + }, + "restify": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.0.3", + "4.0.0 - 4.3.4", + "5.0.0 - 5.2.1", + "6.0.0 - 6.4.0", + "7.0.0 - 7.7.0", + "8.0.0 - 8.6.1", + "9.0.0 - 9.1.0", + "10.0.0 - 10.0.0", + "11.0.0 - 11.1.0" + ] + }, + "rhea": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.0.24", + "2.0.0 - 2.0.8", + "3.0.0 - 3.0.3" + ] + }, + "router": { + "min-version": "0.2.1", + "range": [ + "0.2.1 - 0.6.2", + "1.0.0 - 1.3.8" + ] + }, + "selenium-webdriver": { + "min-version": "2.29.0", + "range": [ + "2.29.0 - 2.53.3", + "3.0.0 - 3.6.0", + "4.0.0 - 4.25.0" + ] + }, + "sequelize": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.4.3", + "1.0.0 - 1.7.11", + "2.0.0 - 2.1.3", + "3.0.0 - 3.35.1", + "4.0.0 - 4.44.4", + "5.1.0 - 5.22.5", + "6.1.0 - 6.37.3" + ] + }, + "sharedb": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.9.2", + "2.0.0 - 2.2.6", + "3.0.0 - 3.3.2", + "4.0.0 - 4.1.5", + "5.0.0 - 5.0.4" + ] + }, + "tedious": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.15.0", + "2.0.0 - 2.7.1", + "3.0.0 - 3.0.1", + "4.0.0 - 4.2.0", + "5.0.0 - 5.0.3", + "6.0.0 - 6.7.1", + "7.0.0 - 7.0.0", + "8.0.0 - 8.3.1", + "9.0.0 - 9.2.3", + "10.0.0 - 10.0.0", + "11.0.0 - 11.8.0", + "12.0.0 - 12.3.0", + "13.0.0 - 13.2.0", + "14.0.0 - 14.7.0", + "15.0.0 - 15.1.3", + "16.0.0 - 16.7.1", + "17.0.0 - 17.0.0", + "18.0.0 - 18.6.2" + ] + }, + "undici": { + "min-version": "0.1.0", + "range": [ + "0.1.0 - 0.5.0", + "1.0.0 - 1.3.1", + "2.0.0 - 2.2.1", + "3.0.0 - 3.3.6", + "4.0.0 - 4.16.0", + "5.0.0 - 5.28.4", + "6.0.0 - 6.19.8" + ] + }, + "vitest": { + "min-version": "0.0.0", + "range": [ + "0.0.0 - 0.34.6", + "1.0.0 - 1.6.0", + "2.0.0 - 2.1.1" + ] + }, + "@vitest/runner": { + "min-version": "0.28.0", + "range": [ + "0.28.0 - 0.34.7", + "1.0.0 - 1.6.0", + "2.0.0 - 2.1.1" + ] + }, + "when": { + "min-version": "3.0.0", + "range": [ + "3.0.0 - 3.7.8" + ] + }, + "winston": { + "min-version": "1.0.0", + "range": [ + "1.0.0 - 1.1.2", + "2.0.0 - 2.4.7", + "3.0.0 - 3.14.2" + ] + } + } +} \ No newline at end of file diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js new file mode 100644 index 00000000000..e696c2f3373 --- /dev/null +++ b/scripts/create_matrix.js @@ -0,0 +1,83 @@ +const { npmView } = require('./helpers/versioning') +const path = require('path') +const fs = require('fs') +const { execSync } = require('child_process') +const yaml = require('js-yaml') + +const matricesPath = path.join( + __dirname, + '..', + 'packages', + 'datadog-instrumentations', + 'src', + 'helpers', + 'matrices.json' +) +const versionsPath = path.join( + __dirname, + '..', + 'packages', + 'datadog-instrumentations', + 'src', + 'helpers', + 'versions.json' +) + +const matricesJson = require(matricesPath) + +const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) + +// console.log('json', pluginsNames) + +const versionsJson = require(versionsPath) +const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versionsPath, 'utf-8')).matrices) + +function generateMatrix (name) { + let versionsPlugin + let matrix + + for (const name of versionsNames) { + // object is by plugin name + // it has the properties of min-version the minimum version we support + // and it has node-versions tracking version support by node version where applicable + // the first node version will be nested as node-version and range, subsequent node version + // ranges will need to be nested within 'include:' + // if the plugin does not require a node version it will just have a range + + versionsPlugin = versionsJson.matrices[name] + + if (versionsPlugin['by-node-version'] === true) { + matrix = { + 'node-version': [], + range: [], + include: {} + } + const range = [] + const plugin = versionsPlugin['node-versions'] + for (const version in plugin) { + range.push({ 'node-version': [version], range: plugin[version] }) + } + + for (let ele = 0; ele < range.length; ele++) { + if (ele === 0) { + matrix['node-version'] = range[ele]['node-version'] + matrix.range = range[ele].range + } else { + matrix.include = [range[ele]] + } + } + + matricesJson.matrices[name] = matrix + } else { + matrix = { + range: versionsPlugin.range + } + matricesJson.matrices[name] = matrix + } + } + fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) +} + +module.exports = { + generateMatrix +} diff --git a/scripts/outdated.js b/scripts/outdated.js index d4f5098512e..a23610023e2 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -7,6 +7,8 @@ const fs = require('fs') const { execSync } = require('child_process') const yaml = require('js-yaml') +const { generateMatrix } = require('./create_matrix') + const latestsPath = path.join( __dirname, '..', @@ -27,12 +29,23 @@ const matricesPath = path.join( 'matrices.json' ) +const versionsPath = path.join( + __dirname, + '..', + 'packages', + 'datadog-instrumentations', + 'src', + 'helpers', + 'versions.json' +) + const latestsJson = require(latestsPath) const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) .filter(x => typeof x === 'string' && x !== 'child_process' && !x.startsWith('node:')) const matricesJson = require(matricesPath) -const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) +const versionsJson = require(versionsPath) +const pluginNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) // TODO A lot of this can be optimized by using `npm outdated`. @@ -42,6 +55,10 @@ function makeAPR (branchName) { execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) } +function splitting (element) { + return +element.split('.')[0] +} + function maxVersion (range) { if (typeof range === 'string') { return range @@ -49,57 +66,43 @@ function maxVersion (range) { return range.pop() } -function minVersion (range) { - if (typeof range === 'string') { - return range - } - return range.shift() -} +async function updateRange (name, major) { + const versionRange = await npmView(`${name}@${major} version`) -function splitting (element) { - return +element.split('.')[0] -} + const maxRange = maxVersion(versionRange) -async function ranges (name, minimum) { - const distTags = await npmView(`${name} dist-tags`) - const latestVersion = splitting(distTags?.latest) + return maxRange +} - const splitMin = splitting(minimum) +async function loopRange (name, range) { + for (let ele = 0; ele < range.length; ele++) { + const latest = range[ele].split(' - ') + const major = splitting(latest[0]) - const ranges = [] - let versionRange - let maxRange - let minRange + latest[1] = await updateRange(name, major) + range[ele] = `${latest[0]} - ${latest[1]}` + } + fs.writeFileSync(versionsPath, JSON.stringify(versionsJson, null, 2)) +} - for (let major = splitMin; major <= latestVersion; major++) { - try { - versionRange = await npmView(`${name}@${major} version`) - maxRange = maxVersion(versionRange) - minRange = minVersion(versionRange) +async function updatePlugin (name) { + const plugin = versionsJson.matrices[name] - if (major === splitMin) { - ranges.push(`${minimum} - ${maxRange}`) - } else if (versionRange !== undefined) { - ranges.push(`${minRange} - ${maxRange}`) - } - } catch (e) { - console.log(`No version range found for "${name}" at version ${major}`) + if (plugin['by-node-version'] === true) { + for (const versions in plugin['node-versions']) { + const pluginRange = plugin['node-versions'] + loopRange(name, pluginRange[versions]) } + } else { + loopRange(name, plugin.range) } - return ranges } async function fix () { - let latests - - for (const name of pluginsNames) { - latests = matricesJson.matrices[name] - const minVersion = latests['min-version'] - const versions = await ranges(name, minVersion) - - latests.range = versions + for (const name of pluginNames) { + await updatePlugin(name) + generateMatrix(name) } - fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) const result = execSync('git status').toString() @@ -135,5 +138,40 @@ async function check () { } } +function minVersion (range) { + if (typeof range === 'string') { + return range + } + return range.shift() +} +async function ranges (name, minimum) { + const distTags = await npmView(`${name} dist-tags`) + const latestVersion = splitting(distTags?.latest) + + const splitMin = splitting(minimum) + + const ranges = [] + let versionRange + let maxRange + let minRange + + for (let major = splitMin; major <= latestVersion; major++) { + try { + versionRange = await npmView(`${name}@${major} version`) + maxRange = maxVersion(versionRange) + minRange = minVersion(versionRange) + + if (major === splitMin) { + ranges.push(`${minimum} - ${maxRange}`) + } else if (versionRange !== undefined) { + ranges.push(`${minRange} - ${maxRange}`) + } + } catch (e) { + console.log(`No version range found for "${name}" at version ${major}`) + } + } + return ranges +} + if (process.argv.includes('fix')) fix() else check() From 1af75033640a274645115e95a420a2aaabb7b6b5 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 25 Sep 2024 10:45:00 -0400 Subject: [PATCH 41/58] adding script to create matrix --- .../src/helpers/matrices.json | 12 ++++++------ scripts/create_matrix.js | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index c0b12098fe0..4506e85f89a 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -5,15 +5,15 @@ "16" ], "range": [ - "2.4.2 - 2.6.12", - "3.0.7 - 3.2.7", - "4.0.0 - 4.4.2" + [ + "2.4.2 - 2.6.12", + "3.0.7 - 3.2.7", + "4.0.0 - 4.4.2" + ] ], "include": [ { - "node-version": [ - "18" - ], + "node-version": "18", "range": [ "4.4.1 - 4.4.2" ] diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index e696c2f3373..fef982a4edd 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -55,18 +55,17 @@ function generateMatrix (name) { const range = [] const plugin = versionsPlugin['node-versions'] for (const version in plugin) { - range.push({ 'node-version': [version], range: plugin[version] }) + range.push({ 'node-version': version, range: plugin[version] }) } for (let ele = 0; ele < range.length; ele++) { if (ele === 0) { - matrix['node-version'] = range[ele]['node-version'] - matrix.range = range[ele].range + matrix['node-version'] = [range[ele]['node-version']] + matrix.range = [range[ele].range] } else { matrix.include = [range[ele]] } } - matricesJson.matrices[name] = matrix } else { matrix = { @@ -77,7 +76,7 @@ function generateMatrix (name) { } fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) } - +generateMatrix('couchbase') module.exports = { generateMatrix } From 9a507cc07bf48a8c64ed147ec2a5d376827382cc Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 25 Sep 2024 10:49:01 -0400 Subject: [PATCH 42/58] adding script to create matrix --- .../src/helpers/matrices.json | 12 +++++------- scripts/create_matrix.js | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 4506e85f89a..2d5e0a4fa40 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -2,18 +2,16 @@ "matrices": { "couchbase": { "node-version": [ - "16" + 16 ], "range": [ - [ - "2.4.2 - 2.6.12", - "3.0.7 - 3.2.7", - "4.0.0 - 4.4.2" - ] + "2.4.2 - 2.6.12", + "3.0.7 - 3.2.7", + "4.0.0 - 4.4.2" ], "include": [ { - "node-version": "18", + "node-version": 18, "range": [ "4.4.1 - 4.4.2" ] diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index fef982a4edd..450a1b65cfa 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -55,13 +55,13 @@ function generateMatrix (name) { const range = [] const plugin = versionsPlugin['node-versions'] for (const version in plugin) { - range.push({ 'node-version': version, range: plugin[version] }) + range.push({ 'node-version': +version, range: plugin[version] }) } for (let ele = 0; ele < range.length; ele++) { if (ele === 0) { matrix['node-version'] = [range[ele]['node-version']] - matrix.range = [range[ele].range] + matrix.range = range[ele].range } else { matrix.include = [range[ele]] } From 5a33b0285bd9b28a64e211f3716b64ff25badf44 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 25 Sep 2024 11:00:31 -0400 Subject: [PATCH 43/58] adding script to create matrix --- .github/workflows/plugins.yml | 2 +- packages/datadog-instrumentations/src/helpers/matrices.json | 4 +--- scripts/create_matrix.js | 5 ++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 80cc7391aa7..0ed8b6ad337 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -155,7 +155,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.apollo}} + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.@apollo/gateway}} runs-on: ubuntu-latest env: PLUGINS: apollo diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 2d5e0a4fa40..1eb87fbfb3d 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -12,9 +12,7 @@ "include": [ { "node-version": 18, - "range": [ - "4.4.1 - 4.4.2" - ] + "range": "4.4.1 - 4.4.2" } ] }, diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 450a1b65cfa..751d411ac32 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -63,7 +63,10 @@ function generateMatrix (name) { matrix['node-version'] = [range[ele]['node-version']] matrix.range = range[ele].range } else { - matrix.include = [range[ele]] + matrix.include = [{ + 'node-version': range[ele]['node-version'], + range: range[ele].range[0] + }] } } matricesJson.matrices[name] = matrix From 85a14772255169e92a871936ff65c69eeaea5b59 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 25 Sep 2024 11:03:31 -0400 Subject: [PATCH 44/58] adding script to create matrix --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 0ed8b6ad337..c0fb51fb5f4 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -155,7 +155,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.@apollo/gateway}} + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.apollo/gateway}} runs-on: ubuntu-latest env: PLUGINS: apollo From 82fd66a6451d9cacc7c9bdd9f5d6d778ed9d1989 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 25 Sep 2024 11:05:07 -0400 Subject: [PATCH 45/58] adding script to create matrix --- .github/workflows/plugins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index c0fb51fb5f4..80cc7391aa7 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -155,7 +155,7 @@ jobs: needs: - versions strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.apollo/gateway}} + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.apollo}} runs-on: ubuntu-latest env: PLUGINS: apollo From 2aa7fec13aaabcd5d54f46385d4667c9a3f1efec Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 26 Sep 2024 11:05:18 -0400 Subject: [PATCH 46/58] updating scripts --- .../datadog-instrumentations/src/helpers/matrices.json | 7 ++++--- .../datadog-instrumentations/src/helpers/versions.json | 7 ++++--- scripts/outdated.js | 10 +++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/matrices.json b/packages/datadog-instrumentations/src/helpers/matrices.json index 1eb87fbfb3d..098f36e2bc5 100644 --- a/packages/datadog-instrumentations/src/helpers/matrices.json +++ b/packages/datadog-instrumentations/src/helpers/matrices.json @@ -6,6 +6,7 @@ ], "range": [ "2.4.2 - 2.6.12", + "3.0.0 - 3.0.5", "3.0.7 - 3.2.7", "4.0.0 - 4.4.2" ], @@ -29,7 +30,7 @@ }, "amqplib": { "range": [ - "0.5.0 - 0.10.4" + "0.5.3 - 0.10.4" ] }, "@apollo/gateway": { @@ -344,7 +345,7 @@ "4.6.4 - 4.13.21", "5.0.0 - 5.13.22", "6.0.0 - 6.13.3", - "7.0.0 - 7.8.1", + "7.0.0 - 7.8.2", "8.0.0 - 8.6.3" ] }, @@ -383,7 +384,7 @@ "openai": { "range": [ "3.0.0 - 3.3.0", - "4.0.0 - 4.63.0" + "4.0.0 - 4.64.0" ] }, "@opensearch-project/opensearch": { diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json index 552e4814db7..d310e7d38d5 100644 --- a/packages/datadog-instrumentations/src/helpers/versions.json +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -6,6 +6,7 @@ "node-versions": { "16": [ "2.4.2 - 2.6.12", + "3.0.0 - 3.2.7", "3.0.7 - 3.2.7", "4.0.0 - 4.4.2" ], @@ -29,7 +30,7 @@ "amqplib": { "min-version": "0.5.0", "range": [ - "0.5.0 - 0.10.4" + "0.5.3 - 0.10.4" ] }, "@apollo/gateway": { @@ -386,7 +387,7 @@ "4.6.4 - 4.13.21", "5.0.0 - 5.13.22", "6.0.0 - 6.13.3", - "7.0.0 - 7.8.1", + "7.0.0 - 7.8.2", "8.0.0 - 8.6.3" ] }, @@ -430,7 +431,7 @@ "min-version": "3.0.0", "range": [ "3.0.0 - 3.3.0", - "4.0.0 - 4.63.0" + "4.0.0 - 4.64.0" ] }, "@opensearch-project/opensearch": { diff --git a/scripts/outdated.js b/scripts/outdated.js index a23610023e2..9ce64f9761c 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -55,10 +55,6 @@ function makeAPR (branchName) { execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) } -function splitting (element) { - return +element.split('.')[0] -} - function maxVersion (range) { if (typeof range === 'string') { return range @@ -77,7 +73,7 @@ async function updateRange (name, major) { async function loopRange (name, range) { for (let ele = 0; ele < range.length; ele++) { const latest = range[ele].split(' - ') - const major = splitting(latest[0]) + const major = +latest[0].split('.')[0] latest[1] = await updateRange(name, major) range[ele] = `${latest[0]} - ${latest[1]}` @@ -173,5 +169,9 @@ async function ranges (name, minimum) { return ranges } +function splitting (element) { + return +element.split('.')[0] +} + if (process.argv.includes('fix')) fix() else check() From b3414a5574c885997e8eb8759911113d93c48cb2 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Fri, 27 Sep 2024 17:49:59 -0400 Subject: [PATCH 47/58] removing matrices.json --- .github/workflows/plugins.yml | 4 ++-- scripts/create_matrix.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 80cc7391aa7..18632ecbad0 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - id: plugins run: | - content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') + content=$(node scripts/outdated.js fix) echo "matrices=$content" >> $GITHUB_OUTPUT echo $content @@ -107,7 +107,7 @@ jobs: uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 - amqp10: # TODO: move rhea to its own job + amqp10: needs: - versions strategy: diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 751d411ac32..ac21e845262 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -77,9 +77,10 @@ function generateMatrix (name) { matricesJson.matrices[name] = matrix } } - fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) + return matricesJson.matrices } -generateMatrix('couchbase') module.exports = { generateMatrix } + +// content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') From eb7e897575b0b0060c201060cd79cd9b2715b3cf Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Fri, 27 Sep 2024 18:08:26 -0400 Subject: [PATCH 48/58] removing matrices.jn reverting back and keeping matrices json --- .github/workflows/plugins.yml | 4 ++-- scripts/create_matrix.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 18632ecbad0..80cc7391aa7 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - id: plugins run: | - content=$(node scripts/outdated.js fix) + content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') echo "matrices=$content" >> $GITHUB_OUTPUT echo $content @@ -107,7 +107,7 @@ jobs: uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 - amqp10: + amqp10: # TODO: move rhea to its own job needs: - versions strategy: diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index ac21e845262..751d411ac32 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -77,10 +77,9 @@ function generateMatrix (name) { matricesJson.matrices[name] = matrix } } - return matricesJson.matrices + fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) } +generateMatrix('couchbase') module.exports = { generateMatrix } - -// content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') From eb02ccf9625fd409d32369143ebb882147f6a364 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 1 Oct 2024 16:02:56 -0400 Subject: [PATCH 49/58] removing matrices.json --- .github/workflows/plugins.yml | 5 ++++- scripts/create_matrix.js | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 80cc7391aa7..94099c58cd6 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -20,9 +20,12 @@ jobs: matrices: ${{steps.plugins.outputs.matrices}} steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/node/latest + - uses: ./.github/actions/install - id: plugins run: | - content=$(cat packages/datadog-instrumentations/src/helpers/matrices.json | tr '\n' ' ') + echo "starting up" + content=$(node ./scripts/create_matrix.js) echo "matrices=$content" >> $GITHUB_OUTPUT echo $content diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 751d411ac32..4ac2cd66672 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -77,9 +77,10 @@ function generateMatrix (name) { matricesJson.matrices[name] = matrix } } - fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) + // fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) + return JSON.stringify(matricesJson, null, 2) } -generateMatrix('couchbase') +// generateMatrix('couchbase') module.exports = { generateMatrix } From 154efc2fc36fb0433a50d2999cfa804f406509ed Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 1 Oct 2024 16:07:49 -0400 Subject: [PATCH 50/58] removing matrices.json --- scripts/create_matrix.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 4ac2cd66672..f4b803a29b8 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const { npmView } = require('./helpers/versioning') const path = require('path') const fs = require('fs') @@ -77,10 +79,10 @@ function generateMatrix (name) { matricesJson.matrices[name] = matrix } } - // fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) + fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) return JSON.stringify(matricesJson, null, 2) } -// generateMatrix('couchbase') + module.exports = { generateMatrix } From 46b47034f0df3870808191915ec7e17fb4500253 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 1 Oct 2024 16:11:44 -0400 Subject: [PATCH 51/58] removing matrices.json --- scripts/create_matrix.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index f4b803a29b8..e37ff0535ab 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -80,7 +80,7 @@ function generateMatrix (name) { } } fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) - return JSON.stringify(matricesJson, null, 2) + return matricesJson } module.exports = { From d4a4d3cdc5ead477b1eb95123ca56ed879c65a6f Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 1 Oct 2024 16:38:52 -0400 Subject: [PATCH 52/58] removing matrices.json --- .github/workflows/plugins.yml | 1 + scripts/create_matrix.js | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 94099c58cd6..b8d53fcb231 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -25,6 +25,7 @@ jobs: - id: plugins run: | echo "starting up" + echo node --version content=$(node ./scripts/create_matrix.js) echo "matrices=$content" >> $GITHUB_OUTPUT echo $content diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index e37ff0535ab..8dba602618a 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -1,9 +1,7 @@ #!/usr/bin/env node -const { npmView } = require('./helpers/versioning') const path = require('path') const fs = require('fs') -const { execSync } = require('child_process') const yaml = require('js-yaml') const matricesPath = path.join( @@ -34,7 +32,7 @@ const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matric const versionsJson = require(versionsPath) const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versionsPath, 'utf-8')).matrices) -function generateMatrix (name) { +function generateMatrix () { let versionsPlugin let matrix @@ -79,10 +77,14 @@ function generateMatrix (name) { matricesJson.matrices[name] = matrix } } - fs.writeFileSync(matricesPath, JSON.stringify(matricesJson, null, 2)) return matricesJson } module.exports = { generateMatrix } + +if (require.main === module) { + // eslint-disable-next-line no-console + console.log(JSON.stringify(generateMatrix())) +} From 4e0906c6a355cb2c2560adc9175c4f2ec1ada2a9 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 2 Oct 2024 12:10:37 -0400 Subject: [PATCH 53/58] updating versions json --- packages/datadog-instrumentations/src/helpers/versions.json | 6 +++++- scripts/create_matrix.js | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json index d310e7d38d5..2128c416100 100644 --- a/packages/datadog-instrumentations/src/helpers/versions.json +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -1,6 +1,7 @@ { "matrices": { "couchbase": { + "name": "couchbase", "min-version": "2.4.2", "by-node-version": true, "node-versions": { @@ -8,10 +9,13 @@ "2.4.2 - 2.6.12", "3.0.0 - 3.2.7", "3.0.7 - 3.2.7", - "4.0.0 - 4.4.2" + "4.0.0 - 4.4.2" ], "18": [ "4.4.1 - 4.4.2" + ], + "strict": [ + ] } }, diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 8dba602618a..4c8fa6f8c51 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - const path = require('path') const fs = require('fs') const yaml = require('js-yaml') From f9273e9bdc485c5272a340d961573ad047238276 Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 8 Oct 2024 16:28:37 -0400 Subject: [PATCH 54/58] resolving outdated script --- scripts/create_matrix.js | 4 ---- scripts/outdated.js | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 4c8fa6f8c51..39a5f0905e7 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -23,10 +23,6 @@ const versionsPath = path.join( const matricesJson = require(matricesPath) -const pluginsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) - -// console.log('json', pluginsNames) - const versionsJson = require(versionsPath) const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versionsPath, 'utf-8')).matrices) diff --git a/scripts/outdated.js b/scripts/outdated.js index 9ce64f9761c..f12925bbf79 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -7,7 +7,7 @@ const fs = require('fs') const { execSync } = require('child_process') const yaml = require('js-yaml') -const { generateMatrix } = require('./create_matrix') +// const { generateMatrix } = require('./create_matrix') const latestsPath = path.join( __dirname, @@ -97,17 +97,17 @@ async function updatePlugin (name) { async function fix () { for (const name of pluginNames) { await updatePlugin(name) - generateMatrix(name) + // generateMatrix(name) } const result = execSync('git status').toString() - if (result.includes(matricesPath)) { + if (result.includes(versionsPath)) { const branchName = 'update_outdated_integrations' try { execSync(`git checkout -b ${branchName}`) - execSync(`git add ${matricesPath}`) - execSync('git commit -m "fix: update integr latests.json"') + execSync(`git add ${versionsPath}`) + execSync('git commit -m "fix: update integr versions.json"') execSync(`git push origin ${branchName}`) makeAPR(branchName) From 34b5c1bab90528756dc72770241764b3633682bd Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Tue, 22 Oct 2024 17:06:47 -0400 Subject: [PATCH 55/58] changing plugin yml with matrices --- .github/workflows/outdated-integrations.yml | 4 +- .github/workflows/plugins.yml | 66 ++++++++++----- .../src/helpers/versions.json | 84 +++++++++++++++---- scripts/create_matrix.js | 11 ++- scripts/outdated.js | 4 +- 5 files changed, 121 insertions(+), 48 deletions(-) diff --git a/.github/workflows/outdated-integrations.yml b/.github/workflows/outdated-integrations.yml index 7a0512545f3..77242d58214 100644 --- a/.github/workflows/outdated-integrations.yml +++ b/.github/workflows/outdated-integrations.yml @@ -2,8 +2,8 @@ name: Outdated Integrations on: schedule: - # Yes, this runs a _lot_. We don't want to be out of date for very long. - - cron: '37 12,16,22 * * *' + # This, will run every weekday at 2pm UTC + - cron: '0 14 * * 1,2,3,4,5' jobs: outdated-integrations: diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b8d53fcb231..83b729bd1ad 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -178,10 +178,10 @@ jobs: - uses: ./.github/actions/plugins/test-and-upstream aws-sdk: + needs: + - versions strategy: - matrix: - node-version: ['18', 'latest'] - range: ['2.1691.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.aws-sdk}} runs-on: ubuntu-latest services: localstack: @@ -217,6 +217,7 @@ jobs: PLUGINS: aws-sdk SERVICES: localstack localstack-legacy DD_DATA_STREAMS_ENABLED: true + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start @@ -247,12 +248,14 @@ jobs: - uses: ./.github/actions/plugins/test bluebird: + needs: + - versions strategy: - matrix: - range: ['3.7.2'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.bluebird}} runs-on: ubuntu-latest env: PLUGINS: bluebird + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test @@ -266,20 +269,23 @@ jobs: - uses: ./.github/actions/plugins/test bunyan: + needs: + - versions strategy: - matrix: - range: ['1.8.15'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.bunyan}} runs-on: ubuntu-latest env: PLUGINS: bunyan + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream cassandra: + needs: + - versions strategy: - matrix: - range: ['>=3.0.0 <=4.7.2'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.cassandra}} runs-on: ubuntu-latest services: cassandra: @@ -289,6 +295,7 @@ jobs: env: PLUGINS: cassandra-driver SERVICES: cassandra + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test @@ -346,35 +353,41 @@ jobs: - uses: codecov/codecov-action@v3 connect: + needs: + - versions strategy: - matrix: - range: ['3.7.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.connect}} runs-on: ubuntu-latest env: PLUGINS: connect + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test-and-upstream cucumber: + needs: + - versions strategy: - matrix: - range: ['11.0.1'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.cucumber}} runs-on: ubuntu-latest env: PLUGINS: cucumber + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test # TODO: fix performance issues and test more Node versions cypress: + needs: + - versions strategy: - matrix: - range: ['13.14.2'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.cypress}} runs-on: ubuntu-latest env: PLUGINS: cypress + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start @@ -405,9 +418,10 @@ jobs: - uses: codecov/codecov-action@v3 elasticsearch: + needs: + - versions strategy: - matrix: - range: ['16.7.3'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.elasticsearch}} runs-on: ubuntu-latest services: elasticsearch: @@ -419,6 +433,7 @@ jobs: env: PLUGINS: elasticsearch SERVICES: elasticsearch + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start @@ -431,9 +446,10 @@ jobs: - uses: codecov/codecov-action@v3 express: + needs: + - versions strategy: - matrix: - range: ['4.21.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.express}} runs-on: ubuntu-latest env: PLUGINS: express @@ -457,12 +473,14 @@ jobs: - uses: ./.github/actions/plugins/test fastify: + needs: + - versions strategy: - matrix: - range: ['4.28.1'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.fastify}} runs-on: ubuntu-latest env: PLUGINS: fastify + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test @@ -476,12 +494,14 @@ jobs: - uses: ./.github/actions/plugins/test generic-pool: + needs: + - versions strategy: - matrix: - range: ['3.9.0'] + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.generic-pool}} runs-on: ubuntu-latest env: PLUGINS: generic-pool + PACKAGE_VERSION_RANGE: ${{ matrix.range }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/plugins/test diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json index 2128c416100..ba0c2c13cd5 100644 --- a/packages/datadog-instrumentations/src/helpers/versions.json +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -1,7 +1,7 @@ { "matrices": { "couchbase": { - "name": "couchbase", + "plugin-name": "couchbase", "min-version": "2.4.2", "by-node-version": true, "node-versions": { @@ -20,24 +20,36 @@ } }, "aerospike": { + "plugin-name": "aerospike", "min-version": "4.0.0", - "range": [ - "4.0.0 - 4.0.5", - "5.0.0 - 5.12.1" - ] + "by-node-version": true, + "node-versions": { + "16": [ + "4.0.0 - 4.0.5" + + ], + "18": [ + "5.2.0 - 5.7.0" + ], + "20": [ + "5.12.1" + ]} }, "amqp10": { + "plugin-name": "amqp10", "range": [ "3.0.0 - 3.6.0" ] }, "amqplib": { + "plugin-name": "amqplib", "min-version": "0.5.0", "range": [ "0.5.3 - 0.10.4" ] }, "@apollo/gateway": { + "plugin-name": "apollo", "min-version": "0.1.0", "range": [ "0.1.0 - 0.54.1", @@ -51,12 +63,14 @@ ] }, "aws-sdk": { + "plugin-name": "aws-sdk", "min-version": "2.1.35", "range": [ "2.1.35 - 2.1691.0" ] }, "bluebird": { + "plugin-name": "bluebird", "min-version": "2.0.0", "range": [ "2.0.0 - 2.11.0", @@ -70,12 +84,14 @@ ] }, "bunyan": { + "plugin-name": "bunyan", "min-version": "1.0.0", "range": [ "1.0.0 - 1.8.15" ] }, "cassandra-driver": { + "plugin-name": "cassandra", "min-version": "3.0.0", "range": [ "3.0.0 - 3.6.0", @@ -83,6 +99,7 @@ ] }, "connect": { + "plugin-name": "connect", "min-version": "2.0.0", "range": [ "2.0.0 - 2.30.2", @@ -102,6 +119,7 @@ ] }, "@cucumber/cucumber": { + "plugin-name": "cucumber", "min-version": "7.0.0", "range": [ "7.0.0 - 7.3.2", @@ -112,6 +130,7 @@ ] }, "cypress": { + "plugin-name": "cypress", "min-version": "0.0.1", "range": [ "0.0.1 - 0.20.3", @@ -140,17 +159,9 @@ ] }, "elasticsearch": { - "min-version": "0.2.0", - "range": [ - "0.2.0 - 0.3.9", - "1.0.0 - 1.5.14", - "2.0.0 - 2.4.3", - "3.0.0 - 3.1.4", - "4.0.0 - 4.1.0", - "5.0.0 - 5.0.0", - "6.0.0 - 6.1.0", - "8.0.1 - 8.2.0", - "9.0.0 - 9.0.2", + "plugin-name": "elasticsearch", + "min-version": "10.0.0", + "range": [ "10.0.0 - 10.1.3", "11.0.0 - 11.0.1", "12.0.0 - 12.1.3", @@ -168,12 +179,14 @@ ] }, "express": { + "plugin-name": "express", "min-version": "4.0.0", "range": [ "4.0.0 - 4.21.0" ] }, "fastify": { + "plugin-name": "fastify", "min-version": "1.0.0", "range": [ "1.0.0 - 1.14.6", @@ -198,6 +211,7 @@ ] }, "generic-pool": { + "plugin-name": "generic-pool", "min-version": "2.0.0", "range": [ "2.0.0 - 2.5.4", @@ -205,6 +219,7 @@ ] }, "@google-cloud/pubsub": { + "plugin-name": "google-cloud-pubsub", "min-version": "1.2.0", "range": [ "1.2.0 - 1.7.3", @@ -221,6 +236,7 @@ ] }, "graphql": { + "plugin-name": "graphql", "min-version": "0.10.0", "range": [ "0.10.0 - 0.13.2", @@ -230,12 +246,14 @@ ] }, "@grpc/grpc-js": { + "plugin-name": "grpc", "min-version": "1.0.3", "range": [ "1.0.3 - 1.11.3" ] }, "@hapi/hapi": { + "plugin-name": "hapi", "min-version": "17.9.0", "range": [ "17.9.0 - 17.9.0", @@ -246,6 +264,7 @@ ] }, "hapi": { + "plugin-name": "hapi", "min-version": "16.0.0", "range": [ "16.0.0 - 16.8.4", @@ -263,6 +282,7 @@ ] }, "jest-environment-node": { + "plugin-name": "jest", "min-version": "24.8.0", "range": [ "24.8.0 - 24.9.0", @@ -274,6 +294,7 @@ ] }, "kafkajs": { + "plugin-name": "kafkajs", "min-version": "1.4.0", "range": [ "1.4.0 - 1.16.0", @@ -281,6 +302,7 @@ ] }, "knex": { + "plugin-name": "knex", "min-version": "0.8.0", "range": [ "0.8.0 - 0.95.15", @@ -290,6 +312,7 @@ ] }, "koa": { + "plugin-name": "koa", "min-version": "2.0.0", "range": [ "2.0.0 - 2.15.3" @@ -328,6 +351,7 @@ ] }, "limitd-client": { + "plugin-name": "limitd-client", "min-version": "1.0.0", "range": [ "1.0.0 - 1.13.1", @@ -351,12 +375,14 @@ ] }, "memcached": { + "plugin-name": "memcached", "min-version": "2.2.0", "range": [ "2.2.0 - 2.2.2" ] }, "microgateway-core": { + "plugin-name": "microgateway-core", "min-version": "2.1.0", "range": [ "2.1.0 - 2.5.17", @@ -364,6 +390,7 @@ ] }, "moleculer": { + "plugin-name": "moleculer", "min-version": "0.14.0", "range": [ "0.14.0 - 0.14.34" @@ -377,6 +404,7 @@ ] }, "mongodb": { + "plugin-name": "mongodb", "min-version": "3.3.0", "range": [ "3.3.0 - 3.7.4", @@ -386,6 +414,7 @@ ] }, "mongoose": { + "plugin-name": "mongoose", "min-version": "4.6.4", "range": [ "4.6.4 - 4.13.21", @@ -407,12 +436,14 @@ ] }, "mysql": { + "plugin-name": "msql", "min-version": "2.0.0", "range": [ "2.0.0 - 2.18.1" ] }, "mysql2": { + "plugin-name": "mysql2", "min-version": "1.0.0", "range": [ "1.0.0 - 1.6.6", @@ -421,6 +452,7 @@ ] }, "next": { + "plugin-name": "next", "min-version": "9.5.0", "range": [ "9.5.0 - 9.5.5", @@ -432,6 +464,7 @@ ] }, "openai": { + "plugin-name": "openai", "min-version": "3.0.0", "range": [ "3.0.0 - 3.3.0", @@ -439,6 +472,7 @@ ] }, "@opensearch-project/opensearch": { + "plugin-name": "opensearch", "min-version": "1.0.0", "range": [ "1.0.0 - 1.2.0", @@ -446,6 +480,7 @@ ] }, "oracledb": { + "plugin-name": "oracledb", "min-version": "5.0.0", "range": [ "5.0.0 - 5.5.0", @@ -453,6 +488,7 @@ ] }, "paperplane": { + "plugin-name": "paperplane", "min-version": "2.3.0", "range": [ "2.3.0 - 2.3.2", @@ -473,6 +509,7 @@ ] }, "pg": { + "plugin-name": "postgres", "min-version": "4.0.0", "range": [ "4.0.0 - 4.5.7", @@ -483,6 +520,7 @@ ] }, "pino": { + "plugin-name": "pino", "min-version": "2.0.0", "range": [ "2.0.0 - 2.16.0", @@ -526,12 +564,14 @@ ] }, "promise-js": { + "plugin-name": "promise-js", "min-version": "0.0.3", "range": [ "0.0.3 - 0.0.7" ] }, "promise": { + "plugin-name": "promise", "min-version": "7.0.0", "range": [ "7.0.0 - 7.3.1", @@ -539,6 +579,7 @@ ] }, "q": { + "plugin-name": "q", "min-version": "1.0.0", "range": [ "1.0.0 - 1.5.1" @@ -569,6 +610,7 @@ ] }, "redis": { + "plugin-name": "redis", "min-version": "0.12.0", "range": [ "0.12.0 - 0.12.1", @@ -579,6 +621,7 @@ ] }, "restify": { + "plugin-name": "resify", "min-version": "3.0.0", "range": [ "3.0.0 - 3.0.3", @@ -593,6 +636,7 @@ ] }, "rhea": { + "plugin-name": "rhea", "min-version": "1.0.0", "range": [ "1.0.0 - 1.0.24", @@ -601,6 +645,7 @@ ] }, "router": { + "plugin-name": "router", "min-version": "0.2.1", "range": [ "0.2.1 - 0.6.2", @@ -628,6 +673,7 @@ ] }, "sharedb": { + "plugin-name": "sharedb", "min-version": "1.0.0", "range": [ "1.0.0 - 1.9.2", @@ -638,6 +684,7 @@ ] }, "tedious": { + "plugin-name": "tedious", "min-version": "1.0.0", "range": [ "1.0.0 - 1.15.0", @@ -661,6 +708,7 @@ ] }, "undici": { + "plugin-name": "undici", "min-version": "0.1.0", "range": [ "0.1.0 - 0.5.0", @@ -689,12 +737,14 @@ ] }, "when": { + "plugin-name": "when", "min-version": "3.0.0", "range": [ "3.0.0 - 3.7.8" ] }, "winston": { + "plugin-name": "winston", "min-version": "1.0.0", "range": [ "1.0.0 - 1.1.2", @@ -703,4 +753,4 @@ ] } } -} \ No newline at end of file +} diff --git a/scripts/create_matrix.js b/scripts/create_matrix.js index 39a5f0905e7..ba0b68e0495 100644 --- a/scripts/create_matrix.js +++ b/scripts/create_matrix.js @@ -1,6 +1,7 @@ const path = require('path') const fs = require('fs') const yaml = require('js-yaml') +const plugin = require('eslint-plugin-mocha') const matricesPath = path.join( __dirname, @@ -21,7 +22,7 @@ const versionsPath = path.join( 'versions.json' ) -const matricesJson = require(matricesPath) +const matricesJson = { matrices: {} } const versionsJson = require(versionsPath) const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versionsPath, 'utf-8')).matrices) @@ -29,6 +30,7 @@ const versionsNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(versi function generateMatrix () { let versionsPlugin let matrix + let pluginName for (const name of versionsNames) { // object is by plugin name @@ -39,6 +41,9 @@ function generateMatrix () { // if the plugin does not require a node version it will just have a range versionsPlugin = versionsJson.matrices[name] + pluginName = versionsJson.matrices[name]['plugin-name'] + + if (!matricesJson.matrices[pluginName]) matricesJson.matrices[pluginName] = {} if (versionsPlugin['by-node-version'] === true) { matrix = { @@ -63,12 +68,12 @@ function generateMatrix () { }] } } - matricesJson.matrices[name] = matrix + matricesJson.matrices[pluginName] = matrix } else { matrix = { range: versionsPlugin.range } - matricesJson.matrices[name] = matrix + matricesJson.matrices[pluginName] = matrix } } return matricesJson diff --git a/scripts/outdated.js b/scripts/outdated.js index f12925bbf79..0a363aea944 100644 --- a/scripts/outdated.js +++ b/scripts/outdated.js @@ -43,7 +43,6 @@ const latestsJson = require(latestsPath) const internalsNames = Array.from(new Set(getInternals().map(n => n.name))) .filter(x => typeof x === 'string' && x !== 'child_process' && !x.startsWith('node:')) -const matricesJson = require(matricesPath) const versionsJson = require(versionsPath) const pluginNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matricesPath, 'utf-8')).matrices) @@ -51,7 +50,7 @@ const pluginNames = Object.getOwnPropertyNames(yaml.load(fs.readFileSync(matrice function makeAPR (branchName) { const title = 'Fix: Update Outdated Versions' - const body = 'Checking for and updating outdated integration versions' + const body = 'Updating outdated integration versions' execSync(`gh pr create --title ${title} --body ${body} --base master --head ${branchName} `) } @@ -97,7 +96,6 @@ async function updatePlugin (name) { async function fix () { for (const name of pluginNames) { await updatePlugin(name) - // generateMatrix(name) } const result = execSync('git status').toString() From 4a71ecc04f4dff5942a5c71d3b28b16faa77432e Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Wed, 23 Oct 2024 09:53:55 -0400 Subject: [PATCH 56/58] changing plugin yml with matrices --- .../datadog-instrumentations/src/helpers/versions.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json index ba0c2c13cd5..39fd0b9dbae 100644 --- a/packages/datadog-instrumentations/src/helpers/versions.json +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -71,10 +71,10 @@ }, "bluebird": { "plugin-name": "bluebird", - "min-version": "2.0.0", + "min-version": "2.0.0=2", "range": [ - "2.0.0 - 2.11.0", - "3.0.0 - 3.7.2" + "2.0.2 - 2.11.0", + "3.0.1 - 3.7.2" ] }, "body-parser": { @@ -150,6 +150,7 @@ ] }, "@elastic/elasticsearch": { + "plugin-name": "elasticsearch", "min-version": "5.6.16", "range": [ "5.6.16 - 5.6.22", @@ -159,7 +160,6 @@ ] }, "elasticsearch": { - "plugin-name": "elasticsearch", "min-version": "10.0.0", "range": [ "10.0.0 - 10.1.3", From 759edcb66f9388f05b9c7571218869cd7c88418e Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 24 Oct 2024 09:43:36 -0400 Subject: [PATCH 57/58] changing plugin yml with matrices --- .github/workflows/plugins.yml | 28 ++++++++ .../src/helpers/versions.json | 68 +++++++++---------- 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 83b729bd1ad..b30f9c05327 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -445,6 +445,34 @@ jobs: uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 + elasticsearch: + needs: + - versions + strategy: + matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.elasticsearch}} + runs-on: ubuntu-latest + services: + elasticsearch: + image: elasticsearch:7.17.22 + env: + discovery.type: single-node + ports: + - 9200:9200 + env: + PLUGINS: elasticsearch + SERVICES: elasticsearch + PACKAGE_VERSION_RANGE: ${{ matrix.range }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/testagent/start + - uses: ./.github/actions/node/setup + - uses: ./.github/actions/install + - uses: ./.github/actions/node/latest + - run: yarn test:plugins:ci + - if: always() + uses: ./.github/actions/testagent/logs + - uses: codecov/codecov-action@v3 + express: needs: - versions diff --git a/packages/datadog-instrumentations/src/helpers/versions.json b/packages/datadog-instrumentations/src/helpers/versions.json index 39fd0b9dbae..a36ab380e95 100644 --- a/packages/datadog-instrumentations/src/helpers/versions.json +++ b/packages/datadog-instrumentations/src/helpers/versions.json @@ -9,14 +9,12 @@ "2.4.2 - 2.6.12", "3.0.0 - 3.2.7", "3.0.7 - 3.2.7", - "4.0.0 - 4.4.2" + "4.0.0 - 4.4.3" ], "18": [ - "4.4.1 - 4.4.2" + "4.4.1 - 4.4.3" ], - "strict": [ - - ] + "strict": [] } }, "aerospike": { @@ -26,14 +24,14 @@ "node-versions": { "16": [ "4.0.0 - 4.0.5" - ], "18": [ - "5.2.0 - 5.7.0" + "5.2.0 - 5.12.1" ], "20": [ - "5.12.1" - ]} + "5.12.1 - 5.12.1" + ] + } }, "amqp10": { "plugin-name": "amqp10", @@ -53,7 +51,7 @@ "min-version": "0.1.0", "range": [ "0.1.0 - 0.54.1", - "2.0.0 - 2.9.1" + "2.0.0 - 2.9.3" ] }, "@aws-sdk/smithy-client": { @@ -109,13 +107,13 @@ "cookie-parser": { "min-version": "1.0.0", "range": [ - "1.0.0 - 1.4.6" + "1.0.0 - 1.4.7" ] }, "cookie": { "min-version": "0.0.0", "range": [ - "0.0.0 - 0.6.0" + "0.0.0 - 0.7.2" ] }, "@cucumber/cucumber": { @@ -146,7 +144,7 @@ "10.0.0 - 10.11.0", "11.0.0 - 11.2.0", "12.0.0 - 12.17.4", - "13.0.0 - 13.14.2" + "13.0.0 - 13.15.0" ] }, "@elastic/elasticsearch": { @@ -156,7 +154,7 @@ "5.6.16 - 5.6.22", "6.7.0 - 6.8.8", "7.0.0 - 7.17.14", - "8.0.0 - 8.14.1" + "8.0.0 - 8.15.1" ] }, "elasticsearch": { @@ -182,7 +180,7 @@ "plugin-name": "express", "min-version": "4.0.0", "range": [ - "4.0.0 - 4.21.0" + "4.0.0 - 4.21.1" ] }, "fastify": { @@ -207,7 +205,7 @@ "6.0.0 - 6.4.0", "7.0.0 - 7.7.0", "8.0.0 - 8.2.2", - "9.0.0 - 9.0.1" + "9.0.0 - 9.1.0" ] }, "generic-pool": { @@ -225,14 +223,14 @@ "1.2.0 - 1.7.3", "2.0.0 - 2.19.4", "3.0.0 - 3.7.5", - "4.0.0 - 4.7.2" + "4.0.0 - 4.8.0" ] }, "@graphql-tools/executor": { "min-version": "0.0.14", "range": [ "0.0.14 - 0.0.20", - "1.0.0 - 1.3.1" + "1.0.0 - 1.3.2" ] }, "graphql": { @@ -249,7 +247,7 @@ "plugin-name": "grpc", "min-version": "1.0.3", "range": [ - "1.0.3 - 1.11.3" + "1.0.3 - 1.12.2" ] }, "@hapi/hapi": { @@ -410,7 +408,7 @@ "3.3.0 - 3.7.4", "4.0.0 - 4.17.2", "5.0.0 - 5.9.2", - "6.0.0 - 6.9.0" + "6.0.0 - 6.10.0" ] }, "mongoose": { @@ -421,7 +419,7 @@ "5.0.0 - 5.13.22", "6.0.0 - 6.13.3", "7.0.0 - 7.8.2", - "8.0.0 - 8.6.3" + "8.0.0 - 8.7.2" ] }, "mquery": { @@ -460,7 +458,7 @@ "11.0.0 - 11.1.4", "12.0.0 - 12.3.4", "13.0.0 - 13.5.7", - "14.0.0 - 14.2.13" + "14.0.0 - 14.2.16" ] }, "openai": { @@ -468,7 +466,7 @@ "min-version": "3.0.0", "range": [ "3.0.0 - 3.3.0", - "4.0.0 - 4.64.0" + "4.0.0 - 4.68.2" ] }, "@opensearch-project/opensearch": { @@ -530,7 +528,7 @@ "6.0.0 - 6.14.0", "7.0.0 - 7.11.0", "8.0.0 - 8.21.0", - "9.0.0 - 9.4.0" + "9.0.0 - 9.5.0" ] }, "pino-pretty": { @@ -546,21 +544,21 @@ "8.0.0 - 8.1.0", "9.0.0 - 9.4.1", "10.0.0 - 10.3.1", - "11.0.0 - 11.2.2" + "11.0.0 - 11.3.0" ] }, "@playwright/test": { "min-version": "0.0.0", "range": [ "0.0.0 - 0.1111.0", - "1.12.0 - 1.47.2" + "1.12.0 - 1.48.1" ] }, "playwright": { "min-version": "0.0.0", "range": [ "0.0.0 - 0.18.0", - "1.0.0 - 1.47.2" + "1.0.0 - 1.48.1" ] }, "promise-js": { @@ -663,13 +661,13 @@ "sequelize": { "min-version": "0.0.0", "range": [ - "0.0.0 - 0.4.3", + "0.0.0 - 0.2.6", "1.0.0 - 1.7.11", "2.0.0 - 2.1.3", "3.0.0 - 3.35.1", "4.0.0 - 4.44.4", "5.1.0 - 5.22.5", - "6.1.0 - 6.37.3" + "6.1.0 - 6.37.4" ] }, "sharedb": { @@ -680,7 +678,7 @@ "2.0.0 - 2.2.6", "3.0.0 - 3.3.2", "4.0.0 - 4.1.5", - "5.0.0 - 5.0.4" + "5.0.0 - 5.1.0" ] }, "tedious": { @@ -717,7 +715,7 @@ "3.0.0 - 3.3.6", "4.0.0 - 4.16.0", "5.0.0 - 5.28.4", - "6.0.0 - 6.19.8" + "6.0.0 - 6.20.1" ] }, "vitest": { @@ -725,7 +723,7 @@ "range": [ "0.0.0 - 0.34.6", "1.0.0 - 1.6.0", - "2.0.0 - 2.1.1" + "2.0.0 - 2.1.3" ] }, "@vitest/runner": { @@ -733,7 +731,7 @@ "range": [ "0.28.0 - 0.34.7", "1.0.0 - 1.6.0", - "2.0.0 - 2.1.1" + "2.0.0 - 2.1.3" ] }, "when": { @@ -749,8 +747,8 @@ "range": [ "1.0.0 - 1.1.2", "2.0.0 - 2.4.7", - "3.0.0 - 3.14.2" + "3.0.0 - 3.15.0" ] } } -} +} \ No newline at end of file From 4b6a1335c0a1b9819f9bc009b927e148077007ed Mon Sep 17 00:00:00 2001 From: Crystal Magloire Date: Thu, 24 Oct 2024 14:07:11 -0400 Subject: [PATCH 58/58] changing plugin yml --- .github/workflows/plugins.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b30f9c05327..83b729bd1ad 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -445,34 +445,6 @@ jobs: uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 - elasticsearch: - needs: - - versions - strategy: - matrix: ${{fromJson(needs.versions.outputs.matrices).matrices.elasticsearch}} - runs-on: ubuntu-latest - services: - elasticsearch: - image: elasticsearch:7.17.22 - env: - discovery.type: single-node - ports: - - 9200:9200 - env: - PLUGINS: elasticsearch - SERVICES: elasticsearch - PACKAGE_VERSION_RANGE: ${{ matrix.range }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/testagent/start - - uses: ./.github/actions/node/setup - - uses: ./.github/actions/install - - uses: ./.github/actions/node/latest - - run: yarn test:plugins:ci - - if: always() - uses: ./.github/actions/testagent/logs - - uses: codecov/codecov-action@v3 - express: needs: - versions