Skip to content

Commit b4b8e64

Browse files
Merge branch 'master' into bdu/spotbugs-bump-need-jdk11-min
2 parents 308bca2 + b733cda commit b4b8e64

File tree

22 files changed

+202
-109
lines changed

22 files changed

+202
-109
lines changed

.gitlab-ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ default:
138138
KUBERNETES_CPU_REQUEST: 8
139139
KUBERNETES_MEMORY_REQUEST: 8Gi
140140
KUBERNETES_MEMORY_LIMIT: 8Gi
141-
CACHE_TYPE: lib #default
141+
CACHE_TYPE: "lib" #default
142142
FF_USE_FASTZIP: "true"
143143
CACHE_COMPRESSION_LEVEL: "slowest"
144144

@@ -148,10 +148,11 @@ default:
148148
cache:
149149
- key: dependency-$CACHE_TYPE # Dependencies cache
150150
paths:
151-
# Cached dependencies and wrappers for gradle
151+
# Cached dependencies and wrappers for Gradle and Maven:
152152
- .gradle/wrapper
153153
- .gradle/caches
154154
- .gradle/notifications
155+
- .mvn/caches
155156
policy: $DEPENDENCY_CACHE_POLICY
156157
unprotect: true
157158
fallback_keys: # Use fallback keys because all cache types are not populated. See note under: populate_dep_cache
@@ -174,6 +175,7 @@ default:
174175
- export GRADLE_USER_HOME=$(pwd)/.gradle
175176
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties
176177
- sed -i "s|https://repo.maven.apache.org/maven2/|$MAVEN_REPOSITORY_PROXY|g" .mvn/wrapper/maven-wrapper.properties
178+
- mkdir -p .mvn/caches
177179
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms$GRADLE_MEM -Xmx$GRADLE_MEM -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
178180
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
179181
- *normalize_node_index
@@ -246,7 +248,7 @@ build:
246248
extends: .gradle_build
247249
variables:
248250
BUILD_CACHE_POLICY: push
249-
CACHE_TYPE: lib
251+
CACHE_TYPE: "lib"
250252
DEPENDENCY_CACHE_POLICY: pull
251253
script:
252254
- if [ $CI_PIPELINE_SOURCE == "schedule" ] ; then ./gradlew resolveAndLockAll --write-locks $GRADLE_ARGS; fi
@@ -365,7 +367,7 @@ test_published_artifacts:
365367
stage: tests
366368
needs: [ build ]
367369
variables:
368-
CACHE_TYPE: lib
370+
CACHE_TYPE: "lib"
369371
script:
370372
- mvn_local_repo=$(./mvnw help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)
371373
- rm -rf "${mvn_local_repo}/com/datadoghq"
@@ -393,7 +395,7 @@ test_published_artifacts:
393395
needs: [ build ]
394396
stage: tests
395397
variables:
396-
CACHE_TYPE: lib
398+
CACHE_TYPE: "lib"
397399
script:
398400
- *gitlab_base_ref_params
399401
- ./gradlew --version
@@ -429,6 +431,7 @@ check_inst:
429431
parallel: 4
430432
variables:
431433
GRADLE_TARGET: ":instrumentationCheck"
434+
CACHE_TYPE: "inst"
432435

433436
check_smoke:
434437
extends: .check_job
@@ -454,7 +457,7 @@ muzzle:
454457
matrix:
455458
- CI_SPLIT: ["1/8", "2/8", "3/8", "4/8", "5/8", "6/8", "7/8", "8/8"]
456459
variables:
457-
CACHE_TYPE: inst
460+
CACHE_TYPE: "inst"
458461
script:
459462
- export SKIP_BUILDSCAN="true"
460463
- ./gradlew --version
@@ -476,7 +479,7 @@ muzzle-dep-report:
476479
needs: [ build_tests ]
477480
stage: tests
478481
variables:
479-
CACHE_TYPE: inst
482+
CACHE_TYPE: "inst"
480483
script:
481484
- export SKIP_BUILDSCAN="true"
482485
- ./gradlew --version
@@ -809,7 +812,7 @@ deploy_to_maven_central:
809812
stage: publish
810813
needs: [ build ]
811814
variables:
812-
CACHE_TYPE: lib
815+
CACHE_TYPE: "lib"
813816
rules:
814817
- if: '$POPULATE_CACHE'
815818
when: never

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Check [Adding a New Instrumentation](docs/add_new_instrumentation.md) for instru
1313

1414
Check [How Instrumentations Work](docs/how_instrumentations_work.md) for a deep dive into how instrumentations work.
1515

16+
## Adding Configurations
17+
18+
Check [Adding a New Configuration](docs/add_new_configurations.md) for instructions on adding a new configuration.
19+
1620
## Code contributions
1721

