Skip to content

Commit 095d027

Browse files
Merged with master.
2 parents 9510177 + b3c7215 commit 095d027

File tree

764 files changed

+7839
-6315
lines changed

Some content is hidden

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

764 files changed

+7839
-6315
lines changed

.editorconfig

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,54 @@ end_of_line=lf
77
insert_final_newline=true
88
indent_style=space
99
indent_size=2
10-
11-
[*.json]
12-
indent_style=space
13-
indent_size=2
10+
ij_continuation_indent_size=4
1411

1512
[*.java]
16-
indent_style=space
17-
indent_size=2
18-
continuation_indent_size=4
13+
ij_java_class_count_to_use_import_on_demand = 99
14+
ij_java_insert_inner_class_imports = false
15+
ij_java_imports_layout = |,$*,|,*,|
16+
ij_java_layout_on_demand_import_from_same_package_first = true
17+
ij_java_layout_static_imports_separately = true
18+
ij_java_names_count_to_use_import_on_demand = 99
19+
ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.*
20+
21+
22+
ij_java_block_comment_add_space = false
23+
ij_java_block_comment_at_first_column = false
24+
ij_java_line_comment_add_space = true
25+
ij_java_line_comment_add_space_on_reformat = false
26+
ij_java_line_comment_at_first_column = false
27+
28+
29+
[{*.groovy,*.gradle}]
30+
ij_groovy_class_count_to_use_import_on_demand = 99
31+
ij_groovy_imports_layout = $*,|,*,|
32+
ij_groovy_names_count_to_use_import_on_demand = 99
33+
ij_groovy_packages_to_use_import_on_demand = java.awt.*,javax.swing.*
34+
35+
ij_groovy_block_comment_add_space = false
36+
ij_groovy_block_comment_at_first_column = false
37+
ij_groovy_line_comment_add_space = true
38+
ij_groovy_line_comment_add_space_on_reformat = false
39+
ij_groovy_line_comment_at_first_column = false
40+
41+
[{*.kt,*.kts}]
42+
ij_kotlin_import_nested_classes = false
43+
ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
44+
45+
ij_kotlin_name_count_to_use_star_import = 99
46+
ij_kotlin_name_count_to_use_star_import_for_members = 99
47+
ij_kotlin_packages_to_use_import_on_demand = kotlinx.android.synthetic.**,io.ktor.**
48+
49+
ij_kotlin_block_comment_add_space = false
50+
ij_kotlin_block_comment_at_first_column = false
51+
ij_kotlin_line_comment_add_space = true
52+
ij_kotlin_line_comment_add_space_on_reformat = false
53+
ij_kotlin_line_comment_at_first_column = false
54+
1955

2056
[{*.yml,*.yaml}]
21-
indent_style=space
22-
indent_size=2
57+
ij_yaml_line_comment_add_space = true
58+
ij_yaml_line_comment_add_space_on_reformat = false
59+
ij_yaml_line_comment_at_first_column = false
2360

.github/chainguard/self.add-release-to-cloudfoundry.sts.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject_pattern: repo:DataDog/dd-trace-java:ref:refs/(heads/master|tags/v[0-9]+.[0-9]+.0)
4+
5+
claim_pattern:
6+
event_name: (push|workflow_dispatch)
7+
ref: refs/(heads/master|tags/v[0-9]+\.[0-9]+\.0)
8+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/create-release-branch\.yaml@refs/heads/master
9+
10+
permissions:
11+
contents: write
12+
pull_requests: write

.github/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ _Recovery:_ Manually trigger the action again.
107107

108108
### analyze-changes [🔗](analyze-changes.yaml)
109109

110-
_Trigger:_ When pushing commits to `master`.
110+
_Trigger:_ Every day or manually.
111111

112112
_Action:_
113113

