Skip to content

Commit 840fcdd

Browse files
Merge remote-tracking branch 'origin/master' into alexeyk/test-base-windows
# Conflicts: # dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/buildid/BuildIdExtractorIntegrationTest.java
2 parents 7d5709d + d36f7e7 commit 840fcdd

952 files changed

Lines changed: 23726 additions & 14386 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ When converting Groovy code to Java code, make sure that:
2020
- `@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup.
2121
- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`.
2222
- If `@TableTest` is not viable for the test at all, use `@MethodSource` only.
23+
- If `@TableTest` was successfully used and if the `@ParameterizedTest` is not used to specify the test name, `@ParameterizedTest` can then be removed as `@TableTest` replace it fully.
2324
- For `@MethodSource`, name the arguments method `<testMethodName>Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream<Arguments>` using `Stream.of(...)` and `arguments(...)` with static import.
2425
- Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first `Arguments.arguments(...)` value or index the test case
2526
- When converting tuples, create a light dedicated structure instead to keep the typing system

.github/CODEOWNERS

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@
4545
/internal-api/src/test/groovy/datadog/trace/api/sampling @DataDog/apm-sdk-capabilities-java
4646

4747
# @DataDog/apm-serverless
48-
/dd-trace-core/src/main/java/datadog/trace/lambda/ @DataDog/apm-serverless
49-
/dd-trace-core/src/test/groovy/datadog/trace/lambda/ @DataDog/apm-serverless
50-
**/InferredProxy*.java @DataDog/apm-serverless
51-
**/InferredProxy*.groovy @DataDog/apm-serverless
48+
/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/ @DataDog/apm-serverless
49+
/dd-java-agent/instrumentation/azure-functions/ @DataDog/apm-serverless
50+
/dd-java-agent/instrumentation/azure-functions-1.2.2/ @DataDog/apm-serverless
51+
/dd-trace-core/src/main/java/datadog/trace/lambda/ @DataDog/apm-serverless
52+
/dd-trace-core/src/test/groovy/datadog/trace/lambda/ @DataDog/apm-serverless
53+
/utils/container-utils/ @DataDog/apm-serverless
54+
**/InferredProxy*.java @DataDog/apm-serverless
55+
**/InferredProxy*.groovy @DataDog/apm-serverless
5256

5357
# @DataDog/apm-lang-platform-java
5458
/.github/ @DataDog/apm-lang-platform-java

.github/dependabot.yml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
12
version: 2
23
updates:
3-
- package-ecosystem: github-actions
4-
directory: /
5-
schedule:
6-
interval: weekly
7-
labels:
8-
- 'comp: tooling'
9-
- 'tag: dependencies'
10-
- 'tag: no release notes'
11-
commit-message:
12-
prefix: 'chore(ci): '
13-
groups:
14-
gh-actions-packages:
15-
patterns:
16-
- '*'
17-
cooldown:
18-
default-days: 14
19-
- package-ecosystem: gradle
20-
directory: /
21-
schedule:
22-
interval: weekly
23-
allow:
24-
- dependency-name: gradle
25-
ignore:
26-
- dependency-name: gradle
27-
update-types:
28-
- version-update:semver-major
29-
labels:
30-
- 'comp: tooling'
31-
- 'tag: dependencies'
32-
- 'tag: no release notes'
33-
commit-message:
34-
prefix: 'chore(build): '
35-
cooldown:
36-
default-days: 14
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
labels:
9+
- 'comp: tooling'
10+
- 'tag: dependencies'
11+
- 'tag: no release notes'
12+
commit-message:
13+
prefix: 'chore(ci): '
14+
groups:
15+
gh-actions-packages:
16+
patterns:
17+
- '*'
18+
cooldown:
19+
default-days: 2
20+
21+
- package-ecosystem: gradle
22+
directory: /
23+
schedule:
24+
interval: weekly
25+
allow:
26+
- dependency-name: gradle
27+
ignore:
28+
- dependency-name: gradle
29+
update-types:
30+
- version-update:semver-major
31+
labels:
32+
- 'comp: tooling'
33+
- 'tag: dependencies'
34+
- 'tag: no release notes'
35+
commit-message:
36+
prefix: 'chore(build): '
37+
cooldown:
38+
default-days: 2

.github/workflows/analyze-changes.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
submodules: 'recursive'
2222
- name: Cache Gradle dependencies
23-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
23+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2424
with:
2525
path: |
2626
~/.gradle/caches
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
33+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
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@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
46+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
4747

4848
trivy:
4949
name: Analyze changes with Trivy
@@ -60,7 +60,7 @@ jobs:
6060
submodules: 'recursive'
6161

