Skip to content

Commit 0196afe

Browse files
Merge branch 'master' into alexeyk/groovy-4
# Conflicts: # dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle
2 parents 612eae0 + 8db72c0 commit 0196afe

File tree

133 files changed

+3027
-1092
lines changed

Some content is hidden

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

133 files changed

+3027
-1092
lines changed

.github/workflows/analyze-changes.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
33+
uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
3434
with:
3535
languages: 'java'
3636
build-mode: 'manual'
@@ -49,7 +49,7 @@ jobs:
4949
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5050
5151
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
52-
uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
52+
uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
5353

5454
trivy:
5555
name: Analyze changes with Trivy
@@ -114,7 +114,7 @@ jobs:
114114
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
115115

116116
- name: Upload Trivy scan results to GitHub Security tab
117-
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
117+
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
118118
if: always()
119119
with:
120120
sarif_file: 'trivy-results.sarif'

.github/workflows/run-system-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5353
5454
- name: Upload artifact
55-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
55+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
5656
with:
5757
name: binaries
5858
path: workspace/dd-java-agent/build/libs/

.gitlab-ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include:
33
- local: ".gitlab/benchmarks.yml"
44
- local: ".gitlab/macrobenchmarks.yml"
55
- local: ".gitlab/exploration-tests.yml"
6-
# - local: ".gitlab/ci-visibility-tests.yml"
6+
- local: ".gitlab/ci-visibility-tests.yml"
77

88
stages:
99
- build
@@ -138,7 +138,7 @@ default:
138138
KUBERNETES_CPU_REQUEST: 8
139139
KUBERNETES_MEMORY_REQUEST: 8Gi
140140
KUBERNETES_MEMORY_LIMIT: 8Gi
141-
CACHE_TYPE: lib #default
141+
CACHE_TYPE: "lib" #default
142142
FF_USE_FASTZIP: "true"
143143
CACHE_COMPRESSION_LEVEL: "slowest"
144144

@@ -148,10 +148,11 @@ default:
148148
cache:
149149
- key: dependency-$CACHE_TYPE # Dependencies cache
150150
paths:
151-
# Cached dependencies and wrappers for gradle
151+
# Cached dependencies and wrappers for Gradle and Maven:
152152
- .gradle/wrapper
153153
- .gradle/caches
154154
- .gradle/notifications
155+
- .mvn/caches
155156
policy: $DEPENDENCY_CACHE_POLICY
156157
unprotect: true
157158
fallback_keys: # Use fallback keys because all cache types are not populated. See note under: populate_dep_cache
@@ -174,6 +175,7 @@ default:
174175
- export GRADLE_USER_HOME=$(pwd)/.gradle
175176
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties
176177
- sed -i "s|https://repo.maven.apache.org/maven2/|$MAVEN_REPOSITORY_PROXY|g" .mvn/wrapper/maven-wrapper.properties
178+
- mkdir -p .mvn/caches
177179
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms$GRADLE_MEM -Xmx$GRADLE_MEM -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
178180
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
179181
- *normalize_node_index
@@ -246,7 +248,7 @@ build:
246248
extends: .gradle_build
247249
variables:
248250
BUILD_CACHE_POLICY: push
249-
CACHE_TYPE: lib
251+
CACHE_TYPE: "lib"
250252
DEPENDENCY_CACHE_POLICY: pull
251253
script:
252254
- if [ $CI_PIPELINE_SOURCE == "schedule" ] ; then ./gradlew resolveAndLockAll --write-locks $GRADLE_ARGS; fi
@@ -287,7 +289,7 @@ build_tests:
287289
CACHE_TYPE: "latestdep"
288290
- GRADLE_TARGET: ":smokeTest"
289291
CACHE_TYPE: "smoke"
290-
MAVEN_OPTS: "-Xms64M -Xmx512M -Dorg.slf4j.simpleLogger.defaultLogLevel=debug" # FIXME: Build :smokeTest build fails unless mvn debug logging is on
292+
MAVEN_OPTS: "-Xms64M -Xmx512M"
291293

292294
script:
293295
- *gitlab_base_ref_params
@@ -365,7 +367,7 @@ test_published_artifacts:
365367
stage: tests
366368
needs: [ build ]
367369
variables:
368-
CACHE_TYPE: lib
370+
CACHE_TYPE: "lib"
369371
script:
370372
- mvn_local_repo=$(./mvnw help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)
371373
- rm -rf "${mvn_local_repo}/com/datadoghq"
@@ -393,7 +395,7 @@ test_published_artifacts:
393395
needs: [ build ]
394396
stage: tests
395397
variables:
396-
CACHE_TYPE: lib
398+
CACHE_TYPE: "lib"
397399
script:
398400
- *gitlab_base_ref_params
399401
- ./gradlew --version
@@ -429,12 +431,14 @@ check_inst:
429431
parallel: 4
430432
variables:
431433
GRADLE_TARGET: ":instrumentationCheck"
434+
CACHE_TYPE: "inst"
432435

