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

v5.15.0 #4374

Merged
merged 48 commits into from
Jun 5, 2024
Merged

v5.15.0 #4374

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8511979
[ci-visibility] Fix EFD with jest and jsdom (#4323)
juan-fernandez May 20, 2024
2439b33
[ci-visibility] Fix selenium when run outside of a supported test fra…
juan-fernandez May 20, 2024
2c35625
amqplib: node>=v22.2.0 incompat amqplib<=v0.5.2 (#4328)
tlhunter May 20, 2024
54eb3c1
docs: direct readers to the correct doc site (#4324)
tlhunter May 20, 2024
3939dff
docs: mark v3 of the tracer as EoL in readme (#4317)
tlhunter May 20, 2024
4088b09
quick readme update for ESM (#4331)
bengl May 20, 2024
f69c35b
updating next plugin to handle version change causing failure in test…
crysmags May 21, 2024
e06ce3a
Update lib-injection docker image tags (#4338)
andrewlock May 22, 2024
128ad85
OnBoarding tests: fix gitlab pipeline (#4339)
robertomonteromiguel May 22, 2024
b44cbba
Be more restrictive about tags we search for (#4341)
andrewlock May 22, 2024
0504839
[ci-visibility] Add back calculation of untested files when calculati…
juan-fernandez May 22, 2024
b7d39d2
add a job that passes only if all others pass (#4340)
bengl May 22, 2024
29bfaf1
Fix patching behavior for require-in-the-middle (#4298)
duncanpharvey May 22, 2024
ea6afc0
make the all-green job only run on PRs (#4342)
bengl May 22, 2024
60c45c4
[ci-visibility] Support mocha parallel mode (#4314)
juan-fernandez May 23, 2024
870a246
Fix `describe.only` in `ci-visibility.spec.js` (#4345)
juan-fernandez May 23, 2024
aa147de
Add a new initializer file (#4334)
bengl May 23, 2024
ee8766f
Add OCI package building (#4344)
randomanderson May 23, 2024
8189ed0
Remove outdated polyfills (#4009)
simon-id May 24, 2024
d5c53e3
feat(openai): support streamed responses for completions and chat com…
sabrenner May 24, 2024
f5893cd
[ci-visibility] Remove usage of .asyncResource in mocha plugin (#4348)
juan-fernandez May 27, 2024
bbb17d5
Send meta_struct properties as byte array (#4349)
uurien May 28, 2024
c3ff492
[ci-visibility] Playwright: Do not use _allTests property (#4353)
juan-fernandez May 28, 2024
0744488
Update native-appsec module to 8.0.1 (#4347)
CarlesDD May 28, 2024
2aee20d
docs: specify getRumData() purpose and current shortcomings (#4350)
tlhunter May 28, 2024
87e8245
update lockfile (#4357)
simon-id May 29, 2024
1811528
bump .eslintrc.json ecmaVersion to 2021 (#4356)
simon-id May 29, 2024
2d7cfc8
fix(openai): finish span on error (#4352)
sabrenner May 29, 2024
802ab6f
exclude devflow from all-green (#4358)
bengl May 29, 2024
1d2061e
fix(oci): Use same version as deb/rpms (#4354)
BaptisteFoy May 29, 2024
be36e4f
split system tests in two, for speed (#4359)
bengl May 30, 2024
8eda7c8
PROF-9791: Use heuristics to start the profiler when requested throug…
szegedi May 30, 2024
0b6e2f8
add tracer flare (#4351)
rochdev May 30, 2024
b5f91fb
debug: warn if loaded with conflicting packages (#4332)
tlhunter May 30, 2024
be21212
parallelize next plugin test (#4343)
bengl May 30, 2024
8683665
fix(openai): multiple choices on streamed requests are tagged properl…
sabrenner May 30, 2024
4263dc5
add remote config support for sampling rules (#4242)
ida613 May 31, 2024
8ba297a
user dockerhub image for elasticsearch instead of elastic's registry …
bengl May 31, 2024
a2b5f35
refactor system tests yaml to parallelize (#4362)
bengl May 31, 2024
a610ee2
retry get-port (#4367)
bengl May 31, 2024
83e3cec
Add Support For Mapping OTEL_LOG_LEVEL='debug' (#4363)
khanayan123 Jun 3, 2024
9246beb
Exploit prevention monitoring ssrf (#4361)
uurien Jun 4, 2024
aff17f5
fix next node 18 flaky test by removing cache (#4376)
crysmags Jun 4, 2024
56121ca
feat(openai): support token metrics for completions and chat completi…
sabrenner Jun 4, 2024
05eeb70
implement w3c phase 3 (#4325)
khanayan123 Jun 4, 2024
48a19a8
make initialize.mjs backportable for node 16 (#4377)
bengl Jun 5, 2024
c91f4db
PROF-9791: Recognize DD_PROFILING_ENABLED=auto as an alternative for …
szegedi Jun 5, 2024
8e202aa
v5.15.0
juan-fernandez Jun 5, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parserOptions": {
"ecmaVersion": 2020
"ecmaVersion": 2021
},
"extends": [
"eslint:recommended",
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/all-green.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: All Green
on:
pull_request:

jobs:

all-green:
runs-on: ubuntu-latest
permissions:
checks: read
contents: read
steps:
- uses: wechuli/allcheckspassed@v1
with:
retries: 20 # once per minute, some checks take up to 15 min
checks_exclude: devflow.*
13 changes: 9 additions & 4 deletions .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,22 @@ jobs:
- uses: codecov/codecov-action@v3

next:
strategy:
matrix:
version:
- 18
- latest
runs-on: ubuntu-latest
env:
PLUGINS: next
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ matrix.version }}
- run: yarn install
- uses: ./.github/actions/node/oldest
- run: yarn test:appsec:plugins:ci
- uses: ./.github/actions/node/latest
- run: yarn test:appsec:plugins:ci
- if: always()
uses: ./.github/actions/testagent/logs
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ jobs:
runs-on: ubuntu-latest
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.14.0
image: elasticsearch:7.14.0
env:
discovery.type: single-node
ports:
Expand Down Expand Up @@ -935,6 +935,11 @@ jobs:

# TODO: fix performance issues and test more Node versions
next:
strategy:
matrix:
version:
- 18
- latest
runs-on: ubuntu-latest
env:
PLUGINS: next
Expand All @@ -943,9 +948,6 @@ jobs:
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- run: yarn install
- uses: ./.github/actions/node/oldest
- run: yarn test:plugins:ci
- uses: ./.github/actions/node/latest
- run: yarn test:plugins:ci
- if: always()
uses: ./.github/actions/testagent/logs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ jobs:
- run: yarn install
- run: yarn type:test
- run: yarn type:doc

44 changes: 25 additions & 19 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,32 @@ on:
- cron: '00 04 * * 2-6'

jobs:
get-essential-scenarios:
runs-on: ubuntu-latest
outputs:
scenario: ${{ steps.parse-yml.outputs.scenario }}
steps:
- name: Checkout system tests
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Get Essential Scenarios
id: parse-yml
run: yq -o tsv .TRACER_ESSENTIAL_SCENARIOS ./scenario_groups.yml | xargs node -p "x=process.argv;x.shift();x.push('CROSSED_TRACING_LIBRARIES');'scenario='+JSON.stringify(x)" >> $GITHUB_OUTPUT


system-tests:
runs-on: ubuntu-latest
needs:
- get-essential-scenarios
strategy:
matrix:
include:
- weblog-variant: express4
- weblog-variant: express4-typescript
- weblog-variant: nextjs
weblog-variant:
- express4
- express4-typescript
- nextjs
scenario: ${{fromJson(needs.get-essential-scenarios.outputs.scenario)}}

env:
TEST_LIBRARY: nodejs
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
Expand All @@ -29,39 +47,27 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Checkout dd-trace-js
uses: actions/checkout@v4
with:
path: 'binaries/dd-trace-js'

- name: Build weblog
run: ./build.sh -i weblog

- name: Build runner
uses: ./.github/actions/install_runner

- name: Build agent
id: build-agent
run: ./build.sh -i agent

- name: Run
run: ./run.sh TRACER_ESSENTIAL_SCENARIOS

- name: Run Cross Tracer Propagation Tests
# run if builds passed (allows these tests to still run in case the previous Run step failed)
if: steps.build-agent.outcome == 'success'
run: ./run.sh CROSSED_TRACING_LIBRARIES

- name: Run scenario ${{ matrix.scenario }}
run: ./run.sh ${{ matrix.scenario }}
- name: Compress artifact
if: ${{ always() }}
run: tar -czvf artifact.tar.gz $(ls | grep logs)

- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: logs_express-poc
name: logs_${{ matrix.weblog-variant }}-${{ matrix.scenario }}
path: artifact.tar.gz

parametric:
Expand Down
68 changes: 48 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,35 @@ package-arm:
- ../.gitlab/build-deb-rpm.sh
- find . -iregex '.*\.\(deb\|rpm\)' -printf '%f\0' | xargs -0 dd-pkg lint

package-oci:
extends: .package-oci
stage: package
script:
- ../.gitlab/build_oci_package.sh

oci-internal-publish:
extends: .oci-internal-publish
stage: package
needs: [ package-oci ]
rules:
- when: on_success
variables:
FLAVOR: datadog-apm-library-js

oci-internal-test-ecr-publish:
stage: package
needs: [ oci-internal-publish ]
rules:
- when: on_success
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-apm-library-js:pipeline-${CI_PIPELINE_ID}-1
IMG_DESTINATIONS: apm-library-js-package:pipeline-${CI_PIPELINE_ID}
IMG_REGISTRIES: agent-qa

.release-package:
stage: deploy
variables:
Expand All @@ -107,40 +136,39 @@ deploy_to_reliability_env:
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA

deploy_to_docker_registries:

generate-lib-init-tag-values:
tags: ["arch:amd64"]
image: registry.ddbuild.io/ci/auto_inject/gitlab:current
stage: deploy
needs: []
rules:
- if: '$CI_COMMIT_TAG =~ /^v.*/ || $CI_COMMIT_TAG == "dev"'
# We don't tag prerelease versions
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
when: on_success
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-js/dd-lib-js-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-js-init:$CI_COMMIT_TAG
IMG_SIGNING: "false"
RETRY_COUNT: 5
RETRY_DELAY: 300
IMG_DESTINATION_BASE: dd-lib-js-init
script:
- ./.gitlab/build-lib-init.sh
artifacts:
reports:
dotenv: build.env

deploy_latest_to_docker_registries:
deploy-lib-init-trigger:
stage: deploy
needs: []
rules:
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: on_success
- when: manual
allow_failure: true
# needs the version from the generate-tag-values job
needs:
- job: generate-lib-init-tag-values
artifacts: true
trigger:
# project: DataDog/dd-trace-dotnet-gitlab-test # can be used for testing
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-js/dd-lib-js-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-js-init:latest
IMG_DESTINATIONS: $IMG_DESTINATIONS
IMG_SIGNING: "false"
RETRY_COUNT: 5
RETRY_DELAY: 300
116 changes: 116 additions & 0 deletions .gitlab/build-lib-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash

set -e

# Safety checks to make sure we have required values
if [ -z "$CI_COMMIT_TAG" ]; then
echo "Error: CI_COMMIT_TAG was not provided"
exit 1
fi

if [ -z "$CI_COMMIT_SHA" ]; then
echo "Error: CI_COMMIT_SHA was not provided"
exit 1
fi

if [ -z "$IMG_DESTINATION_BASE" ]; then
echo "Error: IMG_DESTINATION_BASE. This should be set to the destination docker image, excluding the tag name, e.g. dd-lib-dotnet-init"
exit 1
fi

# If this is a pre-release release, we don't publish
if echo "$CI_COMMIT_TAG" | grep -q "-" > /dev/null; then
echo "Error: This is a pre-release version, should not publish images: $CI_COMMIT_TAG"
exit 1
fi

# Calculate the tags we use for floating major and minor versions
MAJOR_MINOR_VERSION="$(sed -nE 's/^(v[0-9]+\.[0-9]+)\.[0-9]+$/\1/p' <<< ${CI_COMMIT_TAG})"
MAJOR_VERSION="$(sed -nE 's/^(v[0-9]+)\.[0-9]+\.[0-9]+$/\1/p' <<< ${CI_COMMIT_TAG})"

# Make sure we have all the tags
git fetch --tags

# We need to determine whether this is is the latest tag and whether it's the latest major or not
# So we fetch all tags and sort them to find both the latest, and the latest in this major.
# 'sort' technically gets prerelease versions in the wrong order here, but we explicitly
# exclude them anyway, as they're ignored for the purposes of determining the 'latest' tags.
LATEST_TAG="$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r | head -n 1)"
LATEST_MAJOR_TAG="$(git tag -l "$MAJOR_VERSION.*" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r | head -n 1)"
echo "This tag: $CI_COMMIT_TAG"
echo "Latest repository tag: $LATEST_TAG"
echo "Latest repository tag for this major: $LATEST_MAJOR_TAG"
echo "---------"

# GNU sort -C (silent) reports via exit code whether the data is already in sorted order
# We use this to check whether the current tag is greater than (or equal to) the latest tag
if printf '%s\n' "$LATEST_TAG" "$CI_COMMIT_TAG" | sort -C -V; then
# The current tag is the latest in the repository
IS_LATEST_TAG=1
else
IS_LATEST_TAG=0
fi

if printf '%s\n' "$LATEST_MAJOR_TAG" "$CI_COMMIT_TAG" | sort -C -V; then
# The current tag is the latest for this major version in the repository
IS_LATEST_MAJOR_TAG=1
else
IS_LATEST_MAJOR_TAG=0
fi

# print everything for debugging purposes
echo "Calculated values:"
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}"
echo "MAJOR_VERSION=${MAJOR_VERSION}"
echo "IS_LATEST_TAG=${IS_LATEST_TAG}"
echo "IS_LATEST_MAJOR_TAG=${IS_LATEST_MAJOR_TAG}"
echo "---------"

# Final check that everything is ok
# We should have a major_minor version
if [ -z "$MAJOR_MINOR_VERSION" ]; then
echo "Error: Could not determine major_minor version for stable release, this should not happen"
exit 1
fi

# if this is a latest major tag, we should have a major version
if [ "$IS_LATEST_MAJOR_TAG" -eq 1 ] && [ -z "$MAJOR_VERSION" ]; then
echo "Error: Could not determine major version for latest major release, this should not happen"
exit 1
fi

# Generate the final variables, and save them into build.env so they can be read by the trigger job
set_image_tags() {
SUFFIX="$1"
VARIABLE_SUFFIX="${SUFFIX:+_$SUFFIX}" # add a '_' prefix
TAG_SUFFIX="${SUFFIX:+-$SUFFIX}" # add a '-' prefix

# We always add this tag, regardless of the version
DESTINATIONS="${IMG_DESTINATION_BASE}:${CI_COMMIT_TAG}${TAG_SUFFIX}"

# We always add the major_minor tag (we never release 2.5.2 _after_ 2.5.3, for example)
DESTINATIONS="${DESTINATIONS},${IMG_DESTINATION_BASE}:${MAJOR_MINOR_VERSION}${TAG_SUFFIX}"

# Only latest-major releases get the major tag
if [ "$IS_LATEST_MAJOR_TAG" -eq 1 ]; then
DESTINATIONS="${DESTINATIONS},${IMG_DESTINATION_BASE}:${MAJOR_VERSION}${TAG_SUFFIX}"
fi

# Only latest releases get the latest tag
if [ "$IS_LATEST_TAG" -eq 1 ]; then
DESTINATIONS="${DESTINATIONS},${IMG_DESTINATION_BASE}:latest${TAG_SUFFIX}"
fi

# Save the value to the build.env file
echo "IMG_DESTINATIONS${VARIABLE_SUFFIX}=${DESTINATIONS}"
echo "IMG_DESTINATIONS${VARIABLE_SUFFIX}=${DESTINATIONS}" >> build.env
}

# Calculate the non-suffixed tags
set_image_tags

# For each suffix, calculate the tags
for ADDITIONAL_TAG_SUFFIX in ${ADDITIONAL_TAG_SUFFIXES//,/ }
do
set_image_tags "$ADDITIONAL_TAG_SUFFIX"
done
Loading
Loading