6262
- name: Cache Gradle dependencies
63-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
63+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
6464
with:
6565
path: |
6666
~/.gradle/caches
@@ -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@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
105+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
106106
if: always()
107107
with:
108108
sarif_file: 'trivy-results.sarif'

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
fetch-depth: 0
3131

3232
- name: Cache Gradle dependencies
33-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
33+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3434
with:
3535
path: |
3636
~/.gradle/caches
@@ -63,8 +63,6 @@ jobs:
6363
- build
6464
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
6565
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned on release branches only
66-
secrets:
67-
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY_PROD }}
6866
permissions:
6967
contents: read
7068
id-token: write
@@ -78,7 +76,7 @@ jobs:
7876
scenarios_groups: tracer-release
7977
excluded_scenarios: APM_TRACING_E2E_OTEL,APM_TRACING_E2E_SINGLE_SPAN,PROFILING # exclude flaky scenarios
8078
skip_empty_scenarios: true
81-
push_to_test_optimization: true
79+
push_to_test_optimization: false # disabled to avoid pushing to Test Optimization while API key is transitioning to system-tests
8280

8381
# Ensure the main job is run to completion
8482
check:

.gitlab-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ variables:
5252
description: "Enable flaky tests"
5353
value: "false"
5454

55+
# One pipeline injection package size ratchet
56+
OCI_PACKAGE_MAX_SIZE_BYTES: 40_000_000
57+
LIB_INJECTION_IMAGE_MAX_SIZE_BYTES: 40_000_000
58+
5559
# trigger new commit cancel
5660
workflow:
5761
auto_cancel:
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
import org.w3c.dom.Element;
2+
import javax.xml.XMLConstants;
3+
import javax.xml.parsers.DocumentBuilderFactory;
4+
import javax.xml.transform.OutputKeys;
5+
import javax.xml.transform.TransformerFactory;
6+
import javax.xml.transform.dom.DOMSource;
7+
import javax.xml.transform.stream.StreamResult;
8+
import java.io.File;
9+
import java.nio.file.Files;
10+
import java.util.ArrayList;
11+
import java.util.LinkedHashMap;
12+
import java.util.List;
13+
import java.util.Map;
14+
15+
/// Tags intermediate `initializationError` retries with `dd_tags[test.final_status]=skip`.
16+
///
17+
/// Gradle generates synthetic "initializationError" testcases in JUnit reports for setup methods.
18+
/// When a setup is retried and eventually succeeds, multiple testcases are created, with only the
19+
/// last one passing. All intermediate attempts are marked skip so Test Optimization is not misled.
20+
///
21+
/// For any suite with multiple `initializationError` test cases (when retries occurred), all entries
22+
/// but the last one are tagged by this script with `dd_tags[test.final_status]=skip`. The last
23+
/// entry is left unmodified, allowing **Test Optimization** to apply its default status inference based
24+
/// on the actual outcome. Files with only one (or zero) `initializationError` test cases are left unmodified.
25+
///
26+
/// Before:
27+
///
28+
/// ```
29+
/// <testcase name="initializationError" />
30+
/// ```
31+
///
32+
/// After:
33+
///
34+
/// ```
35+
/// <testcase name="initializationError">
36+
/// <properties>
37+
/// <property name="dd_tags[test.final_status]" value="skip" />
38+
/// </properties>
39+
/// </testcase>
40+
/// ```
41+
///
42+
/// Usage (Java 25): `java TagInitializationErrors.java junit-report.xml`
43+
44+
class TagInitializationErrors {
45+
public static void main(String[] args) throws Exception {
46+
if (args.length == 0) {
47+
System.err.println("Usage: java TagInitializationErrors.java <xml-file>");
48+
System.exit(1);
49+
}
50+
var xmlFile = new File(args[0]);
51+
if (!xmlFile.exists()) {
52+
System.err.println("File not found: " + xmlFile);
53+
System.exit(1);
54+
}
55+
var dbf = DocumentBuilderFactory.newInstance();
56+
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
57+
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
58+
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
59+
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
60+
dbf.setExpandEntityReferences(false);
61+
var doc = dbf.newDocumentBuilder().parse(xmlFile);
62+
var testcases = doc.getElementsByTagName("testcase");
63+
Map<String, List<Element>> byClassname = new LinkedHashMap<>();
64+
for (int i = 0; i < testcases.getLength(); i++) {
65+
var e = (Element) testcases.item(i);
66+
if ("initializationError".equals(e.getAttribute("name"))) {
67+
byClassname.computeIfAbsent(e.getAttribute("classname"), k -> new ArrayList<>()).add(e);
68+
}
69+
}
70+
boolean modified = false;
71+
for (var group : byClassname.values()) {
72+
if (group.size() <= 1) continue;
73+
for (int i = 0; i < group.size() - 1; i++) {
74+
var testcase = group.get(i);
75+
var existingProperties = testcase.getElementsByTagName("properties");
76+
if (existingProperties.getLength() > 0) {
77+
var props = (Element) existingProperties.item(0);
78+
var existingProps = props.getElementsByTagName("property");
79+
boolean alreadyTagged = false;
80+
for (int j = 0; j < existingProps.getLength(); j++) {
81+
if ("dd_tags[test.final_status]".equals(((Element) existingProps.item(j)).getAttribute("name"))) {
82+
alreadyTagged = true;
83+
break;
84+
}
85+
}
86+
if (alreadyTagged) continue;
87+
var property = doc.createElement("property");
88+
property.setAttribute("name", "dd_tags[test.final_status]");
89+
property.setAttribute("value", "skip");
90+
props.appendChild(property);
91+
} else {
92+
var properties = doc.createElement("properties");
93+
var property = doc.createElement("property");
94+
property.setAttribute("name", "dd_tags[test.final_status]");
95+
property.setAttribute("value", "skip");
96+
properties.appendChild(property);
97+
testcase.appendChild(properties);
98+
}
99+
modified = true;
100+
}
101+
}
102+
if (!modified) return;
103+
var tmpFile = File.createTempFile("TagInitializationErrors", ".xml", xmlFile.getParentFile());
104+
try {
105+
var transformer = TransformerFactory.newInstance().newTransformer();
106+
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
107+
transformer.transform(new DOMSource(doc), new StreamResult(tmpFile));
108+
Files.move(tmpFile.toPath(), xmlFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
109+
} catch (Exception e) {
110+
tmpFile.delete();
111+
throw e;
112+
}
113+
}
114+
}

.gitlab/benchmarks/bp-runner.fail-on-breach.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Generated: 2026-03-31
33
#
44
# Generation Strategy: tight
5-
# Formula: CI_bound / (1 ± T) (T = 5.0%)
5+
# Formula: CI_bound / (1 ± T) (T = 10.0%)
66
#
77
# SLO Checking:
88
# - BREACH: 90% CI boundary crosses threshold
@@ -11,7 +11,7 @@
1111
# DO NOT EDIT MANUALLY - Regenerate using:
1212
# benchmark_analyzer generate slos --help
1313
#
14-
# Thresholds set based on guidance in https://datadoghq.atlassian.net/wiki/x/LgI1LgE#How-to-choose-thresholds-for-pre-release-gates%3F
14+
# link to documentation on autogenerated thresholds https://github.com/DataDog/relenv-benchmark-analyzer/blob/main/README.md#generate-slo-thresholds
1515

1616
experiments:
1717
- name: Run SLO breach check
@@ -31,7 +31,7 @@ experiments:
3131
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fonly-tracing&trendsType=scenario
3232
- name: normal_operation/only-tracing
3333
thresholds:
34-
- agg_http_req_duration_p50 < 2.128 ms
34+
- agg_http_req_duration_p50 < 2.526 ms
3535
- agg_http_req_duration_p99 < 8.5 ms
3636
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fotel-latest&trendsType=scenario
3737
- name: normal_operation/otel-latest

.gitlab/collect_results.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ do
9090
echo " (non-stable test names detected)"
9191
fi
9292

93+
echo "Add dd_tags[test.final_status] property on retried synthetics testcase initializationErrors"
94+
$JAVA_25_HOME/bin/java "$(dirname "$0")/TagInitializationErrors.java" "$TARGET_DIR/$AGGREGATED_FILE_NAME"
95+
9396
echo "Add dd_tags[test.final_status] property to each testcase on $TARGET_DIR/$AGGREGATED_FILE_NAME"
9497
xsl_file="$(dirname "$0")/add_final_status.xsl"
9598
tmp_file="$(mktemp)"

.gitlab/one-pipeline.locked.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# DO NOT EDIT THIS FILE MANUALLY
22
# This file is auto-generated by automation.
33
include:
4-
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/9cf7d7609ff62e4723c9cbc061ca2a25345ce5d6055b9acad9a13dbf736261f0/one-pipeline.yml
4+
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/4667b01c6ae983f92ecf106e110ced3dac798b229cf2a0539c58aa22e95a99d5/one-pipeline.yml

0 commit comments

Comments
 (0)