433436
check_smoke:
434437
extends: .check_job
435438
parallel: 4
436439
variables:
437440
GRADLE_TARGET: ":smokeCheck"
441+
CACHE_TYPE: "smoke"
438442

439443
check_profiling:
440444
extends: .check_job
@@ -454,7 +458,7 @@ muzzle:
454458
matrix:
455459
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
456460
variables:
457-
CACHE_TYPE: inst
461+
CACHE_TYPE: "inst"
458462
script:
459463
- export SKIP_BUILDSCAN="true"
460464
- ./gradlew --version
@@ -476,7 +480,7 @@ muzzle-dep-report:
476480
needs: [ build_tests ]
477481
stage: tests
478482
variables:
479-
CACHE_TYPE: inst
483+
CACHE_TYPE: "inst"
480484
script:
481485
- export SKIP_BUILDSCAN="true"
482486
- ./gradlew --version
@@ -644,7 +648,7 @@ test_flaky:
644648
extends: .test_job_with_test_agent
645649
variables:
646650
GRADLE_PARAMS: "-PrunFlakyTests"
647-
CACHE_TYPE: "base"
651+
CACHE_TYPE: "smoke"
648652
testJvm: "8"
649653
CONTINUE_ON_FAILURE: "true"
650654
rules:
@@ -809,7 +813,7 @@ deploy_to_maven_central:
809813
stage: publish
810814
needs: [ build ]
811815
variables:
812-
CACHE_TYPE: lib
816+
CACHE_TYPE: "lib"
813817
rules:
814818
- if: '$POPULATE_CACHE'
815819
when: never

.gitlab/ci-visibility-tests.yml

