Skip to content

Commit 25d66fa

Browse files
authored
Merge branch 'master' into adrien.boitreaud/revert-pr-8553
2 parents b907d31 + 1877c67 commit 25d66fa

636 files changed

Lines changed: 13783 additions & 7555 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
## Claude Code workflow
44

55
- Before creating a pull request, run `/techdebt` to check for technical debt, code duplication, and unnecessary complexity in the branch changes.
6+
- Always write new unit tests using JUnit 5 and Java. If the target test file is `.groovy`, run the `/migrate-groovy-to-java` skill on it first.

.claude/skills/add-apm-integrations/SKILL.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ Conventions to enforce:
7878
- Declare `contextStore()` entries if context stores are needed (key class → value class)
7979
- Keep method matchers as narrow as possible (name, parameter types, visibility)
8080

81+
### Must NOT do in InstrumenterModule
82+
83+
- **Do not extract one-shot method return values into static constants.**
84+
Methods like `triggerClasses()`, `contextStore()`, `classLoaderMatcher()`, and `methodAdvice()`
85+
are called **once** by `AgentInstaller` / the framework wiring. Extracting their return value
86+
into a `private static final` constant provides no performance benefit and needlessly bloats
87+
the constant pool of the instrumentation class.
88+
89+
`private static final String[] TRIGGER_CLASSES = new String[]{"com.example.Foo"};`
90+
`public String[] triggerClasses() { return TRIGGER_CLASSES; }`
91+
92+
`public String[] triggerClasses() { return new String[]{"com.example.Foo"}; }`
93+
8194
## Step 6 – Write the Decorator
8295

8396
- Extend the most specific available base decorator:
@@ -200,6 +213,7 @@ Output this checklist and confirm each item is satisfied:
200213
- [ ] `helperClassNames()` lists ALL referenced helpers (including inner, anonymous, and enum synthetic classes)
201214
- [ ] Advice methods are `static` with `@Advice.OnMethodEnter` / `@Advice.OnMethodExit` annotations
202215
- [ ] `suppress = Throwable.class` on enter/exit (unless the hooked method is a constructor)
216+
- [ ] No static constants holding return values of one-shot instrumenter methods (`triggerClasses()`, `contextStore()`, etc.)
203217
- [ ] No logger field in the Advice class or InstrumenterModule class
204218
- [ ] No `inline=false` left in production code
205219
- [ ] No `java.util.logging.*` / `java.nio.*` / `javax.management.*` in bootstrap path

.claude/skills/migrate-groovy-to-java/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Migrate test Groovy files to Java using JUnit 5
1212
2. Convert Groovy files to Java using JUnit 5
1313
3. Make sure the tests are still passing after migration and that the test count has not changed
1414
4. Remove Groovy files
15-
5. Add the migrated module path(s) to `.github/g2j-migrated-modules.txt`
1615

1716
When converting Groovy code to Java code, make sure that:
1817
- The Java code generated is compatible with JDK 8
@@ -31,6 +30,8 @@ When converting Groovy code to Java code, make sure that:
3130
- Do not mark local variables `final`
3231
- Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times
3332
- When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations
33+
- Keep inline comments
34+
- Migrate the named Spock clauses if they exist as inline comments in the Java unit test
3435

3536
TableTest usage
3637
Import: `import org.tabletest.junit.TableTest;`

.github/CODEOWNERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
/dd-smoke-tests/vertx-*/ @DataDog/apm-idm-java
2222
/dd-smoke-tests/wildfly/ @DataDog/apm-idm-java
2323

24-
# @DataDog/apm-release-platform
25-
/.gitlab/ @DataDog/apm-release-platform
26-
/.gitlab-ci.yml @DataDog/apm-release-platform
27-
2824
# @DataDog/apm-sdk-capabilities-java
2925
/dd-java-agent/agent-otel @DataDog/apm-sdk-capabilities-java
3026
/dd-smoke-tests/log-injection @DataDog/apm-sdk-capabilities-java
@@ -56,6 +52,8 @@
5652

5753
# @DataDog/apm-lang-platform-java
5854
/.github/ @DataDog/apm-lang-platform-java
55+
/.gitlab/ @DataDog/apm-lang-platform-java
56+
/.gitlab-ci.yml @DataDog/apm-lang-platform-java
5957
/benchmark/ @DataDog/apm-lang-platform-java
6058
/components/ @DataDog/apm-lang-platform-java
6159
/dd-java-agent/instrumentation/java/ @DataDog/apm-lang-platform-java
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/check-pull-request-labels\.yaml@refs/(pull/[0-9]+/merge|heads/.+)
8+
9+
permissions:
10+
issues: write
11+
pull_requests: write
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/check-pull-requests\.yaml@refs/(pull/[0-9]+/merge|heads/.+)
8+
9+
permissions:
10+
issues: write
11+
pull_requests: write
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/comment-on-submodule-update\.yaml@refs/(pull/[0-9]+/merge|heads/.+)
8+
9+
permissions:
10+
issues: write
11+
pull_requests: write
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: 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-groovy-migration\.yaml@refs/(pull/[0-9]+/merge|heads/.+)
8+
9+
permissions:
10+
contents: read
11+
issues: write
12+
pull_requests: write
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject_pattern: "repo:DataDog/dd-trace-java:ref:refs/(heads|tags)/.*"
4+
5+
claim_pattern:
6+
event_name: (release|workflow_dispatch)
7+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/update-issues-on-release\.yaml@refs/(heads/.*|tags/.*)
8+
9+
permissions:
10+
issues: write

0 commit comments

Comments
 (0)