Skip to content

Commit 8a4254a

Browse files
authored
Merge branch 'master' into jpbempel/update-probe-file-format
2 parents bd148fb + 16eee52 commit 8a4254a

File tree

546 files changed

+8583
-4091
lines changed

Some content is hidden

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

546 files changed

+8583
-4091
lines changed

.github/workflows/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ _Action:_
8585

8686
_Recovery:_ Check at the milestone for the related issues and update them manually.
8787

88-
### prune-github-container-registry [🔗](prune-github-container-registry.yaml)
89-
90-
_Trigger:_ Every day or manually.
91-
92-
_Action:_ Clean up old lib-injection OCI images from GitHub Container Registry.
93-
94-
_Recovery:_ Manually trigger the action again.
9588

9689
### prune-old-pull-requests [🔗](prune-old-pull-requests.yaml)
9790

.github/workflows/analyze-changes.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
${{ runner.os }}-gradle-
4141
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
43+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
4444
with:
4545
languages: 'java'
4646
build-mode: 'manual'
@@ -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@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
60+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
6161

6262
trivy:
6363
name: Analyze changes with Trivy
@@ -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@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
125+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
126126
if: always()
127127
with:
128128
sarif_file: 'trivy-results.sarif'

.github/workflows/prune-github-container-registry.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.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: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ variables:
4141
description: "Enable flaky tests"
4242
value: "false"
4343

44-
default:
45-
interruptible: true
46-
4744
# trigger new commit cancel
4845
workflow:
4946
auto_cancel:
@@ -100,6 +97,7 @@ workflow:
10097

10198
default:
10299
tags: [ "arch:amd64" ]
100+
interruptible: true
103101

104102
.set_datadog_api_keys: &set_datadog_api_keys
105103
- export DATADOG_API_KEY_PROD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.DATADOG_API_KEY_PROD --with-decryption --query "Parameter.Value" --out text)
@@ -119,6 +117,18 @@ default:
119117
- .gitlab/cgroup-info.sh
120118
- gitlab_section_end "cgroup-info"
121119

120+
.gitlab_base_ref_params: &gitlab_base_ref_params
121+
- |
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
130+
fi
131+
122132
.gradle_build: &gradle_build
123133
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
124134
stage: build
@@ -176,7 +186,32 @@ default:
176186
after_script:
177187
- *cgroup_info
178188

189+
# Checks and fail early if central credentials are incorrect, indeed, when a new token is generated
190+
# on the central publisher protal, it invalidates the old one. This checks prevents going further.
191+
# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
192+
pre-release-checks:
193+
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
194+
stage: .pre
195+
rules:
196+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
197+
when: on_success
198+
allow_failure: false
199+
script:
200+
- |
201+
SONATYPE_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_username --with-decryption --query "Parameter.Value" --out text)
202+
SONATYPE_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_password --with-decryption --query "Parameter.Value" --out text)
203+
# See https://central.sonatype.org/publish/publish-portal-api/
204+
# 15e0cbbb-deff-421e-9e02-296a24d0cada is deployment, any deployment id listed in central work, the idea is to check whether the token can authenticate
205+
curl --request POST --include --fail https://central.sonatype.com/api/v1/publisher/status?id=15e0cbbb-deff-421e-9e02-296a24d0cada --header "Authorization: Bearer $(printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64)"
206+
if [ $? -ne 0 ]; then
207+
echo "Failed to authenticate against central. Check credentials, see https://datadoghq.atlassian.net/wiki/x/Oog5OgE"
208+
exit 1
209+
fi
210+
179211
build:
212+
needs:
213+
- job: pre-release-checks
214+
optional: true
180215
extends: .gradle_build
181216
variables:
182217
BUILD_CACHE_POLICY: push
@@ -223,7 +258,8 @@ build_tests:
223258
MAVEN_OPTS: "-Xms64M -Xmx512M -Dorg.slf4j.simpleLogger.defaultLogLevel=debug" # FIXME: Build :smokeTest build fails unless mvn debug logging is on
224259

