Skip to content

Commit 4f2d6a9

Browse files
Merge branch 'master' into daniel.mohedano/failed-test-replay
2 parents ae31670 + 766af68 commit 4f2d6a9

File tree

700 files changed

+19039
-6790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

700 files changed

+19039
-6790
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@
110110
/internal-api/src/main/java/datadog/trace/api/EndpointCheckpointer.java @DataDog/profiling-java
111111
/internal-api/src/main/java/datadog/trace/api/EndpointTracker.java @DataDog/profiling-java
112112
/dd-smoke-tests/profiling-integration-tests/ @DataDog/profiling-java
113+
114+
# @DataDog/ml-observability
115+
dd-trace-api/src/main/java/datadog/trace/api/llmobs/ @DataDog/ml-observability
116+
dd-java-agent/agent-llmobs/ @DataDog/ml-observability
117+
dd-trace-core/src/main/java/datadog/trace/llmobs/ @DataDog/ml-observability
118+
dd-trace-core/src/test/groovy/datadog/trace/llmobs/ @DataDog/ml-observability
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
issuer: https://gitlab.ddbuild.io
2+
3+
subject_pattern: "project_path:DataDog/apm-reliability/dd-trace-java:ref_type:tag:ref:v.*"
4+
5+
claim_pattern:
6+
project_path: "DataDog/apm-reliability/dd-trace-java"
7+
ref_type: "tag"
8+
ref: "v.*"
9+
10+
permissions:
11+
contents: "write"

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
4545
- name: Commit and push changes
46-
uses: planetscale/ghcommit-action@6a383e778f6620afde4bf4b45069d3c6983c1ae2 # v0.2.15
46+
uses: planetscale/ghcommit-action@7c35caed9937939812c7d4242ffab823e9b3b1fa # v0.2.16
4747
with:
4848
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
4949
repo: ${{ github.repository }}

.github/workflows/analyze-changes.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
${{ runner.os }}-gradle-
4141
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
43+
uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
4444
with:
4545
languages: 'java'
4646
build-mode: 'manual'
4747

4848
- name: Build dd-trace-java for creating the CodeQL database
4949
run: |
50-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
50+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
5151
JAVA_HOME=$JAVA_HOME_8_X64 \
5252
JAVA_8_HOME=$JAVA_HOME_8_X64 \
5353
JAVA_11_HOME=$JAVA_HOME_11_X64 \
@@ -57,7 +57,7 @@ jobs:
5757
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5858
5959
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
60-
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
60+
uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
6161

6262
trivy:
6363
name: Analyze changes with Trivy
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Build and publish artifacts locally
9595
run: |
96-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
96+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
9797
JAVA_HOME=$JAVA_HOME_8_X64 \
9898
JAVA_8_HOME=$JAVA_HOME_8_X64 \
9999
JAVA_11_HOME=$JAVA_HOME_11_X64 \
@@ -109,7 +109,7 @@ jobs:
109109
ls -laR "./workspace/.trivy"
110110
111111
- name: Run Trivy security scanner
112-
uses: aquasecurity/trivy-action@76071ef0d7ec797419534a183b498b4d6366cf37 # v0.31.0
112+
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
113113
with:
114114
scan-type: rootfs
115115
scan-ref: './workspace/.trivy/'
@@ -122,7 +122,7 @@ jobs:
122122
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
123123

124124
- name: Upload Trivy scan results to GitHub Security tab
125-
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
125+
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
126126
if: always()
127127
with:
128128
sarif_file: 'trivy-results.sarif'

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
git push -u origin $BRANCH_NAME --force
2929
- name: Update Gradle dependencies
3030
run: |
31-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
31+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
3232
JAVA_HOME=$JAVA_HOME_8_X64 \
3333
JAVA_8_HOME=$JAVA_HOME_8_X64 \
3434
JAVA_11_HOME=$JAVA_HOME_11_X64 \

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ replay_pid*
6464
# Magic for local JMC built
6565
/vendor/jmc-libs
6666