1822
### Development environment quick check

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/propagation/StringModuleImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void onStringConcatFactory(
205205
int offset = 0;
206206
for (int item : recipeOffsets) {
207207
if (item < 0) {
208-
offset += -item;
208+
offset -= item;
209209
} else {
210210
final String argument = args[item];
211211
final Range[] ranges = getRanges(getTainted(taintedObjects, argument));

dd-java-agent/benchmark-integration/jetty-perftest/src/main/java/datadog/perftest/jetty/JettyPerftest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected void doGet(final HttpServletRequest request, final HttpServletResponse
4848
throw new RuntimeException("some sync error");
4949
}
5050
final String workVal = request.getParameter("workTimeMS");
51-
long workTimeMS = 0l;
51+
long workTimeMS = 0L;
5252
if (null != workVal) {
5353
workTimeMS = Long.parseLong(workVal);
5454
}

dd-java-agent/cws-tls/src/main/java/datadog/cws/tls/ErpcTls.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private void registerTls() {
120120

121121
pointer.setLong(0, TLS_FORMAT);
122122
pointer.setLong(Native.LONG_SIZE, maxThreads);
123-
pointer.setPointer(Native.LONG_SIZE * 2, tls);
123+
pointer.setPointer(Native.LONG_SIZE * 2L, tls);
124124

125125
sendRequest(request);
126126
}

dd-java-agent/instrumentation/aerospike-4.0/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ muzzle {
1313

1414
apply from: "$rootDir/gradle/java.gradle"
1515

16-
1716
addTestSuiteForDir("latestDepTest", "test")
1817
addTestSuiteForDir("latest7DepTest", "test")
1918
addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test")
2019
addTestSuiteExtendingForDir("latest7DepForkedTest", "latest7DepTest", "test")
2120

22-
2321
dependencies {
2422
compileOnly group: 'com.aerospike', name: 'aerospike-client', version: '4.0.0'
2523

dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ addTestSuiteForDir("jetty11Test", "test/jetty11")
2525
addTestSuiteExtendingForDir("jetty9LatestDepTest", "latestDepTest", "test/jetty9")
2626
addTestSuiteExtendingForDir("jetty11LatestDepTest", "latestDepTest", "test/jetty11")
2727

28-
["compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy"].each { name ->
29-
tasks.named(name, GroovyCompile) {
30-
configureCompiler(it, 11)
31-
}
32-
}
28+
configureGroovyCompiler(11, "compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy")
3329

3430
["jetty11Test", "jetty11LatestDepTest"].each { name ->
3531
tasks.named(name, Test) {

dd-java-agent/instrumentation/axis2-1.3/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ configurations.configureEach {
2323
}
2424
}
2525

26-
["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each {
27-
tasks.named(it, GroovyCompile) {
28-
configureCompiler(it, 11)
29-
}
30-
}
26+
configureGroovyCompiler(11, "compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy")
3127

3228
["compileLatestDepForkedTestJava", "compileLatestDepTestJava"].each {
3329
tasks.named(it, JavaCompile) {

dd-java-agent/instrumentation/cxf-2.1/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,17 @@ tasks.named("compileCxf3LatestDepTestJava", JavaCompile) {
2727
configureCompiler(it, 11, JavaVersion.VERSION_1_8)
2828
}
2929

30+
configureGroovyCompiler(11, "compileCxf3LatestDepTestGroovy")
31+
3032
tasks.named("compileLatestDepTestJava", JavaCompile) {
3133
configureCompiler(it, 17, JavaVersion.VERSION_1_8)
3234
}
3335

34-
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
35-
configureCompiler(it, 17)
36-
}
37-
3836
tasks.named("latestDepTest", Test) {
3937
javaLauncher = getJavaLauncherFor(17)
4038
}
4139

42-
tasks.named("compileCxf3LatestDepTestGroovy", GroovyCompile) {
43-
configureCompiler(it, 11)
44-
}
40+
configureGroovyCompiler(17, "compileLatestDepTestGroovy")
4541

4642
tasks.named("cxf3LatestDepTest", Test) {
4743
javaLauncher = getJavaLauncherFor(11)

dd-java-agent/instrumentation/mule-4.5/build.gradle

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,30 @@ tasks.register('extractLatestMuleServices', Sync) {
221221

222222
// build the mule application via maven
223223
tasks.register('mvnPackage', Exec) {
224-
workingDir "$appDir"
224+
workingDir("$appDir")
225225
environment.JAVA_HOME = System.getenv("JAVA_8_HOME")
226-
commandLine "$rootDir/mvnw", "-Ddatadog.builddir=$buildDir", "-Ddatadog.name=mule-test-application", "-Ddatadog.version=$version", 'package'
226+
227+
List<String> mvnArgs = [
228+
"$rootDir/mvnw",
229+
"-Ddatadog.builddir=$buildDir",
230+
"-Ddatadog.name=mule-test-application",
231+
"-Ddatadog.version=$version",
232+
"package"
233+
]
234+
235+
// Specify caches folder on CI.
236+
if (providers.environmentVariable("CI").isPresent()) {
237+
mvnArgs.add(1, "-Dmaven.repo.local=$rootDir/.mvn/caches")
238+
}
239+
240+
commandLine(mvnArgs)
241+
227242
outputs.dir("$buildDir/target")
228243
inputs.dir("$appDir/src")
229244
inputs.file("$appDir/pom.xml")
230245
inputs.file("$appDir/mule-artifact.json")
231246
}
232247

233-
234248
// generate a properties file so the test knows where to run mule, and what jar to deploy
235249
tasks.register('generateAppResources') {
236250
createAppResourceTask(it, "test")

0 commit comments

Comments
 (0)