Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add min version in TAV matrix #3531

Merged
merged 19 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions .ci/tav.json
david-luna marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
{
"// todo": "We want versions=['20','19','18','16','14','12','10','8'], but versions*modules needs to be <256 for the GH Actions jobs limit",
"versions": [ "20", "18", "16", "14", "12", "10", "8" ],
"versions": [ 20, 19, 18, 16, 14 ],
david-luna marked this conversation as resolved.
Show resolved Hide resolved
"modules": [
david-luna marked this conversation as resolved.
Show resolved Hide resolved
"@apollo/server",
"@aws-sdk/client-s3",
"@elastic/elasticsearch",
"@hapi/hapi",
"@opentelemetry/api",
"@opentelemetry/sdk-metrics",
"apollo-server-express",
"aws-sdk",
"cassandra-driver",
"elasticsearch",
"express",
"express-queue",
"fastify",
"finalhandler",
"generic-pool",
"graphql",
"ioredis",
"knex",
"memcached",
"mongodb",
"mongodb-core",
"mysql",
"mysql2",
"next",
"pg",
"redis",
"restify",
"tedious",
"undici",
"ws",
"@koa/router,koa-router",
"handlebars,pug",
"bluebird,got"
{"name": "@apollo/server", "minVersion": 18 },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: to run less tests we add minVersion to 18. This shall be updated with the proper versions if the PR is okay to merge

{"name": "@aws-sdk/client-s3", "minVersion": 18 },
{"name": "@elastic/elasticsearch", "minVersion": 18 },
{"name": "@hapi/hapi", "minVersion": 18 },
{"name": "@opentelemetry/api", "minVersion": 18 },
{"name": "@opentelemetry/sdk-metrics", "minVersion": 18 },
{"name": "apollo-server-express", "minVersion": 18 },
{"name": "aws-sdk", "minVersion": 18 },
{"name": "cassandra-driver", "minVersion": 18 },
{"name": "elasticsearch", "minVersion": 18 },
{"name": "express", "minVersion": 18 },
{"name": "express-queue", "minVersion": 18 },
{"name": "fastify", "minVersion": 18 },
{"name": "finalhandler", "minVersion": 18 },
{"name": "generic-pool", "minVersion": 18 },
{"name": "graphql", "minVersion": 18 },
{"name": "ioredis", "minVersion": 18 },
{"name": "knex", "minVersion": 18 },
{"name": "memcached", "minVersion": 18 },
{"name": "mongodb", "minVersion": 18 },
{"name": "mongodb-core", "minVersion": 18 },
{"name": "mysql", "minVersion": 18 },
{"name": "mysql2", "minVersion": 18 },
{"name": "next", "minVersion": 18 },
{"name": "pg", "minVersion": 18 },
{"name": "redis", "minVersion": 18 },
{"name": "restify", "minVersion": 18 },
{"name": "tedious", "minVersion": 18 },
{"name": "undici", "minVersion": 18 },
{"name": "ws", "minVersion": 18 },
{"name": "@koa/router,koa-router", "minVersion": 18 },
{"name": "handlebars,pug", "minVersion": 18 },
{"name": "bluebird,got", "minVersion": 18 }
]
}
29 changes: 20 additions & 9 deletions .github/workflows/tav-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
permissions:
pull-requests: write
outputs:
versions: ${{ steps.transform.outputs.versions }}
modules: ${{ steps.transform.outputs.modules }}
permutations: ${{ steps.transform.outputs.permutations }}
count: ${{ steps.transform.outputs.count }}
steps:
- name: Is comment allowed?
uses: actions/github-script@v6
Expand Down Expand Up @@ -72,15 +72,26 @@ jobs:
}
if (match[1]) {
if (match[1] !== 'all') {
modules = match[1].split(',')
modules = match[1].split(',').map((name) => modules.find((m) => m.name === name))
}
}
if (match[3]) {
versions = match[3].split(',')
versions = match[3].split(',').map(Number)
}
}
core.setOutput('modules', modules)
core.setOutput('versions', versions)

const permutations = []
for (const mod of modules) {
for (const nv of versions) {
if (mod.minVersion && nv >= mod.minVersion) {
permutations.push(`${mod.name} ${nv}`)
} else if (typeof mod === 'string') {
david-luna marked this conversation as resolved.
Show resolved Hide resolved
permutations.push(`${mod} ${nv}`)
}
}
}
core.setOutput('permutations', permutations)
core.setOutput('count', [permutations.length])
david-luna marked this conversation as resolved.
Show resolved Hide resolved

test-tav:
needs: command-validation
Expand All @@ -90,14 +101,14 @@ jobs:
max-parallel: 15
fail-fast: false
matrix:
node: ${{ fromJSON(needs.command-validation.outputs.versions) }}
module: ${{ fromJSON(needs.command-validation.outputs.modules) }}
moduleAndNode: ${{ fromJSON(needs.command-validation.outputs.permutations) }}
count: ${{ fromJSON(needs.command-validation.outputs.count) }}
steps:

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- run: .ci/scripts/test.sh -b "release" -t "${{ matrix.module }}" "${{ matrix.node }}"
- run: .ci/scripts/test.sh -b "release" -t ${{ matrix.moduleAndNode }}
env:
ELASTIC_APM_CONTEXT_MANAGER: ''
9 changes: 0 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@ jobs:
- '16.0'
- '14'
- '14.0'
- '12'
david-luna marked this conversation as resolved.
Show resolved Hide resolved
- '12.0'
- '10'
- '10.0'
- '8'
- '8.6'
contextManager: [ 'patch', '' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -152,8 +145,6 @@ jobs:
- run: npm ls --all || true
- name: npm test
run: npm test
env:
ELASTIC_APM_CONTEXT_MANAGER: ${{ matrix.contextManager }}
- uses: inception-health/otel-upload-test-artifact-action@v1
if: always()
continue-on-error: true
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG4.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[[release-notes-4.x]]
=== Node.js Agent version 1.x

==== Unreleased

[float]
===== Breaking changes

* Set the new minimum supported Node.js to version 14.
Users of earlier Node.js versions can use elastic-apm-node v3.x, which
supports back to Node.js v8.6.

[float]
===== Features

[float]
===== Bug fixes

[float]
===== Chores


[[release-notes-3.x]]
=== Node.js Agent version 3.x

XXX This CHANGELOG4 file will be merged into CHANGELOG.asciidoc before merging to main.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "elastic-apm-node",
"version": "3.48.0",
"version": "4.0.0-dev",
"private": true,
"description": "The official Elastic APM agent for Node.js",
"main": "index.js",
"types": "index.d.ts",
Expand Down Expand Up @@ -49,7 +50,7 @@
"url": "git://github.com/elastic/apm-agent-nodejs.git"
},
"engines": {
"node": ">=8.6.0"
"node": ">=14"
},
"keywords": [
"opbeat",
Expand Down
Loading