Skip to content

Commit 234686b

Browse files
Merge branch 'master' into nikita-tkachenko/junit-6
2 parents 62f4162 + 2c5960b commit 234686b

File tree

85 files changed

+1583
-955
lines changed

Some content is hidden

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

85 files changed

+1583
-955
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
4545
- name: Commit and push changes
46-
uses: planetscale/ghcommit-action@7c35caed9937939812c7d4242ffab823e9b3b1fa # v0.2.16
46+
uses: planetscale/ghcommit-action@322be9669498a4be9ce66efc1169f8f43f6bd883 # v0.2.17
4747
with:
4848
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
4949
repo: ${{ github.repository }}

.github/workflows/analyze-changes.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
${{ runner.os }}-gradle-
4141
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
43+
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
4444
with:
4545
languages: 'java'
4646
build-mode: 'manual'
@@ -57,7 +57,7 @@ jobs:
5757
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5858
5959
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
60-
uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
60+
uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
6161

6262
trivy:
6363
name: Analyze changes with Trivy
@@ -122,7 +122,7 @@ jobs:
122122
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
123123

124124
- name: Upload Trivy scan results to GitHub Security tab
125-
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
125+
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
126126
if: always()
127127
with:
128128
sarif_file: 'trivy-results.sarif'

.gitlab-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ workflow:
6060
- "11"
6161
- "17"
6262
- "21"
63+
- "25"
6364
- "stable"
6465
- "semeru11"
6566
- "oracle8"
@@ -601,11 +602,12 @@ agent_integration_tests:
601602
GRADLE_TARGET: "traceAgentTest"
602603
CACHE_TYPE: "base"
603604
services:
604-
- name: datadog/agent:7.34.0
605+
- name: registry.ddbuild.io/images/mirror/datadog/agent:7.40.1
605606
alias: local-agent
606607
variables:
607608
DD_APM_ENABLED: "true"
608609
DD_BIND_HOST: "0.0.0.0"
610+
DD_HOSTNAME: "local-agent"
609611
DD_API_KEY: "invalid_key_but_this_is_fine"
610612

611613
test_base:

build.gradle

Lines changed: 0 additions & 132 deletions
This file was deleted.

