From a9149f61e38677977c73002d09e05d5fe29f7e4c Mon Sep 17 00:00:00 2001 From: Bryan English Date: Thu, 29 Aug 2024 16:09:38 -0400 Subject: [PATCH] fix up aerospike --- .github/workflows/plugins.yml | 63 +++---------------- .../datadog-instrumentations/src/aerospike.js | 9 +-- 2 files changed, 13 insertions(+), 59 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index e5b0196fb20..77d288fb6a2 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -15,58 +15,23 @@ concurrency: jobs: - aerospike-node-16: + aerospike: strategy: matrix: node-version: [16] range: ['>=4.0.0 <5.2.0'] - runs-on: ubuntu-latest - services: - aerospike: - image: aerospike:ce-5.7.0.15 - ports: - - "127.0.0.1:3000-3002:3000-3002" - env: - PLUGINS: aerospike - SERVICES: aerospike - PACKAGE_VERSION_RANGE: '${{ matrix.range }}' - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/testagent/start - - uses: ./.github/actions/node/setup - - id: pkg - run: | - content=`cat ./package.json | tr '\n' ' '` - echo "json=$content" >> $GITHUB_OUTPUT - - id: extract - run: | - version="${{fromJson(steps.pkg.outputs.json).version}}" - majorVersion=$(echo "$version" | cut -d '.' -f 1) - echo "Major Version: $majorVersion" - echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV - - uses: ./.github/actions/node/oldest - - name: Install dependencies - if: env.MAJOR_VERSION == '4' - uses: ./.github/actions/install - - name: Run tests - if: env.MAJOR_VERSION == '4' - run: yarn test:plugins:ci - - if: always() - uses: ./.github/actions/testagent/logs - - uses: codecov/codecov-action@v3 - - aerospike-node-18-20: - strategy: - matrix: - node-version: [18] - range: ['5.2.0 - 5.7.0'] + aerospike-image: [ce-5.7.0.15] include: + - node-version: 18 + range: '5.2.0 - 5.7.0' + aerospike-image: ce-6.4.0.3 - node-version: 20 range: '>=5.8.0' + aerospike-image: ce-6.4.0.3 runs-on: ubuntu-latest services: aerospike: - image: aerospike:ce-6.4.0.3 + image: aerospike:${{ matrix.aerospike-image }} ports: - "127.0.0.1:3000-3002:3000-3002" env: @@ -77,25 +42,13 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/testagent/start - uses: ./.github/actions/node/setup - - id: pkg - run: | - content=`cat ./package.json | tr '\n' ' '` - echo "json=$content" >> $GITHUB_OUTPUT - - id: extract - run: | - version="${{fromJson(steps.pkg.outputs.json).version}}" - majorVersion=$(echo "$version" | cut -d '.' -f 1) - echo "Major Version: $majorVersion" - echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Install dependencies - if: env.MAJOR_VERSION == '5' uses: ./.github/actions/install - name: Run tests - if: env.MAJOR_VERSION == '5' - run: yarn test:plugins:ci + run: yarn --ignore-engines test:plugins:ci - if: always() uses: ./.github/actions/testagent/logs - uses: codecov/codecov-action@v3 diff --git a/packages/datadog-instrumentations/src/aerospike.js b/packages/datadog-instrumentations/src/aerospike.js index 99c9d768b59..7f4e9c34df2 100644 --- a/packages/datadog-instrumentations/src/aerospike.js +++ b/packages/datadog-instrumentations/src/aerospike.js @@ -4,6 +4,7 @@ const { addHook } = require('./helpers/instrument') const shimmer = require('../../datadog-shimmer') +const { NODE_MAJOR } = require('../../../version') const tracingChannel = require('dc-polyfill').tracingChannel const ch = tracingChannel('apm:aerospike:command') @@ -38,12 +39,12 @@ function wrapProcess (process) { } const versions = (() => { - switch (process.versions.node.split('.')[0]) { - case '16': + switch (NODE_MAJOR) { + case 16: return ['>=4 <5.2.0'] - case '18': + case 18: return ['5.2.0 - 5.7.0'] - case '20': + case 20: return ['>=5.8.0'] default: return []