Skip to content

Commit f37c464

Browse files
committed
Merge branch 'master' into mattalp/reroute-gradle-profiler-dependencies
# Conflicts: # dd-java-agent/agent-profiling/profiling-controller-ddprof/src/test/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecordingTest.java # dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerRecordingTest.java # dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java
2 parents 8b45e6c + 90a02ce commit f37c464

File tree

239 files changed

+6767
-2585
lines changed

Some content is hidden

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

239 files changed

+6767
-2585
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

.github/workflows/analyze-changes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/'

.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: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ 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/"
3131
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-")
@@ -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
@@ -149,6 +146,7 @@ default:
149146
- .gradle/caches
150147
- .gradle/notifications
151148
policy: $DEPENDENCY_CACHE_POLICY
149+
unprotect: true
152150
fallback_keys: # Use fallback keys because all cache types are not populated. See note under: populate_dep_cache
153151
- '$CI_SERVER_VERSION-base'
154152
- '$CI_SERVER_VERSION-lib'
@@ -158,15 +156,19 @@ default:
158156
- .gradle/$GRADLE_VERSION/executionHistory
159157
- workspace
160158
policy: $BUILD_CACHE_POLICY
159+
unprotect: true
161160
before_script:
162161
- source .gitlab/gitlab-utils.sh
162+
# Akka token added to SSM from https://account.akka.io/token
163+
- 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)
163164
- mkdir -p .gradle
164165
- export GRADLE_USER_HOME=$(pwd)/.gradle
165166
- |
166167
# Don't put jvm args here as it will be picked up by child gradle processes used in tests
167168
cat << EOF > $GRADLE_USER_HOME/gradle.properties
168169
mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
169170
gradlePluginProxy=$GRADLE_PLUGIN_PROXY
171+
akkaRepositoryToken=$AKKA_REPO_TOKEN
170172
EOF
171173
- |
172174
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties
@@ -186,7 +188,32 @@ default:
186188
after_script:
187189
- *cgroup_info
188190

191+
# Checks and fail early if central credentials are incorrect, indeed, when a new token is generated
192+
# on the central publisher protal, it invalidates the old one. This checks prevents going further.
193+
# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
194+
pre-release-checks:
195+
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
196+
stage: .pre
197+
rules:
198+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
199+
when: on_success
200+
allow_failure: false
201+
script:
202+
- |
203+
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)
204+
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)
205+
# See https://central.sonatype.org/publish/publish-portal-api/
206+
# 15e0cbbb-deff-421e-9e02-296a24d0cada is deployment, any deployment id listed in central work, the idea is to check whether the token can authenticate
207+
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)"
208+
if [ $? -ne 0 ]; then
209+
echo "Failed to authenticate against central. Check credentials, see https://datadoghq.atlassian.net/wiki/x/Oog5OgE"
210+
exit 1
211+
fi
212+
189213
build:
214+
needs:
215+
- job: pre-release-checks
216+
optional: true
190217
extends: .gradle_build
191218
variables:
192219
BUILD_CACHE_POLICY: push
@@ -324,7 +351,7 @@ test_published_artifacts:
324351
- *cgroup_info
325352
- source .gitlab/gitlab-utils.sh
326353
- gitlab_section_start "collect-reports" "Collecting reports"
327-
- .circleci/collect_reports.sh
354+
- .gitlab/collect_reports.sh
328355
- gitlab_section_end "collect-reports"
329356
artifacts:
330357
when: always
@@ -344,7 +371,7 @@ test_published_artifacts:
344371
- *cgroup_info
345372
- source .gitlab/gitlab-utils.sh
346373
- gitlab_section_start "collect-reports" "Collecting reports"
347-
- .circleci/collect_reports.sh --destination ./check_reports --move
374+
- .gitlab/collect_reports.sh --destination ./check_reports --move
348375
- gitlab_section_end "collect-reports"
349376
artifacts:
350377
when: always
@@ -404,7 +431,7 @@ muzzle:
404431
- *cgroup_info
405432
- source .gitlab/gitlab-utils.sh
406433
- gitlab_section_start "collect-reports" "Collecting reports"
407-
- .circleci/collect_reports.sh
434+
- .gitlab/collect_reports.sh
408435
- gitlab_section_end "collect-reports"
409436
artifacts:
410437
when: always
@@ -423,7 +450,7 @@ muzzle-dep-report:
423450
- ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
424451
after_script:
425452
- *cgroup_info
426-
- .circleci/collect_muzzle_deps.sh
453+
- .gitlab/collect_muzzle_deps.sh
427454
artifacts:
428455
when: always
429456
paths:
@@ -486,10 +513,10 @@ muzzle-dep-report:
486513
- *cgroup_info
487514
- source .gitlab/gitlab-utils.sh
488515
- gitlab_section_start "collect-reports" "Collecting reports"
489-
- .circleci/collect_reports.sh
490-
- if [ "$PROFILE_TESTS" == "true" ]; then .circleci/collect_profiles.sh; fi
491-
- .circleci/collect_results.sh
492-
- .circleci/upload_ciapp.sh $CACHE_TYPE $testJvm
516+
- .gitlab/collect_reports.sh
517+
- if [ "$PROFILE_TESTS" == "true" ]; then .gitlab/collect_profiles.sh; fi
518+
- .gitlab/collect_results.sh
519+
- .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm
493520
- gitlab_section_end "collect-reports"
494521
- URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri')
495522
- 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"
@@ -741,8 +768,8 @@ deploy_to_di_backend:manual:
741768
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
742769
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
743770