225260
script:
226-
- ./gradlew clean $GRADLE_TARGET -PskipTests $GRADLE_ARGS
261+
- *gitlab_base_ref_params
262+
- ./gradlew clean $GRADLE_TARGET $GRADLE_PARAMS -PskipTests $GRADLE_ARGS
227263

228264
populate_dep_cache:
229265
extends: build_tests
@@ -313,7 +349,7 @@ test_published_artifacts:
313349
- *cgroup_info
314350
- source .gitlab/gitlab-utils.sh
315351
- gitlab_section_start "collect-reports" "Collecting reports"
316-
- .circleci/collect_reports.sh
352+
- .gitlab/collect_reports.sh
317353
- gitlab_section_end "collect-reports"
318354
artifacts:
319355
when: always
@@ -327,12 +363,13 @@ test_published_artifacts:
327363
variables:
328364
CACHE_TYPE: lib
329365
script:
330-
- ./gradlew $GRADLE_TARGET -PskipTests -PrunBuildSrcTests -PskipSpotless -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
366+
- *gitlab_base_ref_params
367+
- ./gradlew $GRADLE_TARGET $GRADLE_PARAMS -PskipTests -PrunBuildSrcTests -PskipSpotless -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
331368
after_script:
332369
- *cgroup_info
333370
- source .gitlab/gitlab-utils.sh
334371
- gitlab_section_start "collect-reports" "Collecting reports"
335-
- .circleci/collect_reports.sh --destination ./check_reports --move
372+
- .gitlab/collect_reports.sh --destination ./check_reports --move
336373
- gitlab_section_end "collect-reports"
337374
artifacts:
338375
when: always
@@ -380,20 +417,19 @@ muzzle:
380417
extends: .gradle_build
381418
needs: [ build_tests ]
382419
stage: tests
383-
parallel: 8
420+
parallel:
421+
matrix:
422+
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
384423
variables:
385424
CACHE_TYPE: inst
386425
script:
387426
- export SKIP_BUILDSCAN="true"
388-
- ./gradlew writeMuzzleTasksToFile $GRADLE_ARGS
389-
- sort workspace/build/muzzleTasks > sortedMuzzleTasks
390-
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
391-
- ./gradlew $(cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs) $GRADLE_ARGS
427+
- ./gradlew :runMuzzle -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
392428
after_script:
393429
- *cgroup_info
394430
- source .gitlab/gitlab-utils.sh
395431
- gitlab_section_start "collect-reports" "Collecting reports"
396-
- .circleci/collect_reports.sh
432+
- .gitlab/collect_reports.sh
397433
- gitlab_section_end "collect-reports"
398434
artifacts:
399435
when: always
@@ -412,7 +448,7 @@ muzzle-dep-report:
412448
- ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
413449
after_script:
414450
- *cgroup_info
415-
- .circleci/collect_muzzle_deps.sh
451+
- .gitlab/collect_muzzle_deps.sh
416452
artifacts:
417453
when: always
418454
paths:
@@ -460,6 +496,7 @@ muzzle-dep-report:
460496
- if: $CI_COMMIT_BRANCH == "master"
461497
when: on_success
462498
script:
499+
- *gitlab_base_ref_params
463500
- >
464501
if [ "$PROFILE_TESTS" == "true" ] && [ "$testJvm" != "ibm8" ] && [ "$testJvm" != "oracle8" ];
465502
then
@@ -474,10 +511,10 @@ muzzle-dep-report:
474511
- *cgroup_info
475512
- source .gitlab/gitlab-utils.sh
476513
- gitlab_section_start "collect-reports" "Collecting reports"
477-
- .circleci/collect_reports.sh
478-
- if [ "$PROFILE_TESTS" == "true" ]; then .circleci/collect_profiles.sh; fi
479-
- .circleci/collect_results.sh
480-
- .circleci/upload_ciapp.sh $CACHE_TYPE $testJvm
514+
- .gitlab/collect_reports.sh
515+
- if [ "$PROFILE_TESTS" == "true" ]; then .gitlab/collect_profiles.sh; fi
516+
- .gitlab/collect_results.sh
517+
- .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm
481518
- gitlab_section_end "collect-reports"
482519
- URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri')
483520
- 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"
@@ -506,7 +543,7 @@ muzzle-dep-report:
506543
CI_USE_TEST_AGENT: "true"
507544
CI_AGENT_HOST: local-agent
508545
services:
509-
- name: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.11.0
546+
- name: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.27.1
510547
alias: local-agent
511548
variables:
512549
LOG_LEVEL: "DEBUG"
@@ -729,6 +766,7 @@ deploy_to_di_backend:manual:
729766
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
730767
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
731768

