From 4808d3c17a8a43316b583a38a48e8df0eaf51474 Mon Sep 17 00:00:00 2001 From: David Luna Date: Thu, 5 Sep 2024 15:38:29 +0200 Subject: [PATCH 1/2] feat: add support for v19 --- CHANGELOG.asciidoc | 2 ++ lib/instrumentation/modules/tedious.js | 13 ++++++++++++- package-lock.json | 16 ++++++++-------- package.json | 2 +- test/instrumentation/modules/tedious.test.js | 4 +++- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b149852a95f..2a94a38652d 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -45,6 +45,8 @@ See the <> guide. AWS ECS Fargate, where the pattern has been observed to sometimes differ from the documented pattern. (https://github.com/elastic/apm/issues/888[APM spec issue #888]) +- Add support for `tedious` v19. ({issues}4218[#4218]) + [float] ===== Bug fixes diff --git a/lib/instrumentation/modules/tedious.js b/lib/instrumentation/modules/tedious.js index 8fc23153e88..a5f6a46958f 100644 --- a/lib/instrumentation/modules/tedious.js +++ b/lib/instrumentation/modules/tedious.js @@ -14,7 +14,18 @@ var { getDBDestination } = require('../context'); module.exports = function (tedious, agent, { version, enabled }) { if (!enabled) return tedious; - if (version === '4.0.0' || !semver.satisfies(version, '>=1.9.0 <19')) { + if ( + semver.satisfies(version, '>=19') && + !semver.satisfies(process.version, '>=18.17') + ) { + agent.logger.debug( + 'tedious version %s not supported for node %s - aborting...', + version, + process.version, + ); + return tedious; + } + if (version === '4.0.0' || !semver.satisfies(version, '>=1.9.0 <20')) { agent.logger.debug( 'tedious version %s not supported - aborting...', version, diff --git a/package-lock.json b/package-lock.json index df85ff3faa9..ce43a21efc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -121,7 +121,7 @@ "restify": "^11.0.0", "rimraf": "^3.0.2", "tape": "^5.0.0", - "tedious": "^18.1.0", + "tedious": "^19.0.0", "test-all-versions": "^6.1.0", "thunky": "^1.1.0", "tree-kill": "^1.2.2", @@ -15370,9 +15370,9 @@ } }, "node_modules/tedious": { - "version": "18.6.2", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-18.6.2.tgz", - "integrity": "sha512-g7jC56o3MzLkE3lHkaFe2ZdOVFBahq5bsB60/M4NYUbocw/MCrS89IOEQUFr+ba6pb8ZHczZ/VqCyYeYq0xBAg==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-19.0.0.tgz", + "integrity": "sha512-nmxNBAT72mMVCIYp0Ts0Zzd5+LBQjoXlqigCrIjSo2OERSi04vr3EHq3qJxv/zgrSkg7si03SoIIfekTAadA7w==", "dev": true, "dependencies": { "@azure/core-auth": "^1.7.2", @@ -15387,7 +15387,7 @@ "sprintf-js": "^1.1.3" }, "engines": { - "node": ">=18" + "node": ">=18.17" } }, "node_modules/tedious/node_modules/iconv-lite": { @@ -28248,9 +28248,9 @@ "dev": true }, "tedious": { - "version": "18.6.2", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-18.6.2.tgz", - "integrity": "sha512-g7jC56o3MzLkE3lHkaFe2ZdOVFBahq5bsB60/M4NYUbocw/MCrS89IOEQUFr+ba6pb8ZHczZ/VqCyYeYq0xBAg==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-19.0.0.tgz", + "integrity": "sha512-nmxNBAT72mMVCIYp0Ts0Zzd5+LBQjoXlqigCrIjSo2OERSi04vr3EHq3qJxv/zgrSkg7si03SoIIfekTAadA7w==", "dev": true, "requires": { "@azure/core-auth": "^1.7.2", diff --git a/package.json b/package.json index c7ce7441e70..117382893db 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,7 @@ "restify": "^11.0.0", "rimraf": "^3.0.2", "tape": "^5.0.0", - "tedious": "^18.1.0", + "tedious": "^19.0.0", "test-all-versions": "^6.1.0", "thunky": "^1.1.0", "tree-kill": "^1.2.2", diff --git a/test/instrumentation/modules/tedious.test.js b/test/instrumentation/modules/tedious.test.js index 174d0ba838d..6f3499076cd 100644 --- a/test/instrumentation/modules/tedious.test.js +++ b/test/instrumentation/modules/tedious.test.js @@ -28,7 +28,9 @@ if ( // tedious@11 and later depend on @azure/identity v1 or v2. As of // @azure/core-rest-pipeline@1.15.0 (a dep of @azure/identity), support for // Node.js <16 has been broken. - (semver.gte(tediousVer, '11.0.0') && semver.lt(process.version, '16.0.0')) + (semver.gte(tediousVer, '11.0.0') && semver.lt(process.version, '16.0.0')) || + // tedious@19 drops support for Node.js Date: Fri, 6 Sep 2024 12:04:38 +0200 Subject: [PATCH 2/2] chore: upadte .tav.yml --- .tav.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.tav.yml b/.tav.yml index 15f63f7446b..8446d0c7276 100644 --- a/.tav.yml +++ b/.tav.yml @@ -346,6 +346,12 @@ tedious: mode: latest-majors node: '18.x || >=20' commands: node test/instrumentation/modules/tedious.test.js + # Tedious v19 advertise a min-supported Node.js version of 18.17.0. + - versions: + include: '>=19 <20' + mode: latest-majors + node: '>=18.17' + commands: node test/instrumentation/modules/tedious.test.js cassandra-driver: # 3.1.0 is broken