67-
# CircleCI #
68-
############
69-
_circle_ci_cache_*
70-
upstream.env
71-
/.circleci/config.continue.yml
72-
7367
# Benchmarks #
7468
benchmark/reports
7569
benchmark/tracer
7670
benchmark/dacapo/scratch
71+
72+
# JDK provisioning tools #
73+
# mise
74+
mise*.local.toml
75+
.mise*.local.toml
76+
.config/mise*.toml
77+
# asdf
78+
.tool-versions

.gitlab-ci.yml

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ variables:
2525
BUILD_JOB_NAME: "build"
2626
DEPENDENCY_CACHE_POLICY: pull
2727
BUILD_CACHE_POLICY: pull
28-
GRADLE_VERSION: "8.5" # must match gradle-wrapper.properties
28+
GRADLE_VERSION: "8.14.3" # must match gradle-wrapper.properties
2929
MAVEN_REPOSITORY_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/maven-central/"
3030
GRADLE_PLUGIN_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/gradle-plugin-portal-proxy/"
31-
BUILDER_IMAGE_VERSION_PREFIX: "v25.06-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
31+
BUILDER_IMAGE_VERSION_PREFIX: "v25.07-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
3232
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
3333
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable)$/
3434
PROFILE_TESTS:
@@ -119,14 +119,11 @@ default:
119119

120120
.gitlab_base_ref_params: &gitlab_base_ref_params
121121
- |
122-
# FIXME: Disabled until we find a way to not hit GitHub API rate limit
123-
if false && [[ ! $CI_COMMIT_BRANCH =~ ^(master|release/.*)$ ]]; then
124-
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh)
125-
if [[ -n "$GIT_BASE_REF" ]]; then
126-
export GRADLE_PARAMS="$GRADLE_PARAMS -PgitBaseRef=origin/$GIT_BASE_REF"
127-
else
128-
echo "Failed to find base ref for PR" >&2
129-
fi
122+
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh)
123+
if [[ -n "$GIT_BASE_REF" ]]; then
124+
export GRADLE_PARAMS="$GRADLE_PARAMS -PgitBaseRef=origin/$GIT_BASE_REF"
125+
else
126+
echo "Failed to find base ref for PR" >&2
130127
fi
131128
132129
.gradle_build: &gradle_build
@@ -140,33 +137,41 @@ default:
140137
KUBERNETES_MEMORY_REQUEST: 8Gi
141138
KUBERNETES_MEMORY_LIMIT: 8Gi
142139
CACHE_TYPE: lib #default
140+
FF_USE_FASTZIP: "true"
141+
CACHE_COMPRESSION_LEVEL: "slowest"
142+
143143
RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes
144144
cache:
145-
- key: '$CI_SERVER_VERSION-$CACHE_TYPE' # Dependencies cache. Reset the cache every time gitlab is upgraded. ~Every couple months
145+
- key: dependency-$CACHE_TYPE # Dependencies cache
146146
paths:
147147
# Cached dependencies and wrappers for gradle
148148
- .gradle/wrapper
149149
- .gradle/caches
150150
- .gradle/notifications
151151
policy: $DEPENDENCY_CACHE_POLICY
152+
unprotect: true
152153
fallback_keys: # Use fallback keys because all cache types are not populated. See note under: populate_dep_cache
153-
- '$CI_SERVER_VERSION-base'
154-
- '$CI_SERVER_VERSION-lib'
154+
- 'dependency-base'
155+
- 'dependency-lib'
155156
- key: $CI_PIPELINE_ID-$CACHE_TYPE # Incremental build cache. Shared by all jobs in the pipeline of the same type
156157
paths:
157158
- .gradle/caches/$GRADLE_VERSION
158159
- .gradle/$GRADLE_VERSION/executionHistory
159160
- workspace
160161
policy: $BUILD_CACHE_POLICY
162+
unprotect: true
161163
before_script:
162164
- source .gitlab/gitlab-utils.sh
165+
# Akka token added to SSM from https://account.akka.io/token
166+
- export AKKA_REPO_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text)
163167
- mkdir -p .gradle
164168
- export GRADLE_USER_HOME=$(pwd)/.gradle
165169
- |
166170
# Don't put jvm args here as it will be picked up by child gradle processes used in tests
167171
cat << EOF > $GRADLE_USER_HOME/gradle.properties
168172
mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
169173
gradlePluginProxy=$GRADLE_PLUGIN_PROXY
174+
akkaRepositoryToken=$AKKA_REPO_TOKEN
170175
EOF
171176
- |
172177
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties
@@ -186,7 +191,32 @@ default:
186191
after_script:
187192
- *cgroup_info
188193