114-
* Run [GitHub CodeQL](https://codeql.github.com/) action, upload result to GitHub security tab -- do not apply to pull request, only when pushing to `master`,
114+
* Run [GitHub CodeQL](https://codeql.github.com/) action, upload result to GitHub security tab -- do not apply to pull request, only to `master`,
115115
* Run [Trivy security scanner](https://github.com/aquasecurity/trivy) on built artifacts and upload result to GitHub security tab and Datadog Code Analysis.
116116

117117
_Notes:_ Results are sent on both production and staging environments.

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
git commit -a -m "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
5757
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5858
- name: Push changes
59-
uses: DataDog/commit-headless@1186485b788f57eedaaadb19919781698b4d262f # action/v1.0.0
59+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
6060
if: ${{ steps.create-commit.outputs.commit != '' }}
6161
with:
6262
branch: cloudfoundry

.github/workflows/analyze-changes.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
name: Analyze changes
22

33
on:
4-
push:
5-
branches: [ master ]
6-
7-
# Cancel long-running jobs when a new commit is pushed
8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: true
4+
schedule:
5+
- cron: "0 20 * * *"
6+
workflow_dispatch:
117

128
jobs:
139
codeql:
@@ -34,7 +30,7 @@ jobs:
3430
${{ runner.os }}-gradle-
3531
3632
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
33+
uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
3834
with:
3935
languages: 'java'
4036
build-mode: 'manual'
@@ -53,7 +49,7 @@ jobs:
5349
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5450
5551
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
56-
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
52+
uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
5753

5854
trivy:
5955
name: Analyze changes with Trivy
@@ -118,7 +114,7 @@ jobs:
118114
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
119115

120116
- name: Upload Trivy scan results to GitHub Security tab
121-
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
117+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
122118
if: always()
123119
with:
124120
sarif_file: 'trivy-results.sarif'
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Create Release Branch and Pin System-Tests
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.0' # Trigger on minor release tags (e.g. v1.54.0)
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'The minor release tag (e.g. v1.54.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
create-release-branch:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # Allow pushing the empty release branch
19+
id-token: write # Required for OIDC token federation
20+
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.push
26+
27+
- name: Determine tag
28+
id: determine-tag
29+
run: |
30+
if [ -n "${{ github.event.inputs.tag }}" ]; then
31+
TAG=${{ github.event.inputs.tag }}
32+
else
33+
TAG=${GITHUB_REF#refs/tags/}
34+
fi
35+
if ! [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then
36+
echo "Error: Tag $TAG is not in the expected format: vX.Y.0"
37+
exit 1
38+
fi
39+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
40+
41+
- name: Define branch name from tag
42+
id: define-branch
43+
run: |
44+
TAG=${{ steps.determine-tag.outputs.tag }}
45+
BRANCH="release/${TAG%.0}.x"
46+
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
47+
48+
- name: Checkout dd-trace-java at tag
49+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
50+
with:
51+
ref: ${{ github.sha }}
52+
53+
- name: Check if branch already exists
54+
id: check-branch
55+
run: |
56+
BRANCH=${{ steps.define-branch.outputs.branch }}
57+
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
58+
echo "creating_new_branch=false" >> "$GITHUB_OUTPUT"
59+
echo "Branch $BRANCH already exists - skipping following steps"
60+
else
61+
echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
62+
echo "Branch $BRANCH does not exist - proceeding with following steps"
63+
fi
64+
65+
- name: Create and push empty release branch
66+
if: steps.check-branch.outputs.creating_new_branch == 'true'
67+
run: |
68+
git checkout -b "${{ steps.define-branch.outputs.branch }}"
69+
git push -u origin "${{ steps.define-branch.outputs.branch }}"
70+
71+
- name: Define temp branch name
72+
if: steps.check-branch.outputs.creating_new_branch == 'true'
73+
id: define-temp-branch
74+
run: echo "branch=ci/pin-system-tests-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
75+
76+
- name: Update system-tests references to latest commit SHA on main
77+
if: steps.check-branch.outputs.creating_new_branch == 'true'
78+
run: BRANCH=main ./tooling/update_system_test_reference.sh
79+
80+
- name: Commit changes
81+
if: steps.check-branch.outputs.creating_new_branch == 'true'
82+
id: create-commit
83+
run: |
84+
git config user.name "github-actions[bot]"
85+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
86+
git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml
87+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
88+
89+
- name: Push changes to temp branch
90+
if: steps.check-branch.outputs.creating_new_branch == 'true'
91+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
92+
with:
93+
token: "${{ steps.octo-sts.outputs.token }}"
94+
branch: "${{ steps.define-temp-branch.outputs.branch }}"
95+
head-sha: "${{ github.sha }}"
96+
create-branch: true
97+
command: push
98+
commits: "${{ steps.create-commit.outputs.commit }}"
99+
100+
- name: Create pull request from temp branch to release branch
101+
if: steps.check-branch.outputs.creating_new_branch == 'true'
102+
env:
103+
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
104+
run: |
105+
gh pr create --title "Pin system-tests for ${{ steps.define-branch.outputs.branch }}" \
106+
--base "${{ steps.define-branch.outputs.branch }}" \
107+
--head "${{ steps.define-temp-branch.outputs.branch }}" \
108+
--label "tag: dependencies" \
109+
--label "tag: no release notes" \
110+
--body "This PR pins the system-tests reference for the release branch."

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ jobs:
6060
main:
6161
needs:
6262
- build
63-
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main
63+
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
64+
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned for releases only
6465
secrets: inherit
6566
permissions:
6667
contents: read
6768
id-token: write
6869
packages: write
6970
with:
7071
library: java
72+
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
73+
ref: main # system tests are pinned for releases only
7174
binaries_artifact: binaries
7275
desired_execution_time: 900 # 15 minutes
7376
scenarios_groups: tracer-release

.github/workflows/update-docker-build-image.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@ jobs:
7171
git commit -m "feat(ci): Update Docker build image" .gitlab-ci.yml
7272
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
7373
- name: Push changes
74-
uses: DataDog/commit-headless@1186485b788f57eedaaadb19919781698b4d262f # action/v1.0.0
74+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
7575
if: steps.check-changes.outputs.commit_changes == 'true'
7676
with:
7777
token: "${{ steps.octo-sts.outputs.token }}"
7878
branch: "${{ steps.define-branch.outputs.branch }}"
7979
# for scheduled runs, sha is the tip of the default branch
8080
# for dispatched runs, sha is the tip of the branch it was dispatched on
81-
branch-from: "${{ github.sha }}"
81+
head-sha: "${{ github.sha }}"
82+
create-branch: true
8283
command: push
8384
commits: "${{ steps.create-commit.outputs.commit }}"
8485
- name: Create pull request

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
env:
2727
ORG_GRADLE_PROJECT_akkaRepositoryToken: ${{ secrets.AKKA_REPO_TOKEN }}
2828
run: |
29+
find . -name 'gradle.lockfile' -delete
2930
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
3031
JAVA_HOME=$JAVA_HOME_8_X64 \
3132
JAVA_8_HOME=$JAVA_HOME_8_X64 \
@@ -57,14 +58,15 @@ jobs:
5758
git commit -a -m "chore: Update Gradle dependencies"
5859
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5960
- name: Push changes
60-
uses: DataDog/commit-headless@1186485b788f57eedaaadb19919781698b4d262f # action/v1.0.0
61+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
6162
if: steps.check-changes.outputs.commit_changes == 'true'
6263
with:
6364
token: "${{ steps.octo-sts.outputs.token }}"
6465
branch: "${{ steps.define-branch.outputs.branch }}"
6566
# for scheduled runs, sha is the tip of the default branch
6667
# for dispatched runs, sha is the tip of the branch it was dispatched on
67-
branch-from: "${{ github.sha }}"
68+
head-sha: "${{ github.sha }}"
69+
create-branch: true
6870
command: push
6971
commits: "${{ steps.create-commit.outputs.commit }}"
7072
- name: Create pull request

0 commit comments

Comments
 (0)