Skip to content

Commit 6f31e99

Browse files
authored
Merge branch 'master' into mattalp/ff-v1.39.1-profiler-version-bump
2 parents e72240d + 043adb2 commit 6f31e99

File tree

1,271 files changed

+22872
-18453
lines changed

Some content is hidden

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

1,271 files changed

+22872
-18453
lines changed

.circleci/config.continue.yml.j2

Lines changed: 16 additions & 22 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 15713a66e48f82b7d995cea2eb6eb78bec0270df
39+
default_system_tests_commit: &default_system_tests_commit c87bd359aad64a29f280fc5c70a879f7c7f4846e
4040

4141
parameters:
4242
nightly:
@@ -54,7 +54,7 @@ parameters:
5454
global_pattern:
5555
# Pattern for files that should always trigger a test jobs
5656
type: string
57-
default: "^build.gradle$|^settings.gradle$|^gradle.properties$|^buildSrc/|^gradle/|.circleci"
57+
default: "^build.gradle$|^settings.gradle$|^gradle.properties$|^buildSrc/|^gradle/|.circleci|^gradlew|^mvnw|^.mvn/"
5858

5959
docker_image:
6060
type: string
@@ -273,13 +273,6 @@ commands:
273273
git fetch origin << parameters.systemTestsCommit >>
274274
git reset --hard FETCH_HEAD
275275

276-
- run:
277-
name: Install python 3.12
278-
command: |
279-
sudo apt-get update
280-
sudo apt-get install -y python3.12-full python3.12-dev python3.12-venv
281-
echo 'export PATH="$HOME/.local/bin:$PATH"' >>"$BASH_ENV"
282-
283276
jobs:
284277
build:
285278
<<: *defaults
@@ -310,7 +303,7 @@ jobs:
310303
name: Build Project
311304
command: >-
312305
{% if is_nightly %}
313-
./gradlew resolveAndLockAll --write-locks
306+
./gradlew resolveAndLockAll --write-locks &&
314307
{% endif %}
315308
MAVEN_OPTS="-Xms64M -Xmx256M"
316309
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2560M -Xms2560M -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
@@ -667,7 +660,8 @@ jobs:
667660
- DD_POOL_TRACE_CHECK_FAILURES=true
668661
- DD_DISABLE_ERROR_RESPONSES=true
669662
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
670-
resource_class: xlarge
663+
# TODO: merge xlarge_tests and tests? or rename this?
664+
resource_class: large
671665

672666

673667
# The only way to do fan-in in CircleCI seems to have a proper job, so let's have one that
@@ -1106,8 +1100,8 @@ build_test_jobs: &build_test_jobs
11061100
triggeredBy: *instrumentation_modules
11071101
stage: instrumentation
11081102
cacheType: inst
1109-
parallelism: 4
1110-
maxWorkers: 4
1103+
parallelism: 12
1104+
maxWorkers: 3
11111105
matrix:
11121106
<<: *test_matrix
11131107
@@ -1120,8 +1114,8 @@ build_test_jobs: &build_test_jobs
11201114
triggeredBy: *instrumentation_modules
11211115
stage: instrumentation
11221116
cacheType: inst
1123-
parallelism: 4
1124-
maxWorkers: 4
1117+
parallelism: 12
1118+
maxWorkers: 3
11251119
testJvm: "8"
11261120
11271121
- xlarge_tests:
@@ -1134,8 +1128,8 @@ build_test_jobs: &build_test_jobs
11341128
triggeredBy: *instrumentation_modules
11351129
stage: instrumentation
11361130
cacheType: latestdep
1137-
parallelism: 4
1138-
maxWorkers: 4
1131+
parallelism: 12
1132+
maxWorkers: 3
11391133
testJvm: "8"
11401134
11411135
- xlarge_tests:
@@ -1148,8 +1142,8 @@ build_test_jobs: &build_test_jobs
11481142
triggeredBy: *instrumentation_modules
11491143
stage: instrumentation
11501144
cacheType: latestdep
1151-
parallelism: 4
1152-
maxWorkers: 4
1145+
parallelism: 12
1146+
maxWorkers: 3
11531147
testJvm: "17"
11541148
11551149
- xlarge_tests:
@@ -1162,8 +1156,8 @@ build_test_jobs: &build_test_jobs
11621156
triggeredBy: *instrumentation_modules
11631157
stage: instrumentation
11641158
cacheType: latestdep
1165-
parallelism: 4
1166-
maxWorkers: 4
1159+
parallelism: 12
1160+
maxWorkers: 3
11671161
testJvm: "21"
11681162
11691163
{% if flaky %}
@@ -1191,7 +1185,7 @@ build_test_jobs: &build_test_jobs
11911185
triggeredBy: *instrumentation_modules
11921186
stage: instrumentation
11931187
cacheType: inst
1194-
parallelism: 2
1188+
parallelism: 12
11951189
maxWorkers: 4
11961190
testJvm: "8"
11971191

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ dd-java-agent/instrumentation/*iast* @DataDog/asm-java
4545
dd-java-agent/instrumentation/*appsec* @DataDog/asm-java
4646
dd-java-agent/instrumentation/json/ @DataDog/asm-java
4747
dd-java-agent/instrumentation/snakeyaml/ @DataDog/asm-java
48+
dd-java-agent/instrumentation/velocity/ @DataDog/asm-java
49+
dd-java-agent/instrumentation/freemarker/ @DataDog/asm-java
4850
dd-smoke-tests/iast-util/ @DataDog/asm-java
4951
dd-smoke-tests/spring-security/ @DataDog/asm-java
5052
dd-java-agent/instrumentation/commons-fileupload/ @DataDog/asm-java
@@ -53,6 +55,9 @@ dd-java-agent/instrumentation/spring-security-5/ @DataDog/asm-java
5355
**/iast/ @DataDog/asm-java
5456
**/Iast*.java @DataDog/asm-java
5557
**/Iast*.groovy @DataDog/asm-java
58+
**/rasp/ @Datadog/asm-java
59+
**/*Rasp*.java @DataDog/asm-java
60+
**/*Rasp*.groovy @DataDog/asm-java
5661

