Skip to content

Commit 1e6c3ca

Browse files
authored
Merge branch 'master' into dougqh/advice-annotation-checking
2 parents f5c17ac + c5b3733 commit 1e6c3ca

File tree

739 files changed

+12790
-5783
lines changed

Some content is hidden

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

739 files changed

+12790
-5783
lines changed

.circleci/config.continue.yml.j2

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instrumentation_modules: &instrumentation_modules "dd-java-agent/instrumentation
3636
debugger_modules: &debugger_modules "dd-java-agent/agent-debugger|dd-java-agent/agent-bootstrap|dd-java-agent/agent-builder|internal-api|communication|dd-trace-core"
3737
profiling_modules: &profiling_modules "dd-java-agent/agent-profiling"
3838

39-
default_system_tests_commit: &default_system_tests_commit c87bd359aad64a29f280fc5c70a879f7c7f4846e
39+
default_system_tests_commit: &default_system_tests_commit 53d9b2c43876a39e5c0426f4df4dd5fd79d062e8
4040

4141
parameters:
4242
nightly:
@@ -971,19 +971,20 @@ jobs:
971971
cd system-tests
972972
set +e
973973
RUN_ATTEMPTS=1
974-
while [ $RUN_ATTEMPTS -le 3 ]; do
974+
MAX_ATTEMPTS=1 # Disable retries as the runner is supposed to be stable. Revert to 3 if needed.
975+
while [ $RUN_ATTEMPTS -le $MAX_ATTEMPTS ]; do
975976
echo "Running parametric test attempt $RUN_ATTEMPTS"
976-
timeout 20m ./run.sh PARAMETRIC -L java --log-cli-level=DEBUG --durations=30 -vv
977+
timeout 20m ./run.sh PARAMETRIC --library java --durations=30 -vv
977978
status=$?
978-
#timneout returns 124 if it times out
979-
#if the return code is not 124, then we exit with the status
979+
# timeout returns 124 if it times out
980+
# if the return code is not 124, then we exit with the status
980981
if [ $status -ne 124 ]; then
981982
exit $status
982983
break
983984
fi
984985
RUN_ATTEMPTS=$((RUN_ATTEMPTS+1))
985-
if [ $RUN_ATTEMPTS -eq 4 ]; then
986-
#Max attempts reached, exit with 124
986+
if [ $RUN_ATTEMPTS -gt $MAX_ATTEMPTS ]; then
987+
# Max attempts reached, exit with 124
987988
exit 124
988989
fi
989990
done
@@ -994,9 +995,11 @@ jobs:
994995
- run:
995996
name: Collect artifacts
996997
command: tar -cvzf logs_java_parametric_dev.tar.gz -C system-tests logs_parametric
998+
when: always
997999
9981000
- store_artifacts:
9991001
path: logs_java_parametric_dev.tar.gz
1002+
when: always
10001003
10011004
10021005
build_test_jobs: &build_test_jobs

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Bug Report
4+
url: https://help.datadoghq.com/hc/en-us/requests/new?tf_1260824651490=pt_product_type:apm&tf_1900004146284=pt_apm_language:java
5+
about: This option creates an expedited Bug Report via the helpdesk (no login required). This will allow us to look up your account and allows you to provide additional information in private.
6+
- name: Feature Request
7+
url: https://help.datadoghq.com/hc/en-us/requests/new?tf_1260824651490=pt_product_type:apm&tf_1900004146284=pt_apm_language:java&tf_1260825272270=pt_apm_category_feature_request
8+
about: This option creates an expedited Feature Request via the helpdesk (no login required). This helps with prioritization and allows you to provide additional information in private.

.github/workflows/analyze-changes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
ls -laR "./workspace/.trivy"
133133
134134
- name: Run Trivy security scanner
135-
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0
135+
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
136136
with:
137137
scan-type: rootfs
138138
scan-ref: './workspace/.trivy/'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ jobs:
7777
--base master \
7878
--head $BRANCH_NAME \
7979
--label "tag: dependencies" \
80-
--label "tag: no release notes"
80+
--label "tag: no release notes" \
8181
--body-file -

.gitlab-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,8 @@ package-oci:
216216
onboarding_tests_installer:
217217
parallel:
218218
matrix:
219-
- ONBOARDING_FILTER_WEBLOG: [test-app-java, test-app-java-container, test-app-java-container-jdk15, test-app-java-alpine]
219+
- ONBOARDING_FILTER_WEBLOG: [test-app-java, test-app-java-container, test-app-java-alpine]
220220
SCENARIO: [ SIMPLE_INSTALLER_AUTO_INJECTION, SIMPLE_AUTO_INJECTION_PROFILING ]
221-
- ONBOARDING_FILTER_WEBLOG: [test-app-java-buildpack]
222-
SCENARIO: [ SIMPLE_INSTALLER_AUTO_INJECTION ]
223221