build.gradle.kts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import com.diffplug.gradle.spotless.SpotlessExtension
2+
3+
plugins {
4+
id("datadog.gradle-debug")
5+
id("datadog.dependency-locking")
6+
7+
id("com.diffplug.spotless") version "6.13.0"
8+
id("com.github.spotbugs") version "5.0.14"
9+
id("de.thetaphi.forbiddenapis") version "3.8"
10+
11+
id("org.shipkit.shipkit-auto-version") version "2.1.2"
12+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
13+
14+
id("com.gradleup.shadow") version "8.3.6" apply false
15+
id("me.champeau.jmh") version "0.7.0" apply false
16+
id("org.gradle.playframework") version "0.13" apply false
17+
id("info.solidsoft.pitest") version "1.9.11" apply false
18+
}
19+
20+
description = "dd-trace-java"
21+
22+
val isCI = providers.environmentVariable("CI")
23+
24+
apply(from = rootDir.resolve("gradle/repositories.gradle"))
25+
26+
spotless {
27+
// only resolve the spotless dependencies once in the build
28+
predeclareDeps()
29+
}
30+
31+
with(extensions["spotlessPredeclare"] as SpotlessExtension) {
32+
// these need to align with the types and versions in gradle/spotless.gradle
33+
java {
34+
removeUnusedImports()
35+
36+
// This is the last Google Java Format version that supports Java 8
37+
googleJavaFormat("1.7")
38+
}
39+
groovyGradle {
40+
greclipse()
41+
}
42+
groovy {
43+
greclipse()
44+
}
45+
kotlinGradle {
46+
ktlint("0.41.0")
47+
}
48+
kotlin {
49+
ktlint("0.41.0")
50+
}
51+
scala {
52+
scalafmt("2.7.5")
53+
}
54+
}
55+
apply(from = rootDir.resolve("gradle/spotless.gradle"))
56+
57+
val compileTask = tasks.register("compile")
58+
59+
val repoVersion = version
60+
61+
allprojects {
62+
group = "com.datadoghq"
63+
version = repoVersion
64+
65+
if (isCI.isPresent) {
66+
layout.buildDirectory = providers.provider {
67+
val newProjectCIPath = projectDir.path.replace(
68+
rootDir.path,
69+
""
70+
)
71+
rootDir.resolve("workspace/$newProjectCIPath/build/")
72+
}
73+
}
74+
75+
apply(from = rootDir.resolve("gradle/dependencies.gradle"))
76+
apply(from = rootDir.resolve("gradle/util.gradle"))
77+
78+
compileTask.configure {
79+
dependsOn(tasks.withType<AbstractCompile>())
80+
}
81+
82+
tasks.configureEach {
83+
if (this is JavaForkOptions) {
84+
maxHeapSize = System.getProperty("datadog.forkedMaxHeapSize")
85+
minHeapSize = System.getProperty("datadog.forkedMinHeapSize")
86+
jvmArgs(
87+
"-XX:ErrorFile=/tmp/hs_err_pid%p.log",
88+
"-XX:+HeapDumpOnOutOfMemoryError",
89+
"-XX:HeapDumpPath=/tmp"
90+
)
91+
}
92+
}
93+
}
94+
95+
tasks.register("latestDepTest")
96+
97+
nexusPublishing {
98+
repositories {
99+
val forceLocal = providers.gradleProperty("forceLocal").getOrElse("false").toBoolean()
100+
if (forceLocal && !isCI.isPresent) {
101+
// For testing, use with https://hub.docker.com/r/sonatype/nexus
102+
// $ docker run --rm -d -p 8081:8081 --name nexus sonatype/nexus:oss
103+
// $ ./gradlew publishToLocal -PforceLocal=true
104+
// Doesn't work for testing releases though... (due to staging),
105+
// however, it's possible to explore http://localhost:8081/nexus/
106+
register("local") {
107+
nexusUrl = uri("http://localhost:8081/nexus/content/repositories/releases/")
108+
snapshotRepositoryUrl = uri("http://localhost:8081/nexus/content/repositories/snapshots/")
109+
username = "admin"
110+
password = "admin123"
111+
allowInsecureProtocol = true
112+
}
113+
} else {
114+
// see https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-central
115+
// For official documentation:
116+
// staging repo publishing https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
117+
// snapshot publishing https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-via-other-methods
118+
sonatype {
119+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
120+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
121+
username = providers.environmentVariable("MAVEN_CENTRAL_USERNAME")
122+
password = providers.environmentVariable("MAVEN_CENTRAL_PASSWORD")
123+
}
124+
}
125+
}
126+
}
127+
128+
val writeMainVersionFileTask = tasks.register("writeMainVersionFile") {
129+
val versionFile = rootProject.layout.buildDirectory.file("main.version")
130+
inputs.property("version", project.version)
131+
outputs.file(versionFile)
132+
doFirst {
133+
require(versionFile.get().asFile.parentFile.mkdirs() || versionFile.get().asFile.parentFile.isDirectory)
134+
versionFile.get().asFile.writeText(project.version.toString())
135+
}
136+
}
137+
138+
allprojects {
139+
tasks.withType<PublishToMavenLocal>().configureEach {
140+
finalizedBy(writeMainVersionFileTask)
141+
}
142+
}
143+
144+
apply(from = "$rootDir/gradle/ci_jobs.gradle")

components/environment/src/main/java/datadog/environment/EnvironmentVariables.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package datadog.environment;
22

3-
import javax.annotation.Nonnull;
43
import javax.annotation.Nullable;
54

65
/**
@@ -32,7 +31,7 @@ private EnvironmentVariables() {}
3231
* @return The environment variable value, {@code defaultValue} if missing, can't be retrieved or
3332
* the environment variable name is {@code null}.
3433
*/
35-
public static String getOrDefault(@Nonnull String name, String defaultValue) {
34+
public static String getOrDefault(String name, String defaultValue) {
3635
if (name == null) {
3736
return defaultValue;
3837
}

0 commit comments

Comments
 (0)