Skip to content

Commit c0a51a9

Browse files
authored
Merge branch 'master' into mtoff/otlp-traces-exporter-config
2 parents 4c9228d + 9352dfa commit c0a51a9

130 files changed

Lines changed: 2262 additions & 1264 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/skills/migrate-groovy-to-java/SKILL.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ When converting Groovy code to Java code, make sure that:
3232
- When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations
3333

3434
TableTest usage
35-
Dependency, if missing add:
36-
- Groovy: testImplementation libs.tabletest
37-
- Kotlin: testImplementation(libs.tabletest)
38-
3935
Import: `import org.tabletest.junit.TableTest;`
4036

4137
JDK 8 rules:

.claude/skills/migrate-junit-source-to-tabletest/SKILL.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ Process (do in this order):
1111
4) Write each modified file once in full using Write (no incremental per-test edits).
1212
5) Run module tests once and verify "BUILD SUCCESSFUL". If failed, inspect JUnit XML report.
1313

14-
Dependency:
15-
- If missing, add:
16-
- Groovy: testImplementation libs.tabletest
17-
- Kotlin: testImplementation(libs.tabletest)
18-
1914
Import: `import org.tabletest.junit.TableTest;`
2015

2116
JDK 8 rules:
@@ -34,6 +29,7 @@ Table formatting rules (mandatory):
3429
- Use '|' as delimiter.
3530
- Align columns with spaces so pipes line up vertically.
3631
- Prefer single quotes for strings requiring quotes (e.g., 'a|b', '[]', '{}', ' ').
32+
- Use value sets (`{a, b, c}`) instead of matrix-style repetition when only one dimension varies across otherwise-identical rows.
3733

3834
Conversions:
3935
A) @CsvSource
@@ -42,7 +38,8 @@ A) @CsvSource
4238
- If delimiter is ',' (default): replace ',' with '|' in rows.
4339

4440
B) @ValueSource
45-
- Convert to @TableTest with header from parameter name.
41+
- Keep single-parameter tests on `@ValueSource` (and `@NullSource` when null cases are needed).
42+
- Otherwise convert to @TableTest with header from parameter name.
4643
- Each value becomes one row.
4744
- Add "scenario" column using common sense for name.
4845

@@ -60,6 +57,11 @@ C) @MethodSource (convert only if values are representable as strings)
6057
- '' = empty string.
6158
- For String params that start with '[' or '{', quote to avoid collection parsing (prefer '[]'/'{}').
6259

60+
D) @TypeConverter
61+
- Use `@TypeConverter` for symbolic constants used by migrated table rows (e.g. `Long.MAX_VALUE`, `DDSpanId.MAX`).
62+
- Prefer explicit one-case-one-return mappings.
63+
- Prefer shared converter utilities (e.g. in `utils/test-utils`) when reuse across modules is likely.
64+
6365
Scenario handling:
6466
- If MethodSource includes a leading description string OR @ParameterizedTest(name=...) uses {0}, convert that to a scenario column and remove that parameter from method signature.
6567

.github/workflows/analyze-changes.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
33+
uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
3434
with:
3535
languages: 'java'
3636
build-mode: 'manual'
@@ -43,7 +43,7 @@ jobs:
4343
./gradlew clean :dd-java-agent:shadowJar --build-cache --parallel --stacktrace --no-daemon --max-workers=4
4444
4545
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
46-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
46+
uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
4747

4848
trivy:
4949
name: Analyze changes with Trivy
@@ -102,7 +102,7 @@ jobs:
102102
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
103103

104104
- name: Upload Trivy scan results to GitHub Security tab
105-
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
105+
uses: github/codeql-action/upload-sarif@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
106106
if: always()
107107
with:
108108
sarif_file: 'trivy-results.sarif'

.github/workflows/enforce-groovy-migration.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
types: [opened, edited, ready_for_review, labeled, unlabeled, synchronize]
55
branches:
66
- master
7+
- 'release/v*'
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}

.gitlab/collect_results.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ WORKSPACE_DIR=workspace
1212
mkdir -p $TEST_RESULTS_DIR
1313
mkdir -p $WORKSPACE_DIR
1414

15-
mapfile -t TEST_RESULT_DIRS < <(find $WORKSPACE_DIR -name test-results -type d)
15+
# Main project modules redirect their build directory to workspace/<project-path>/build/ in CI
16+
# (see build.gradle.kts layout.buildDirectory override). buildSrc is a separate Gradle build
17+
# that runs before the main build is configured, so this redirect never applies to it;
18+
# its test results always land in buildSrc/**/build/test-results/, not under workspace/.
19+
SEARCH_DIRS=($WORKSPACE_DIR buildSrc)
20+
21+
mapfile -t TEST_RESULT_DIRS < <(find "${SEARCH_DIRS[@]}" -name test-results -type d)
1622

1723
if [[ ${#TEST_RESULT_DIRS[@]} -eq 0 ]]; then
1824
echo "No test results found"

buildSrc/src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ internal open class GradleFixture(protected val projectDir: File) {
2323
*/
2424
fun run(vararg args: String, expectFailure: Boolean = false, env: Map<String, String> = emptyMap()): BuildResult {
2525
val runner = GradleRunner.create()
26-
.withTestKitDir(File(projectDir, ".gradle-test-kit"))
26+
// Use a testkit dir scoped to this fixture's projectDir. The Tooling API always uses a
27+
// daemon and ignores org.gradle.daemon=false. By giving each test its own testkit dir,
28+
// we force a fresh daemon per test — ensuring withEnvironment() vars (e.g.
29+
// MAVEN_REPOSITORY_PROXY) are correctly set on the daemon JVM and not inherited from
30+
// a previously-started daemon with a different test's environment.
31+
.withTestKitDir(file(".testkit"))
2732
.withPluginClasspath()
2833
.withProjectDir(projectDir)
2934
.withEnvironment(System.getenv() + env)

components/http/http-api/src/main/java/datadog/http/client/HttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public interface HttpClient {
4141
* @return a new http client builder
4242
*/
4343
static Builder newBuilder() {
44-
return HttpProviders.newClientBuilder();
44+
return HttpProviders.get().newClientBuilder();
4545
}
4646

4747
/** Builder for constructing {@link HttpClient} instances. */
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package datadog.http.client;
2+
3+
import java.net.URI;
4+
import java.nio.ByteBuffer;
5+
import java.util.List;
6+
7+
/** Factory class providing the various HTTP client class implementations. */
8+
public abstract class HttpProvider {
9+
public abstract HttpClient.Builder newClientBuilder();
10+
11+
public abstract HttpRequest.Builder newRequestBuilder();
12+
13+
public abstract HttpUrl.Builder newUrlBuilder();
14+
15+
public abstract HttpUrl httpUrlParse(String url);
16+
17+
public abstract HttpUrl httpUrlFrom(URI uri);
18+
19+
public abstract HttpRequestBody requestBodyOfString(String content);
20+
21+
public abstract HttpRequestBody requestBodyOfBytes(byte[] bytes);
22+
23+
public abstract HttpRequestBody requestBodyOfByteBuffers(List<ByteBuffer> buffers);
24+
25+
public abstract HttpRequestBody requestBodyGzip(HttpRequestBody body);
26+
27+
public abstract HttpRequestBody.MultipartBuilder requestBodyMultipart();
28+
}

0 commit comments

Comments
 (0)