194+
# Checks and fail early if central credentials are incorrect, indeed, when a new token is generated
195+
# on the central publisher protal, it invalidates the old one. This checks prevents going further.
196+
# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
197+
pre-release-checks:
198+
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
199+
stage: .pre
200+
rules:
201+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
202+
when: on_success
203+
allow_failure: false
204+
script:
205+
- |
206+
MAVEN_CENTRAL_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_username --with-decryption --query "Parameter.Value" --out text)
207+
MAVEN_CENTRAL_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_password --with-decryption --query "Parameter.Value" --out text)
208+
# See https://central.sonatype.org/publish/publish-portal-api/
209+
# 15e0cbbb-deff-421e-9e02-296a24d0cada is deployment, any deployment id listed in central work, the idea is to check whether the token can authenticate
210+
curl --request POST --include --fail https://central.sonatype.com/api/v1/publisher/status?id=15e0cbbb-deff-421e-9e02-296a24d0cada --header "Authorization: Bearer $(printf "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" | base64)"
211+
if [ $? -ne 0 ]; then
212+
echo "Failed to authenticate against central. Check credentials, see https://datadoghq.atlassian.net/wiki/x/Oog5OgE"
213+
exit 1
214+
fi
215+
189216
build:
217+
needs:
218+
- job: pre-release-checks
219+
optional: true
190220
extends: .gradle_build
191221
variables:
192222
BUILD_CACHE_POLICY: push
@@ -324,7 +354,7 @@ test_published_artifacts:
324354
- *cgroup_info
325355
- source .gitlab/gitlab-utils.sh
326356
- gitlab_section_start "collect-reports" "Collecting reports"
327-
- .circleci/collect_reports.sh
357+
- .gitlab/collect_reports.sh
328358
- gitlab_section_end "collect-reports"
329359
artifacts:
330360
when: always
@@ -344,7 +374,7 @@ test_published_artifacts:
344374
- *cgroup_info
345375
- source .gitlab/gitlab-utils.sh
346376
- gitlab_section_start "collect-reports" "Collecting reports"
347-
- .circleci/collect_reports.sh --destination ./check_reports --move
377+
- .gitlab/collect_reports.sh --destination ./check_reports --move
348378
- gitlab_section_end "collect-reports"
349379
artifacts:
350380
when: always
@@ -392,20 +422,19 @@ muzzle:
392422
extends: .gradle_build
393423
needs: [ build_tests ]
394424
stage: tests
395-
parallel: 8
425+
parallel:
426+
matrix:
427+
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
396428
variables:
397429
CACHE_TYPE: inst
398430
script:
399431
- export SKIP_BUILDSCAN="true"
400-
- ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
401-
- sort workspace/build/muzzleTasks > sortedMuzzleTasks
402-
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
403-
- ./gradlew $(cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs) $GRADLE_ARGS
432+
- ./gradlew :runMuzzle -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
404433
after_script:
405434
- *cgroup_info
406435
- source .gitlab/gitlab-utils.sh
407436
- gitlab_section_start "collect-reports" "Collecting reports"
408-
- .circleci/collect_reports.sh
437+
- .gitlab/collect_reports.sh
409438
- gitlab_section_end "collect-reports"
410439
artifacts:
411440
when: always
@@ -424,7 +453,7 @@ muzzle-dep-report:
424453
- ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
425454
after_script:
426455
- *cgroup_info
427-
- .circleci/collect_muzzle_deps.sh
456+
- .gitlab/collect_muzzle_deps.sh
428457
artifacts:
429458
when: always
430459
paths:
@@ -487,10 +516,10 @@ muzzle-dep-report:
487516
- *cgroup_info
488517
- source .gitlab/gitlab-utils.sh
489518
- gitlab_section_start "collect-reports" "Collecting reports"
490-
- .circleci/collect_reports.sh
491-
- if [ "$PROFILE_TESTS" == "true" ]; then .circleci/collect_profiles.sh; fi
492-
- .circleci/collect_results.sh
493-
- .circleci/upload_ciapp.sh $CACHE_TYPE $testJvm
519+
- .gitlab/collect_reports.sh
520+
- if [ "$PROFILE_TESTS" == "true" ]; then .gitlab/collect_profiles.sh; fi
521+
- .gitlab/collect_results.sh
522+
- .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm
494523
- gitlab_section_end "collect-reports"
495524
- URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri')
496525
- echo -e "${TEXT_BOLD}${TEXT_YELLOW}See test results in Datadog:${TEXT_CLEAR} https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.service%3Add-trace-java%20%40ci.pipeline.id%3A${CI_PIPELINE_ID}%20%40ci.job.name%3A%22${URL_ENCODED_JOB_NAME}%22"
@@ -742,8 +771,8 @@ deploy_to_di_backend:manual:
742771
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
743772
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
744773