Lines changed: 44 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,44 @@
1-
#check-ci-visibility-label:
2-
# stage: publish
3-
# image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
4-
# tags: [ "arch:amd64" ]
5-
# needs: [ publish-artifacts-to-s3 ]
6-
# id_tokens:
7-
# DDOCTOSTS_ID_TOKEN:
8-
# aud: dd-octo-sts
9-
# rules:
10-
# # - if: '$POPULATE_CACHE'
11-
# # when: never
12-
# # - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
13-
# # when: on_success
14-
# - when: never
15-
# before_script:
16-
# - dd-octo-sts version
17-
# - dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read
18-
# - dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read > github-token.txt
19-
# - gh auth login --with-token < github-token.txt
20-
# script:
21-
# - |
22-
# # Source utility functions
23-
# source .gitlab/ci_visibility_utils.sh
24-
#
25-
# # Get PR number
26-
# if ! PR_NUMBER=$(get_pr_number "${CI_COMMIT_BRANCH}"); then
27-
# echo "No open PR found for branch ${CI_COMMIT_BRANCH}"
28-
# exit 1
29-
# fi
30-
#
31-
# echo "Found PR #${PR_NUMBER}"
32-
#
33-
# # Check if PR has the CI visibility label
34-
# if pr_has_label "$PR_NUMBER" "comp: ci visibility"; then
35-
# echo "PR_NUMBER=${PR_NUMBER}" > pr.env
36-
# echo "PR #${PR_NUMBER} detected as CI Visibility PR"
37-
# exit 0
38-
# else
39-
# echo "PR #${PR_NUMBER} not a CI Visibility PR, ignoring trigger"
40-
# exit 1
41-
# fi
42-
# after_script:
43-
# - dd-octo-sts revoke -t $(cat github-token.txt) || true
44-
# artifacts:
45-
# reports:
46-
# dotenv: pr.env
47-
# allow_failure: true
48-
# retry:
49-
# max: 2
50-
# when: always
51-
#
52-
#run-ci-visibility-test-environment:
53-
# stage: ci-visibility-tests
54-
# needs:
55-
# - job: check-ci-visibility-label
56-
# artifacts: true
57-
# rules:
58-
# - if: '$POPULATE_CACHE'
59-
# when: never
60-
# - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
61-
# when: on_success
62-
# trigger:
63-
# project: DataDog/apm-reliability/test-environment
64-
# branch: main
65-
# strategy: depend
66-
# variables:
67-
# UPSTREAM_PACKAGE_JOB: build
68-
# UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
69-
# UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
70-
# UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
71-
# UPSTREAM_BRANCH: $CI_COMMIT_BRANCH
72-
# UPSTREAM_TAG: $CI_COMMIT_TAG
73-
# UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
74-
# UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
75-
# TRACER_LANG: java
76-
# JAVA_TRACER_REF_TO_TEST: $CI_COMMIT_BRANCH
77-
# JAVA_TRACER_PR_TO_TEST: $PR_NUMBER
1+
ci-visibility-tests-check:
2+
stage: ci-visibility-tests
3+
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
4+
tags: [ "arch:amd64" ]
5+
needs: [ publish-artifacts-to-s3 ]
6+
id_tokens:
7+
DDOCTOSTS_ID_TOKEN:
8+
aud: dd-octo-sts
9+
rules:
10+
- if: '$POPULATE_CACHE'
11+
when: never
12+
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
13+
when: on_success
14+
- when: never
15+
before_script:
16+
- dd-octo-sts version
17+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read
18+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.github-access.read > github-token.txt
19+
- gh auth login --with-token < github-token.txt
20+
script:
21+
- .gitlab/ci_visibility_generate_job.sh
22+
after_script:
23+
- dd-octo-sts revoke -t $(cat github-token.txt) || true
24+
artifacts:
25+
paths:
26+
- ci-visibility-test-environment.yml
27+
retry:
28+
max: 2
29+
when: always
30+
31+
ci-visibility-tests-trigger:
32+
stage: ci-visibility-tests
33+
needs: [ci-visibility-tests-check]
34+
rules:
35+
- if: '$POPULATE_CACHE'
36+
when: never
37+
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH !~ /^(master|release\/)/'
38+
when: on_success
39+
- when: never
40+
trigger:
41+
include:
42+
- artifact: ci-visibility-test-environment.yml
43+
job: ci-visibility-tests-check
44+
strategy: depend
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
add_dummy_job() {
6+
cat <<EOF >>ci-visibility-test-environment.yml
7+
skip-ci-visibility-tests:
8+
stage: ci-visibility-tests
9+
tags: [ "arch:amd64" ]
10+
script:
11+
- echo "PR does not have required label - CI Visibility test environment not triggered"
12+
EOF
13+
}
14+
15+
# Generate yml
16+
cat <<EOF >ci-visibility-test-environment.yml
17+
stages:
18+
- ci-visibility-tests
19+
20+
EOF
21+
22+
if [ -z "$CI_COMMIT_BRANCH" ]; then
23+
echo "No branch detected - skipping trigger"
24+
add_dummy_job
25+
exit 0
26+
fi
27+
28+
echo "Performing trigger checks for ci-visibility test-environment..."
29+
set +e
30+
pr_number=$(gh pr list --repo DataDog/dd-trace-java --head "$CI_COMMIT_BRANCH" --state open --json number --jq '.[0].number' 2>&1)
31+
pr_number_status=$?
32+
set -e
33+
34+
if [ $pr_number_status -ne 0 ]; then
35+
echo "Failed to query PR (gh command failed with status $pr_number_status ) - skipping trigger"
36+
add_dummy_job
37+
exit 0
38+
fi
39+
if [ -z "$pr_number" ]; then
40+
echo "No open PR found for branch $CI_COMMIT_BRANCH - skipping trigger"
41+
add_dummy_job
42+
exit 0
43+
fi
44+
45+
echo "PR #${pr_number} found, checking labels..."
46+
set +e
47+
labels=$(gh pr view "$pr_number" --repo DataDog/dd-trace-java --json labels --jq '.labels[].name' 2>&1)
48+
labels_status=$?
49+
set -e
50+
51+
if [ $labels_status -ne 0 ]; then
52+
echo "Failed to query PR labels (gh command failed with status $labels_status) - skipping trigger"
53+
add_dummy_job
54+
exit 0
55+
fi
56+
if [ -z "$labels" ] || ! echo "$labels" | grep -q "comp: ci visibility"; then
57+
echo "PR #$pr_number is not a CI Visibility PR - skipping trigger"
58+
add_dummy_job
59+
exit 0
60+
fi
61+
62+
echo "PR #$pr_number is a CI Visibility PR - triggering test environment"
63+
64+
cat <<EOF >>ci-visibility-test-environment.yml
65+
ci-visibility-test-environment:
66+
stage: ci-visibility-tests
67+
trigger:
68+
project: DataDog/apm-reliability/test-environment
69+
branch: main
70+
strategy: depend
71+
variables:
72+
UPSTREAM_PACKAGE_JOB: build
73+
UPSTREAM_PROJECT_ID: "$CI_PROJECT_ID"
74+
UPSTREAM_PROJECT_NAME: "$CI_PROJECT_NAME"
75+
UPSTREAM_PIPELINE_ID: "$CI_PIPELINE_ID"
76+
UPSTREAM_BRANCH: "$CI_COMMIT_BRANCH"
77+
UPSTREAM_TAG: "$CI_COMMIT_TAG"
78+
UPSTREAM_COMMIT_AUTHOR: "$CI_COMMIT_AUTHOR"
79+
UPSTREAM_COMMIT_SHORT_SHA: "$CI_COMMIT_SHORT_SHA"
80+
TRACER_LANG: java
81+
JAVA_TRACER_REF_TO_TEST: "$CI_COMMIT_BRANCH"
82+
JAVA_TRACER_PR_TO_TEST: "$pr_number"
83+
EOF

0 commit comments

Comments
 (0)