Skip to content

Commit c96976b

Browse files
Merge branch 'master' into alexeyk/docker-image-substitutor
2 parents ea791bf + 2fa3c0c commit c96976b

5,879 files changed

Lines changed: 280948 additions & 219944 deletions

File tree

Some content is hidden

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

.claude/CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@../AGENTS.md
2+
3+
## Claude Code workflow
4+
5+
- Before creating a pull request, run `/techdebt` to check for technical debt, code duplication, and unnecessary complexity in the branch changes.

.claude/skills/techdebt/SKILL.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: techdebt
3+
description: Analyze branch changes for technical debt, code duplication, and unnecessary complexity
4+
user-invocable: true
5+
context: fork
6+
allowed-tools:
7+
- Bash
8+
- Read
9+
- Grep
10+
- Glob
11+
---
12+
13+
# Techdebt Cleanup Skill
14+
15+
Analyze changes on the current branch to identify and fix technical debt, code duplication, and unnecessary complexity.
16+
17+
## Instructions
18+
19+
### Step 1: Get Branch Changes
20+
21+
Find the merge-base (where this branch diverged from master) and compare against it:
22+
23+
```bash
24+
# Find upstream (DataDog org repo)
25+
UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(.git)?\s' | head -1 | awk '{print $1}')
26+
if [ -z "$UPSTREAM" ]; then
27+
echo "No DataDog upstream found, using origin"
28+
UPSTREAM="origin"
29+
fi
30+
31+
# Find the merge-base (commit where this branch diverged from master)
32+
MERGE_BASE=$(git merge-base HEAD ${UPSTREAM}/master)
33+
echo "Comparing changes introduced on this branch since diverging from master using base commit: $MERGE_BASE"
34+
35+
git diff $MERGE_BASE --stat
36+
git diff $MERGE_BASE --name-status
37+
```
38+
39+
If no changes exist, inform the user and stop.
40+
41+
If changes exist, read the diff and the full content of modified source files (not test files) to understand context.
42+
43+
### Step 2: Analyze for Issues
44+
45+
Look for:
46+
47+
**Code Duplication**
48+
- Similar code blocks that should be extracted into shared functions
49+
- Copy-pasted logic with minor variations
50+
51+
**Unnecessary Complexity**
52+
- Over-engineered solutions (abstractions used only once)
53+
- Excessive indirection or layers
54+
- Backward compatibility shims that aren't needed
55+
56+
**Redundant Code**
57+
- Dead code paths
58+
- Overly defensive checks for impossible scenarios
59+
60+
### Step 3: Report and Fix
61+
62+
Present a concise summary of issues found with file:line references.
63+
64+
Then ask the user if they want you to fix the issues. When fixing:
65+
- Make one logical change at a time
66+
- Do NOT change behavior, only refactor
67+
- Skip trivial or stylistic issues

.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/CODEOWNERS

Lines changed: 94 additions & 43 deletions
Large diffs are not rendered by default.

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

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

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,19 @@ updates:
1919
gh-actions-packages:
2020
patterns:
2121
- "*"
22+
23+
- package-ecosystem: "gradle"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
allow:
28+
- dependency-name: "gradle"
29+
ignore:
30+
- dependency-name: "gradle"
31+
update-types: ["version-update:semver-major"]
32+
labels:
33+
- "comp: tooling"
34+
- "tag: dependencies"
35+
- "tag: no release notes"
36+
commit-message:
37+
prefix: "chore(build): "

.github/pull_request_template.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66

77
# Contributor Checklist
88