745-
# If the deploy_to_sonatype job is re-run, re-trigger the deploy_artifacts_to_github job as well so that the artifacts match.
746-
deploy_to_sonatype:
774+
# If the deploy_to_maven_central job is re-run, re-trigger the deploy_artifacts_to_github job as well so that the artifacts match.
775+
deploy_to_maven_central:
747776
extends: .gradle_build
748777
stage: publish
749778
needs: [ build ]
@@ -760,8 +789,8 @@ deploy_to_sonatype:
760789
- when: manual
761790
allow_failure: true
762791
script:
763-
- export SONATYPE_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_username --with-decryption --query "Parameter.Value" --out text)
764-
- export SONATYPE_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_password --with-decryption --query "Parameter.Value" --out text)
792+
- export MAVEN_CENTRAL_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_username --with-decryption --query "Parameter.Value" --out text)
793+
- export MAVEN_CENTRAL_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_password --with-decryption --query "Parameter.Value" --out text)
765794
- export GPG_PRIVATE_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.signing.gpg_private_key --with-decryption --query "Parameter.Value" --out text)
766795
- export GPG_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.signing.gpg_passphrase --with-decryption --query "Parameter.Value" --out text)
767796
- ./gradlew -PbuildInfo.build.number=$CI_JOB_ID publishToSonatype closeSonatypeStagingRepository -PskipTests $GRADLE_ARGS
@@ -779,11 +808,11 @@ deploy_artifacts_to_github:
779808
when: never
780809
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
781810
when: on_success
782-
# Requires the deploy_to_sonatype job to have run first (the UP-TO-DATE gradle check across jobs is broken)
811+
# Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken)
783812
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
784813
needs:
785-
- job: deploy_to_sonatype
786-
# The deploy_to_sonatype job is not run for release candidate versions
814+
- job: deploy_to_maven_central
815+
# The deploy_to_maven_central job is not run for release candidate versions
787816
optional: true
788817
script:
789818
- aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.gh_release_token --with-decryption --query "Parameter.Value" --out text > github-token.txt
@@ -811,7 +840,7 @@ package-oci:
811840

812841
configure_system_tests:
813842
variables:
814-
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,docker-ssi,lib-injection"
843+
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection"
815844

816845
create_key:
817846
stage: generate-signing-key

.gitlab/benchmarks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ check-big-regressions:
7575
artifacts: true
7676
when: on_success
7777
tags: ["arch:amd64"]
78+
rules:
79+
- if: '$POPULATE_CACHE'
80+
when: never
81+
- if: '$CI_COMMIT_BRANCH !~ /^(master|release\/)/'
82+
when: on_success
83+
- when: never
7884
# ARTIFACTS_DIR /go/src/github.com/DataDog/apm-reliability/dd-trace-java/reports/
7985
# need to convert them
8086
script:

0 commit comments

Comments
 (0)