744-
# If the deploy_to_sonatype job is re-run, re-trigger the deploy_artifacts_to_github job as well so that the artifacts match.
745-
deploy_to_sonatype:
771+
# 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.
772+
deploy_to_maven_central:
746773
extends: .gradle_build
747774
stage: publish
748775
needs: [ build ]
@@ -759,8 +786,8 @@ deploy_to_sonatype:
759786
- when: manual
760787
allow_failure: true
761788
script:
762-
- 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)
763-
- 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)
789+
- 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)
790+
- 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)
764791
- 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)
765792
- 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)
766793
- ./gradlew -PbuildInfo.build.number=$CI_JOB_ID publishToSonatype closeSonatypeStagingRepository -PskipTests $GRADLE_ARGS
@@ -778,11 +805,11 @@ deploy_artifacts_to_github:
778805
when: never
779806
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
780807
when: on_success
781-
# Requires the deploy_to_sonatype job to have run first (the UP-TO-DATE gradle check across jobs is broken)
808+
# Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken)
782809
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
783810
needs:
784-
- job: deploy_to_sonatype
785-
# The deploy_to_sonatype job is not run for release candidate versions
811+
- job: deploy_to_maven_central
812+
# The deploy_to_maven_central job is not run for release candidate versions
786813
optional: true
787814
script:
788815
- 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

.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:

.gitlab/cgroup-info.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,3 @@ elif [ -d "/sys/fs/cgroup/memory" ]; then # Assuming if memory cgroup v1 exists,
8080
else
8181
printf "cgroup memory paths not found. Neither cgroup v2 controller file nor cgroup v1 memory directory detected.\n"
8282
fi
83-
File renamed without changes.

.circleci/collect_profiles.sh renamed to .gitlab/collect_profiles.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Save all important profiles into (project-root)/profiles
4-
# This folder will be saved by circleci and available after test runs.
4+
# This folder will be saved by gitlab and available after test runs.
55

66
set -e
77
#Enable '**' support

.circleci/collect_reports.sh renamed to .gitlab/collect_reports.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Save all important reports into (project-root)/reports
4-
# This folder will be saved by circleci and available after test runs.
4+
# This folder will be saved by gitlab and available after test runs.
55

66
set -e
77
#Enable '**' support

.circleci/collect_results.sh renamed to .gitlab/collect_results.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Save all important reports and artifacts into (project-root)/results
4-
# This folder will be saved by circleci and available after test runs.
4+
# This folder will be saved by gitlab and available after test runs.
55

66
set -e
77
# Enable '**' support

0 commit comments

Comments
 (0)