9-
- Format the title [according the contribution guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#title-format)
10-
- Assign the `type:` and (`comp:` or `inst:`) labels in addition to [any useful labels](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#labels)
11-
- Don't use `close`, `fix` or any [linking keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) when referencing an issue.
9+
- Format the title according to [the contribution guidelines](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#title-format)
10+
- Assign the `type:` and (`comp:` or `inst:`) labels in addition to [any other useful labels](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING.md#labels)
11+
- Avoid using `close`, `fix`, or [any linking keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) when referencing an issue
1212
Use `solves` instead, and assign the PR [milestone](https://github.com/DataDog/dd-trace-java/milestones) to the issue
13-
- Update the [CODEOWNERS](https://github.com/DataDog/dd-trace-java/blob/master/.github/CODEOWNERS) file on source file addition, move, or deletion
14-
- Update the [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) in case of new configuration flag or behavior
13+
- Update the [CODEOWNERS](https://github.com/DataDog/dd-trace-java/blob/master/.github/CODEOWNERS) file on source file addition, migration, or deletion
14+
- Update [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) with any new configuration flags or behaviors
1515

1616
Jira ticket: [PROJ-IDENT]
1717

18+
***Note:*** **Once your PR is ready to merge, add it to the merge queue by commenting `/merge`.** `/merge -c` cancels the queue request. `/merge -f --reason "reason"` skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see [this doc](https://datadoghq.atlassian.net/wiki/spaces/DEVX/pages/3121612126/MergeQueue).
19+
1820
<!--
1921
# Opening vs Drafting a PR:
2022
When opening a pull request, please open it as a draft to not auto assign reviewers before you feel the pull request is in a reviewable state.

.github/workflows/README.md

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ _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+
### enforce-datadog-merge-queue [🔗](enforce-datadog-merge-queue.yaml)
40+
41+
_Trigger:_ When creating or updating a pull request, or when a pull request is added to GitHub merge queue.
42+
43+
_Actions:_
44+
45+
* Pass the `Merge queue check` status check on pull requests so they remain in a mergeable state,
46+
* When a pull request is enqueued in GitHub merge queue, post a `/merge` comment to trigger the Datadog merge queue,
47+
* Fail the `Merge queue check` status check on merge groups to prevent GitHub from merging directly.
48+
49+
_Recovery:_ The workflow is expected to fail to block GitHub merge queue.
50+
This redirects GitHub's "Merge when ready" button to the Datadog merge queue system.
51+
52+
### create-release-branch [🔗](create-release-branch.yaml)
53+
54+
_Trigger:_ When a git tag matching the pattern "vM.N.0" is pushed (e.g. for a minor release).
55+
56+
_Action:_ Create a release branch that corresponds to the pushed tag (e.g. "release/vM.N.x").
57+
58+
_Recovery:_ Manually create the branch from the "vM.N.0" git tag.
59+
3960
### draft-release-notes-on-tag [🔗](draft-release-notes-on-tag.yaml)
4061

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

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

85+
### prune-old-pull-requests [🔗](prune-old-pull-requests.yaml)
86+
87+
_Trigger:_ Every month or manually.
88+
89+
_Action:_ Mark as stale and comment on pull requests with no update during the last quarter.
90+
Close them if no following update within a week.
91+
92+
_Recovery:_ Manually trigger the action again.
93+
6494
### update-docker-build-image [🔗](update-docker-build-image.yaml)
6595

6696
_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,25 +123,15 @@ _Action:_
93123

94124
_Recovery:_ Check at the milestone for the related issues and update them manually.
95125

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-
106126
## Code Quality and Security
107127

108128
### analyze-changes [🔗](analyze-changes.yaml)
109129

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

112132
_Action:_
113133

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`,
134+
* Run [GitHub CodeQL](https://codeql.github.com/) action, upload result to GitHub security tab -- do not apply to pull request, only to `master`,
115135
* Run [Trivy security scanner](https://github.com/aquasecurity/trivy) on built artifacts and upload result to GitHub security tab and Datadog Code Analysis.
116136

117137
_Notes:_ Results are sent on both production and staging environments.
@@ -122,14 +142,6 @@ _Trigger:_ When creating a PR commits to `master` or a `release/*` branch with a
122142

123143
_Action:_ Notify the PR author through comments that about the Git Submodule update.
124144

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-
133145
### run-system-tests [🔗](run-system-tests.yaml)
134146

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

139151
_Recovery:_ Manually trigger the action on the desired branch.
140152

153+
### update-gradle-dependencies [🔗](update-gradle-dependencies.yaml)
154+
155+
_Trigger:_ Every week or manually.
156+
157+
_Action:_ Create a PR updating the Grade dependencies and their locking files.
158+
159+
_Recovery:_ Manually trigger the action again.
160+
141161
### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml)
142162

143163
_Trigger:_ Monthly or manually

0 commit comments

Comments
 (0)