5762
# @DataDog/data-jobs-monitoring
5863
dd-java-agent/instrumentation/spark/ @DataDog/data-jobs-monitoring

.github/workflows/README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GitHub Actions Documentation
22

3-
This lists and describes the repository GitHub actions.
3+
This lists and describes the repository GitHub actions, how to maintain and test them.
44

55
## Release Management
66

@@ -18,15 +18,16 @@ _Trigger:_ When a release is published.
1818

1919
_Action:_ Append the new release to the Cloud Foundry repository.
2020

21-
_Recovery:_ Manually edit and push the `index.yml`file from [the cloudfoundry branch](https://github.com/DataDog/dd-trace-java/tree/cloudfoundry).
21+
_Recovery:_ Manually edit and push the `index.yml` file from [the cloudfoundry branch](https://github.com/DataDog/dd-trace-java/tree/cloudfoundry).
2222

2323
### create-next-milestone [🔗](create-next-milestone.yaml)
2424

2525
_Trigger:_ When closing a milestone.
2626

2727
_Action:_ Create a new milestone by incrementing minor version.
2828

29-
_Comment:_ Already done when closing a tag. To delete?
29+
_Comment:_ Disabled as also covered by increment-milestone-on-tag.
30+
This will be removed after some testing.
3031

3132
### draft-release-notes-on-tag [🔗](draft-release-notes-on-tag.yaml)
3233

@@ -40,18 +41,17 @@ _Actions:_
4041

4142
_Recovery:_ Manually trigger the action again on the relevant tag.
4243

43-
### increment-milestones-on-tag [🔗](increment-milestones-on-tag.yaml)
44+
### increment-milestone-on-tag [🔗](increment-milestone-on-tag.yaml)
4445

45-
_Trigger:_ When creating a tag. Release Candidate tags containing "-RC" or "-rc" will skip this.
46+
_Trigger:_ When creating a minor or major version tag.
4647

4748
_Actions:_
4849
* Close the milestone related to the tag,
4950
* Create a new milestone by incrementing minor version.
5051

51-
_Recovery:_ Manually close the related milestone and create a new one.
52+
_Recovery:_ Manually [close the related milestone and create a new one](https://github.com/DataDog/dd-trace-java/milestones).
5253

53-
_Notes:_ This actions will handle _minor_ releases only.
54-
As there is no milestone for _patch_ releases, it won't close and create _patch_ releated milestone.
54+
_Notes:_ This action will not apply to release candidate versions using `-RC` tags.
5555

5656
### update-download-releases [🔗](update-download-releases.yaml)
5757

@@ -117,3 +117,12 @@ Run the following script to get the list of actions to declare according the sta
117117
```bash
118118
find .github/workflows -name "*.yaml" -exec awk '/uses:/{print $2 ","}' {} \; | grep -vE '^(actions|github)/' | sort | uniq
119119
```
120+
121+
## Testing
122+
123+
Workflows can be locally tested using the [`act` CLI](https://github.com/nektos/act/).
124+
The [.github/workflows/tests/](./tests) folder contains test scripts and event payloads to locally trigger workflows.
125+
126+
> [!WARNING]
127+
> Locally running workflows will still query GitHub backend and will update the GitHub project accordingly.
128+
> Pay extra attention to the workflow jobs you trigger to not create development disruption.

.github/workflows/add-milestone-to-pull-requests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
add_milestone_to_merged:
1010
name: Add milestone to merged pull requests
1111
permissions:
12-
issues: read # Required to list milestones
12+
issues: write # Required to update a pull request using the issues API
1313
pull-requests: write # Required to update the milestone of a pull request
1414
if: github.event.pull_request.merged && github.event.pull_request.milestone == null
1515
runs-on: ubuntu-latest

.github/workflows/analyze-changes.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
with:
4545
submodules: 'recursive'
4646

47-
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
47+
- name: Cache Gradle dependencies
48+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
4849
with:
4950
path: |
5051
~/.gradle/caches
@@ -97,7 +98,8 @@ jobs:
9798
with:
9899
submodules: 'recursive'
99100

100-
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
101+
- name: Cache Gradle dependencies
102+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
101103
with:
102104
path: |
103105
~/.gradle/caches

.github/workflows/comment-on-submodule-update.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
comment_on_submodule_update:
1313
permissions:
1414
issues: write # Required to create a comment on the pull request
15+
pull-requests: write # Required to create a comment on the pull request
1516
runs-on: ubuntu-latest
1617

1718
steps:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Increment milestones on tag
2+
on:
3+
create
4+
permissions:
5+
issues: write # Required to update milestones
6+
7+
jobs:
8+
increment_milestone:
9+
if: github.event.ref_type == 'tag' && contains(github.event.ref,'-RC') == false
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Close current milestone
13+
id: close-milestone
14+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 7.0.1
15+
with:
16+
script: |
17+
// Get the milestone title ("X.Y.Z") from tag name ("vX.Y.Z")
18+
const match = '${{github.event.ref}}'.match(/v(\d+\.\d+\.\d+)/i)
19+
if (!match) {
20+
core.setFailed('Failed to parse tag name into milestone title: ${{github.event.ref}}')
21+
return
22+
}
23+
const milestoneTitle = match[1]
24+
// Look for the milestone from its title
25+
const response = await github.rest.issues.listMilestones({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
state: 'open'
29+
})
30+
if (!response.data || response.data.length == 0) {
31+
core.setFailed(`Failed to list milestones: ${response.status}`)
32+
return
33+
}
34+
const milestone = response.data.find(milestone => milestone.title == milestoneTitle)
35+
if (!milestone) {
36+
core.setFailed(`Failed to find milestone: ${milestoneTitle}`)
37+
return
38+
}
39+
// Close the milestone
40+
await github.rest.issues.updateMilestone({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
state: 'closed',
44+
milestone_number: milestone.number
45+
}).catch(error => {
46+
core.setFailed(`Failed to close milestone: ${error}`)
47+
})
48+
// Compute the next milestone version
49+
const versionNumbers = milestoneTitle.split('.').map(Number)
50+
if (versionNumbers[2] != 0) {
51+
core.info('Closing a patch version milestone. Not opening a new one.')
52+
return
53+
}
54+
versionNumbers[1]++
55+
const nextMilestoneTitle = versionNumbers.join('.')
56+
core.info(`Creating next version milestone: ${nextMilestoneTitle}`)
57+
// Create the next milestone
58+
await github.issues.createMilestone({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
title: nextMilestoneTitle
62+
}).catch(error => {
63+
core.setFailed(`Failed to create milestone ${nextMilestoneTitle}: ${error}`)
64+
})

.github/workflows/increment-milestones-on-tag.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"pull_request": {
3+
"number": 7549,
4+
"base": {
5+
"ref": "master"
6+
},
7+
"merged": true
8+
}
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
source "$(dirname "$0")/../env.sh"
3+
testworkflow pull_request

0 commit comments

Comments
 (0)