769+
# If the deploy_to_sonatype job is re-run, re-trigger the deploy_artifacts_to_github job as well so that the artifacts match.
732770
deploy_to_sonatype:
733771
extends: .gradle_build
734772
stage: publish
@@ -746,8 +784,8 @@ deploy_to_sonatype:
746784
- when: manual
747785
allow_failure: true
748786
script:
749-
- export SONATYPE_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.sonatype_username --with-decryption --query "Parameter.Value" --out text)
750-
- export SONATYPE_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.sonatype_password --with-decryption --query "Parameter.Value" --out text)
787+
- 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)
788+
- 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)
751789
- 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)
752790
- 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)
753791
- ./gradlew -PbuildInfo.build.number=$CI_JOB_ID publishToSonatype closeSonatypeStagingRepository -PskipTests $GRADLE_ARGS
@@ -765,7 +803,7 @@ deploy_artifacts_to_github:
765803
when: never
766804
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
767805
when: on_success
768-
# Requires the deploy_to_sonatype job to have run first the UP-TO-DATE gradle check across jobs is broken
806+
# Requires the deploy_to_sonatype job to have run first (the UP-TO-DATE gradle check across jobs is broken)
769807
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
770808
needs:
771809
- job: deploy_to_sonatype

.gitlab/benchmarks.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
2828
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
2929

30-
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-java
31-
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"
32-
3330
benchmarks-startup:
3431
extends: .benchmarks
3532
script:
@@ -56,6 +53,7 @@ benchmarks-dacapo:
5653

5754
benchmarks-post-results:
5855
extends: .benchmarks
56+
tags: ["arch:amd64"]
5957
script:
6058
- !reference [ .benchmarks, script ]
6159
- ./steps/upload-results-to-s3.sh
@@ -77,6 +75,10 @@ check-big-regressions:
7775
artifacts: true
7876
when: on_success
7977
tags: ["arch:amd64"]
78+
rules:
79+
- if: '$CI_COMMIT_BRANCH !~ /^(master|release\/)/'
80+
when: on_success
81+
- when: never
8082
# ARTIFACTS_DIR /go/src/github.com/DataDog/apm-reliability/dd-trace-java/reports/
8183
# need to convert them
8284
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-

.gitlab/check_test_agent_results.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ SUMMARY_RESPONSE_CODE=$(echo "$SUMMARY_RESPONSE" | awk 'END {print $NF}')
77

88
if [[ SUMMARY_RESPONSE_CODE -eq 200 ]]; then
99
echo "APM Test Agent is running. (HTTP 200)"
10+
elif [[ -n "$CI_USE_TEST_AGENT" ]]; then
11+
echo "APM Test Agent failed to start, had an error, or exited early."
12+
cat summary_response.txt
13+
exit 1
1014
else
1115
echo "APM Test Agent is not running and was not used for testing. No checks failed."
1216
exit 0
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

0 commit comments

Comments
 (0)