224222
onboarding_tests_k8s_injection:
225223
variables:

BUILDING.md

Lines changed: 66 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
# Building
33

4-
This documentation is dedicated to developers to setup their environment, and build the project from sources:
4+
This documentation provides information for developers to set up their environment and build their project from sources.
55

6-
* Check your development environment is ready to build,
7-
* Check the development environment requirements,
8-
* Guide - How to setup your development environment,
9-
* Guide - How to build the project.
6+
* [Development environment quick check](#development-environment-quick-check)
7+
* [Environment requirements quick check](#environment-requirements-quick-check)
8+
* [Development environment set up](#development-environment-set-up)
9+
* [Project build](#project-build)
1010

1111
## Development environment quick check
1212

13-
To check that your development environment is properly set up to build the project, you will eventually run `./setup.sh` from the project root and should have its output look something like this:
13+
To check that your development environment is properly set up to build the project, run `./setup.sh` from the project root. Your output should look something like the following.
1414

1515
```bash
1616
$ ./setup.sh
@@ -31,110 +31,106 @@ $ ./setup.sh
3131
✅ The Docker server is running.
3232
```
3333

34-
If the script finds any issue, you can check the requirements and follow the guide below to install and configure the required tools.
34+
If there is any issue with your output, you can check the requirements and/or follow the guide below to install and configure the required tools.
3535

36-
## Building requirements
36+
## Environment requirements quick check
3737

38-
To build the full project:
38+
Requirements to build the full project:
3939

40-
* The JDK versions 8, 11, 17 and 21 must be installed
41-
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME` and `JAVA_GRAALVM17_HOME` must point to their respective JDK location,
40+
* The JDK versions 8, 11, 17 and 21 must be installed.
41+
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME` and `JAVA_GRAALVM17_HOME` must point to their respective JDK location.
4242
* The JDK-8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
43-
* The `JAVA_HOME` environment variable may be unset. If set, it must point to the JDK 8 location (same as `JAVA_8_HOME`),
44-
* The `git` command line must be installed,
45-
* A container runtime environment must be available to run all tests (usually Docker Desktop).
43+
* The `JAVA_HOME` environment variable may be unset. If set, it must point to the JDK 8 location (same as `JAVA_8_HOME`).
44+
* The `git` command line must be installed.
45+
* A container runtime environment must be available to run all tests (e.g. Docker Desktop).
4646

47-
48-
## Setting up development environment
47+
## Development environment set up
4948

5049
### Install the required JDKs
5150

5251
**On MacOS:**
5352

54-
* Install the required JDKs using `brew`:
53+
* Install the required JDKs using `brew`.
5554
`brew install --cask zulu@8 zulu@11 zulu@17 zulu@21 graalvm/tap/graalvm-ce-java17`
56-
* Fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/):
55+
* Fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/).
5756
`sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>`
58-
* Add the required environment variables to your shell using the `export` command:
57+
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `.bashrc` or other.
5958
```shell
6059
export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
6160
export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
6261
export JAVA_17_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
6362
export JAVA_21_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home
64-
export JAVA_GRAALVM17_HOME=/Library/Java/JavaVirtualMachines/graalvm-<current version of grallvm>/Contents/Home
63+
export JAVA_GRAALVM17_HOME=/Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>/Contents/Home
6564
export JAVA_HOME=$JAVA_8_HOME
6665
```
66+
* Restart your shell after applying the changes if you appended the commands to your shell configuration file.
6767

6868
> [!NOTE]
69-
> ARM users, there is no Oracle JDK v8 for ARM.
69+
> ARM users: there is no Oracle JDK v8 for ARM.
7070
> It's recommended to use [Azul's Zulu](https://www.azul.com/downloads/?version=java-8-lts&architecture=arm-64-bit&package=jdk#zulu) builds of Java 8.
7171
> [Amazon Corretto](https://aws.amazon.com/corretto/) builds have also been proven to work.
7272
7373
> [!NOTE]
74-
> MacOS users, remember that `/usr/libexec/java_home` may control which JDK is in your path.
75-
76-
> [!NOTE]
77-
> You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` (or `.bashrc` dependening of your shell).
78-
> You will need to restart your shell first to apply the changes.
74+
> MacOS users: remember that `/usr/libexec/java_home` may control which JDK is in your path.
7975
8076
**On Linux:**
8177

82-
* Download and extract JDK 8, 11, 17 and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/),
83-
* Install the GraalVM native image requirements for native builds following [the GraalVM official documentation](https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites),
84-
* Add the required environment variables to your shell using the `export` command:
78+
* Download and extract JDK 8, 11, 17 and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/).
79+
* Install the GraalVM native image requirements for native builds by following [the GraalVM official documentation](https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites).
80+
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `~/.bashrc` or other.
8581
```shell
8682
export JAVA_8_HOME=/<path to extracted archive>/jdk8u<current version of JDK 8>
8783
export JAVA_11_HOME=/<path to extracted archive>/jdk-11.<current version of JDK 11>
8884
export JAVA_17_HOME=/<path to extracted archive>/jdk-17.<current version of JDK 17>
8985
export JAVA_21_HOME=/<path to extracted archive>/jdk-21.<current version of JDK 21>
90-
export JAVA_GRAALVM17_HOME=/<path to extracted archive>/graalvm-jdk-17.<current version of grallvm>/Contents/Home
86+
export JAVA_GRAALVM17_HOME=/<path to extracted archive>/graalvm-jdk-17.<current version of graalvm>/Contents/Home
9187
export JAVA_HOME=$JAVA_8_HOME
9288
```
93-
94-
> [!NOTE]
95-
> You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` (or `.bashrc` dependening of your shell).
96-
> You will need to restart your shell first to apply the changes.
89+
* Restart your shell after applying the changes if you appended the commands to your shell configuration file.
9790

9891
**On Windows:**
9992

100-
* Download and install JDK 8, 11, 17 and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/),
101-
* Install the GraalVM native image requirements for native builds following [the GraalVM official documentation](https://www.graalvm.org/latest/docs/getting-started/windows/#prerequisites-for-native-image-on-windows),
102-
* Add the required environment variables:
103-
* Open the *Start Menu*, type `environment variable` and open the *System Properties* using the *Edit environment variable for your account* entry,
104-
* Add new entries to the table:
105-
* `JAVA_8_HOME` to the JDK 8 installation folder, usually `C:\Program Files\Eclipse Adoptium\jdk-<current version of Java 8>-hotspot\bin`,
106-
* `JAVA_11_HOME`, `JAVA_21_HOME`, and `JAVA_21_HOME` similarly to their respective installation `bin` folders,
107-
* `JAVA_GRAALVM17_HOME` to the GraalVM installation folder, usually `C:\Program Files\Java\<current version of graalvm>\bin`.
93+
* Download and install JDK 8, 11, 17 and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM from [Oracle downloads](https://www.graalvm.org/downloads/).
94+
* Install the GraalVM native image requirements for native builds by following [the GraalVM official documentation](https://www.graalvm.org/latest/docs/getting-started/windows/#prerequisites-for-native-image-on-windows).
95+
* Add the required environment variables.
96+
* Open the *Start Menu*, type `environment variable`, and use the *Edit environment variable for your account* entry to open the *System Properties*.
97+
* Add new entries to the table.
98+
* `JAVA_8_HOME` to the JDK 8 installation folder, usually `C:\Program Files\Eclipse Adoptium\jdk-<current version of Java 8>-hotspot\bin`
99+
* `JAVA_11_HOME`, `JAVA_21_HOME`, and `JAVA_21_HOME` similarly to their respective installation `bin` folders
100+
* `JAVA_GRAALVM17_HOME` to the GraalVM installation folder, usually `C:\Program Files\Java\<current version of graalvm>\bin`
108101

109102
### Install git
110103

111-
**On MacOS**, you can trigger the installation running any `git` command from the terminal, like `git --version`.
112-
If not installed, it will prompt you to install it.
104+
**On MacOS:**
105+
106+
You can trigger the installation by running any `git` command from the terminal, e.g. `git --version`.
107+
If not installed, the terminal will prompt you to install it.
113108

114-
**On Linux**, use `# apt-get install git` command.
109+
**On Linux:**
110+
111+
Run `apt-get install git`.
112+
113+
**On Windows:**
115114

116-
**On Windows**, [download and install the installer from the offical website](https://git-scm.com/download/win).
115+
Download and install [the installer](https://git-scm.com/download/win) from the official website.
117116

118117
### Install Docker Desktop
119118

120119
Download and install Docker Desktop from the offical website for [MacOS](https://docs.docker.com/desktop/install/mac-install/), [Linux](https://docs.docker.com/desktop/install/linux-install/) or [Windows](https://docs.docker.com/desktop/install/windows-install/).
121120

122121
> [!NOTE]
123-
> Docker Desktop is the recommended container runtime environment but you can use any other environment to run testcontainers tests.
122+
> Docker Desktop is the recommended container runtime environment, but you can use any other environment to run testcontainers tests.
124123
> Check [the testcontainers container runtime requirements](https://java.testcontainers.org/supported_docker_environment/) for more details.
125124
126-
### Clone the repository and setup git
125+
### Clone the repository and set up git
127126

128-
First get a copy of the project.
129-
Start a terminal into your workspace and clone the repository using git:
127+
* Get a copy of the project.
128+
* In your workspace, clone the repository using git.
130129
```bash
131130
git clone --recurse-submodules [email protected]:DataDog/dd-trace-java.git
132131
```
133-
134-
Then, install the project git hooks:
135-
136-
There is a pre-commit hook setup to verify formatting before committing. It can be activated with this command:
137-
132+
* Install the project git hooks.
133+
* There is a pre-commit hook setup to verify formatting before committing. It can be activated with the following command.
138134
```bash
139135
# On MacOS and Linux
140136
cd dd-trace-java
@@ -146,13 +142,13 @@ copy .githooks/pre-comit .git/hooks/
146142
```
147143

148144
> [!TIP]
149-
> You can alternative use the `core.hooksPath` configuration to point to the `.githooks` folder using `git config --local core.hooksPath .githooks` if you don't already have a hooks path already defined system-wide.
145+
> You can alternatively use the `core.hooksPath` configuration to point to the `.githooks` folder using `git config --local core.hooksPath .githooks` if you don't already have a hooks path defined system-wide.
150146
151147
> [!NOTE]
152-
> The git hooks will check your code is properly formatted before commiting it.
153-
> This is done both to avoid future merge conflict and ensure an uniformity inside the code base.
148+
> The git hooks will check that your code is properly formatted before commiting.
149+
> This is done both to avoid future merge conflict and ensure uniformity inside the code base.
154150
155-
Finally, configure git to automatically update submodules:
151+
* Configure git to automatically update submodules.
156152
```bash
157153
git config --local submodule.recurse true
158154
```
@@ -163,42 +159,42 @@ git config --local submodule.recurse true
163159
164160
> [!TIP]
165161
> This will keep the submodule in `dd-java-agent/agent-jmxfetch/integrations-core` up-to-date.
166-
> There is also an automated check when opening a pull request if you are trying to submit an module version change (usually an outdated version).
162+
> There is also an automated check when opening a pull request if you are trying to submit a module version change (usually an outdated version).
167163
168164
> [!NOTE]
169-
> Both git configurations (hooks and submodule) will only be applied to the project and won't apply globally to your setup.
165+
> Both git configurations (hooks and submodule) will only be applied to this project and won't apply globally in your setup.
170166
171167
### Check your development environment
172168

173-
If you properly followed this guide, the `setup.sh` script at the project root should run without issue, confirming everything is properly setup.
169+
You can confirm that your development environment is properly set up using the [quick check](#development-environment-quick-check) `setup.sh` script.
174170

175171
> [!NOTE]
176172
> The `setup.sh` script is only available for MacOS and Linux.
177173
178174
### Build the project
179175

180-
Now everything is setup, you can then move the next section to start a build, or check [the contribution guidelines](CONTRIBUTING.md).
176+
After everything is properly set up, you can move on to the next section to start a build or check [the contribution guidelines](CONTRIBUTING.md).
181177

182-
## Building commands
178+
## Project build
183179

184-
To build the project without running tests run:
180+
To build the project without running tests, run:
185181
```bash
186182
./gradlew clean assemble
187183
```
188184

189-
To build the entire project with tests (this can take a very long time) run:
185+
To build the entire project with tests (this can take a very long time), run:
190186
```bash
191187
./gradlew clean build
192188
```
193189

194190
>[!NOTE]
195191
> Running the complete test suite on a local development environment can be challenging.
196-
> It might take a very long time, and you might encounter few flaky tests along the way.
197-
> It is recommended to only run the tests related to your changes locally, and leave the whole test suite to the continuous integration platform.
192+
> It may take a very long time, and you might encounter a few flaky tests along the way.
193+
> It is recommended to only run the tests related to your changes locally and leave running the whole test suite to the continuous integration platform.
198194
199-
To build the JVM agent artifact only run:
195+
To build the JVM agent artifact only, run:
200196
```bash
201197
./gradlew :dd-java-agent:shadowJar
202198
```
203199

204-
After building the project, you can find the built JVM agent artifact into the `dd-java-agent/build/libs` folder.
200+
After building the project, you can find the built JVM agent artifact in the `dd-java-agent/build/libs` folder.

0 commit comments

Comments
 (0)