Skip to content

Commit 96a04e9

Browse files
authored
Merge branch 'master' into bdu/do-not-include-latest-dep-classpath
2 parents 39eef9c + bc6f916 commit 96a04e9

File tree

538 files changed

+4169
-1922
lines changed

Some content is hidden

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

538 files changed

+4169
-1922
lines changed

.github/chainguard/self.update-system-tests.create-pr.sts.yaml

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

.github/workflows/README.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ _Action:_ Check the pull request did not introduce unexpected label.
3636

3737
_Recovery:_ Update the pull request or add a comment to trigger the action again.
3838

39+
### create-release-branch [🔗](create-release-branch.yaml)
40+
41+
_Trigger:_ When a git tag matching the pattern "vM.N.0" is pushed (e.g. for a minor release).
42+
43+
_Action:_ Create a release branch that corresponds to the pushed tag (e.g. "release/vM.N.x").
44+
45+
_Recovery:_ Manually create the branch from the "vM.N.0" git tag.
46+
3947
### draft-release-notes-on-tag [🔗](draft-release-notes-on-tag.yaml)
4048

4149
_Trigger:_ When creating a tag, or manually (providing a tag)
@@ -61,6 +69,15 @@ _Recovery:_ Manually [close the related milestone and create a new one](https://
6169

6270
_Notes:_ This action will not apply to release candidate versions using `-RC` tags.
6371

72+
### prune-old-pull-requests [🔗](prune-old-pull-requests.yaml)
73+
74+
_Trigger:_ Every month or manually.
75+
76+
_Action:_ Mark as stale and comment on pull requests with no update during the last quarter.
77+
Close them if no following update within a week.
78+
79+
_Recovery:_ Manually trigger the action again.
80+
6481
### update-docker-build-image [🔗](update-docker-build-image.yaml)
6582

6683
_Trigger:_ Quarterly released, loosely [a day after the new image tag is created](https://github.com/DataDog/dd-trace-java-docker-build/blob/master/.github/workflows/docker-tag.yml).
@@ -93,16 +110,6 @@ _Action:_
93110

94111
_Recovery:_ Check at the milestone for the related issues and update them manually.
95112

96-
97-
### prune-old-pull-requests [🔗](prune-old-pull-requests.yaml)
98-
99-
_Trigger:_ Every month or manually.
100-
101-
_Action:_ Mark as stale and comment on pull requests with no update during the last quarter.
102-
Close them if no following update within a week.
103-
104-
_Recovery:_ Manually trigger the action again.
105-
106113
## Code Quality and Security
107114

108115
### analyze-changes [🔗](analyze-changes.yaml)
@@ -122,14 +129,6 @@ _Trigger:_ When creating a PR commits to `master` or a `release/*` branch with a
122129

123130
_Action:_ Notify the PR author through comments that about the Git Submodule update.
124131

125-
### update-gradle-dependencies [🔗](update-gradle-dependencies.yaml)
126-
127-
_Trigger:_ Every week or manually.
128-
129-
_Action:_ Create a PR updating the Grade dependencies and their locking files.
130-
131-
_Recovery:_ Manually trigger the action again.
132-
133132
### run-system-tests [🔗](run-system-tests.yaml)
134133

135134
_Trigger:_ When pushing commits to `master` or manually.
@@ -138,6 +137,14 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith
138137

139138
_Recovery:_ Manually trigger the action on the desired branch.
140139

140+
### update-gradle-dependencies [🔗](update-gradle-dependencies.yaml)
141+
142+
_Trigger:_ Every week or manually.
143+
144+
_Action:_ Create a PR updating the Grade dependencies and their locking files.
145+
146+
_Recovery:_ Manually trigger the action again.
147+
141148
### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml)
142149

143150
_Trigger:_ Monthly or manually
Lines changed: 20 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Release Branch and Pin System-Tests
1+
name: Create Release Branch
22

33
on:
44
push:
@@ -15,24 +15,8 @@ jobs:
1515
create-release-branch:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: write # Allow pushing the empty release branch
19-
id-token: write # Required for OIDC token federation
18+
contents: write # Allow pushing the release branch
2019
steps:
21-
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
22-
id: octo-sts
23-
with:
24-
scope: DataDog/dd-trace-java
25-
policy: self.update-system-tests.create-pr
26-
27-
- name: Checkout dd-trace-java master branch
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
29-
with:
30-
ref: master
31-
32-
- name: Get head SHA of master branch
33-
id: get-head-sha
34-
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
35-
3620
- name: Determine tag
3721
id: determine-tag
3822
run: |
@@ -53,61 +37,25 @@ jobs:
5337
TAG=${{ steps.determine-tag.outputs.tag }}
5438
echo "branch=release/${TAG%.0}.x" >> "$GITHUB_OUTPUT"
5539
56-
# - name: Check if branch already exists
57-
# id: check-branch
58-
# run: |
59-
# BRANCH=${{ steps.define-branch.outputs.branch }}
60-
# if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
61-
# echo "creating_new_branch=false" >> "$GITHUB_OUTPUT"
62-
# echo "Branch $BRANCH already exists - skipping following steps"
63-
# else
64-
# echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
65-
# echo "Branch $BRANCH does not exist - proceeding with following steps"
66-
# fi
67-
68-
# - name: Create and push empty release branch
69-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
70-
# run: |
71-
# git checkout -b "${{ steps.define-branch.outputs.branch }}"
72-
# git push -u origin "${{ steps.define-branch.outputs.branch }}"
73-
74-
- name: Update system-tests references to latest commit SHA on main
75-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
76-
run: BRANCH=main ./tooling/update_system_test_reference.sh
77-
78-
- name: Define temp branch name
79-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
80-
id: define-temp-branch
81-
run: echo "temp-branch=ci/pin-system-tests-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
40+
- name: Checkout dd-trace-java at tag
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
42+
with:
43+
ref: ${{ steps.determine-tag.outputs.tag }}
8244

83-
- name: Commit changes
84-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
85-
id: create-commit
45+
- name: Check if branch already exists
46+
id: check-branch
8647
run: |
87-
git config user.name "github-actions[bot]"
88-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
89-
git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml
90-
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
91-
92-
- name: Push changes to temp branch
93-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
94-
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
95-
with:
96-
token: "${{ steps.octo-sts.outputs.token }}"
97-
branch: "${{ steps.define-temp-branch.outputs.temp-branch }}"
98-
head-sha: "${{ steps.get-head-sha.outputs.sha }}"
99-
create-branch: true
100-
command: push
101-
commits: "${{ steps.create-commit.outputs.commit }}"
48+
BRANCH=${{ steps.define-branch.outputs.branch }}
49+
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
50+
echo "creating_new_branch=false" >> "$GITHUB_OUTPUT"
51+
echo "Branch $BRANCH already exists - skipping creation"
52+
else
53+
echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
54+
echo "Branch $BRANCH does not exist - creating it now"
55+
fi
10256
103-
- name: Create pull request from temp branch to release branch
104-
# if: steps.check-branch.outputs.creating_new_branch == 'true'
105-
env:
106-
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
57+
- name: Create and push release branch
58+
if: steps.check-branch.outputs.creating_new_branch == 'true'
10759
run: |
108-
gh pr create --title "Pin system-tests for ${{ steps.define-branch.outputs.branch }}" \
109-
--base "${{ steps.define-branch.outputs.branch }}" \
110-
--head "${{ steps.define-temp-branch.outputs.temp-branch }}" \
111-
--label "tag: dependencies" \
112-
--label "tag: no release notes" \
113-
--body "This PR pins the system-tests reference for the release branch."
60+
git checkout -b "${{ steps.define-branch.outputs.branch }}"
61+
git push -u origin "${{ steps.define-branch.outputs.branch }}"

.gitlab-ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variables:
2828
GRADLE_VERSION: "8.14.3" # must match gradle-wrapper.properties
2929
MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
3030
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
31-
BUILDER_IMAGE_VERSION_PREFIX: "v25.10-" # 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.11-" # 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|25)$/ # the latest "stable" version is LTS v25
3434
PROFILE_TESTS:
@@ -360,6 +360,14 @@ spotless:
360360
- ./gradlew --version
361361
- ./gradlew spotlessCheck $GRADLE_ARGS
362362

363+
config-inversion-linter:
364+
extends: .gradle_build
365+
stage: tests
366+
needs: []
367+
script:
368+
- ./gradlew --version
369+
- ./gradlew logEnvVarUsages checkEnvironmentVariablesUsage checkConfigStrings
370+
363371
test_published_artifacts:
364372
extends: .gradle_build
365373
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}7 # Needs Java7 for some tests

.gitlab/benchmarks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ check-big-regressions:
7878
rules:
7979
- if: '$POPULATE_CACHE'
8080
when: never
81+
- if: '$CI_COMMIT_BRANCH =~ /backport-pr-/'
82+
when: never
8183
- if: '$CI_COMMIT_BRANCH !~ /^(master|release\/)/'
8284
when: on_success
8385
- when: never

components/native-loader/src/main/java/datadog/nativeloader/ClassLoaderResourcePathLocator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ public ClassLoaderResourcePathLocator(final ClassLoader classLoader, final Strin
1414
}
1515

1616
@Override
17-
public URL locate(String component, String path) {
18-
return this.classLoader.getResource(PathUtils.concatPath(component, this.baseResource, path));
17+
public URL locate(String optionalComponent, String path) {
18+
return this.classLoader.getResource(
19+
PathUtils.concatPath(optionalComponent, this.baseResource, path));
1920
}
2021

2122
@Override
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
package datadog.nativeloader;
2+
3+
import java.net.URL;
4+
import java.nio.file.Path;
5+
import java.util.ArrayList;
6+
import java.util.Arrays;
7+
import java.util.Collection;
8+
9+
final class CompositeLibraryLoadingListener extends SafeLibraryLoadingListener {
10+
private final Collection<? extends LibraryLoadingListener> listeners;
11+
12+
CompositeLibraryLoadingListener(LibraryLoadingListener... listeners) {
13+
this(Arrays.asList(listeners));
14+
}
15+
16+
CompositeLibraryLoadingListener(Collection<? extends LibraryLoadingListener> listeners) {
17+
this.listeners = listeners;
18+
}
19+
20+
@Override
21+
public boolean isNop() {
22+
return this.listeners.isEmpty();
23+
}
24+
25+
int size() {
26+
return this.listeners.size();
27+
}
28+
29+
@Override
30+
public void onResolveDynamic(
31+
PlatformSpec platformSpec,
32+
String optionalComponent,
33+
String libName,
34+
boolean isPreloaded,
35+
URL optionalUrl) {
36+
for (LibraryLoadingListener listener : this.listeners) {
37+
try {
38+
listener.onResolveDynamic(
39+
platformSpec, optionalComponent, libName, isPreloaded, optionalUrl);
40+
} catch (Throwable ignored) {
41+
}
42+
}
43+
}
44+
45+
@Override
46+
public void onResolveDynamicFailure(
47+
PlatformSpec platformSpec,
48+
String optionalComponent,
49+
String libName,
50+
Throwable optionalCause) {
51+
for (LibraryLoadingListener listener : this.listeners) {
52+
try {
53+
listener.onResolveDynamicFailure(platformSpec, optionalComponent, libName, optionalCause);
54+
} catch (Throwable ignored) {
55+
}
56+
}
57+
}
58+
59+
@Override
60+
public void onLoad(
61+
PlatformSpec platformSpec,
62+
String optionalComponent,
63+
String libName,
64+
boolean isPreloaded,
65+
Path optionalLibPath) {
66+
for (LibraryLoadingListener listener : this.listeners) {
67+
try {
68+
listener.onLoad(platformSpec, optionalComponent, libName, isPreloaded, optionalLibPath);
69+
} catch (Throwable ignored) {
70+
}
71+
}
72+
}
73+
74+
@Override
75+
public void onLoadFailure(
76+
PlatformSpec platformSpec,
77+
String optionalComponent,
78+
String libName,
79+
Throwable optionalCause) {
80+
for (LibraryLoadingListener listener : this.listeners) {
81+
try {
82+
listener.onLoadFailure(platformSpec, optionalComponent, libName, optionalCause);
83+
} catch (Throwable ignored) {
84+
}
85+
}
86+
}
87+
88+
@Override
89+
public void onTempFileCreated(
90+
PlatformSpec platformSpec, String optionalComponent, String libName, Path tempFile) {
91+
for (LibraryLoadingListener listener : this.listeners) {
92+
try {
93+
listener.onTempFileCreated(platformSpec, optionalComponent, libName, tempFile);
94+
} catch (Throwable ignored) {
95+
}
96+
}
97+
}
98+
99+
@Override
100+
public void onTempFileCreationFailure(
101+
PlatformSpec platformSpec,
102+
String optionalComponent,
103+
String libName,
104+
Path tempDir,
105+
String libExt,
106+
Throwable optionalCause) {
107+
for (LibraryLoadingListener listener : this.listeners) {
108+
try {
109+
listener.onTempFileCreationFailure(
110+
platformSpec, optionalComponent, libName, tempDir, libExt, optionalCause);
111+
} catch (Throwable ignored) {
112+
}
113+
}
114+
}
115+
116+
@Override
117+
public void onTempFileCleanup(
118+
PlatformSpec platformSpec, String optionalComponent, String libName, Path tempPath) {
119+
for (LibraryLoadingListener listener : this.listeners) {
120+
try {
121+
listener.onTempFileCleanup(platformSpec, optionalComponent, libName, tempPath);
122+
} catch (Throwable ignored) {
123+
}
124+
}
125+
}
126+
127+
@Override
128+
public CompositeLibraryLoadingListener join(LibraryLoadingListener... listeners) {
129+
ArrayList<LibraryLoadingListener> combinedListeners =
130+
new ArrayList<>(this.listeners.size() + listeners.length);
131+
combinedListeners.addAll(this.listeners);
132+
combinedListeners.addAll(Arrays.asList(listeners));
133+
return new CompositeLibraryLoadingListener(combinedListeners);
134+
}
135+
136+
@Override
137+
public String toString() {
138+
return this.getClass().getSimpleName() + ":" + this.listeners.toString();
139+
}
140+
}

0 commit comments

Comments
 (0)