Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dd-java-agent/ddprof-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ plugins {

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

configurations {
def nightly = register('nightlyTestImplementation') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable here is not necessary.


Note however, that if this build file was written with the Kotlin dsl then the variable could have been reused.

visible = false
canBeConsumed = false
canBeResolved = true
extendsFrom(testImplementation)
}
}

dependencies {
// This module provides the ddprof library as an api dependency
// so that other modules can easily depend on it.
implementation project.hasProperty('ddprof.jar') ? files(project.findProperty('ddprof.jar')) : libs.ddprof
api project(':internal-api')
api project(':dd-trace-api')
nightlyTestImplementation group: 'com.datadoghq', name: 'ddprof', version: 'latest.integration'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure that this should be testImplementation...
@bric3 WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I get it right, @zhengyu123, you need to run test on both the included ddprof, and a nightly. If so I think using the same approach as what is done in various instrumentation tests might be the better approach. I.e. drop the manually registered configuration, and tweak the build file along those lines.

+addTestSuiteForDir('nightlyTest', 'test')

 dependencies {
+  nightlyTestImplementation group: 'com.datadoghq', name: 'ddprof', version: 'latest.integration'
 }

This should create a nightlyTest task, that will use the latest.integration version.

One thing I'm not sure, is where the nightly gets published ?

Copy link
Contributor Author

@zhengyu123 zhengyu123 Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bric3 Actually, we only want to use latest snapshot for nightly test and keep regular test as it is, so that if there are breakages in profiler won't impact your regular works.

Bruce pointed me here: https://github.com/DataDog/dd-trace-java/blob/b42a4cb14913d661a7b1b67b41532aad1b847924/.gitlab-ci.yml#L252C12-L252C13
So, I want to inject snapshot dependency when running resolveAndLockAll task.

Copy link
Contributor

@bric3 bric3 Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context !

That said, the current lines won't work. Gradle configuration domain object, represents a collection of artifacts and their dependencies and how they can be consumed or resolved.

However, I don't think anything consumes this nightlyTestImplementation. So basically this change will do nothing as this configuration won't be used.

I'd like to discuss this with other folk in JLP. Maybe this needs specific CI pipeline or job, or maybe something simpler can be achieved by overriding the testImplementation to com.datadoghq:ddprof:latest.integration when running in scheduled nightly.

cc @sarahchen6 @PerfectSlayer for awareness

Copy link
Contributor Author

@zhengyu123 zhengyu123 Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run following command:

./gradlew --write-locks :dd-java-agent:ddprof-lib:resolveAndLockAll

I see dd-java-agent/ddprof-lib/gradle.lockfile got overwritten, like:

diff --git a/dd-java-agent/ddprof-lib/gradle.lockfile b/dd-java-agent/ddprof-lib/gradle.lockfile
index 55304edcf1..59289527ee 100644
--- a/dd-java-agent/ddprof-lib/gradle.lockfile
+++ b/dd-java-agent/ddprof-lib/gradle.lockfile
@@ -1,35 +1,36 @@
 # This is a Gradle generated file for dependency locking.
 # Manual edits can break the build and are not advised.
 # This file is expected to be part of source control.
-ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath
-ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath
-com.beust:jcommander:1.78=testRuntimeClasspath
-com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
+ch.qos.logback:logback-classic:1.2.13=nightlyTestImplementation,testCompileClasspath,testRuntimeClasspath
+ch.qos.logback:logback-core:1.2.13=nightlyTestImplementation,testCompileClasspath,testRuntimeClasspath
+com.beust:jcommander:1.78=nightlyTestImplementation,testRuntimeClasspath
+com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,nightlyTestImplementation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
 com.datadoghq:ddprof:1.34.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
-com.github.javaparser:javaparser-core:3.25.6=codenarc,testCompileClasspath,testRuntimeClasspath
-com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
+com.datadoghq:ddprof:1.35.0-SNAPSHOT=nightlyTestImplementation
+com.github.javaparser:javaparser-core:3.25.6=codenarc,nightlyTestImplementation,testCompileClasspath,testRuntimeClasspath
+com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,nightlyTestImplementation,testCompileClasspath,testRuntimeClasspath
 com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
 com.github.spotbugs:spotbugs:4.7.3=spotbugs

....

It means nothing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means nothing

Nope it doesn't, this lock file only allow to lock the dependency resolution, but doesn't make the "nightly configuration" used. If you look closely you can see that

  • 1.34 is still there for usual (and used) configurations : compileClasspath, runtimeClasspath, testCompileClasspath and testRuntimeClasspath

    com.datadoghq:ddprof:1.34.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
    
  • com.datadoghq:ddprof:1.35.0-SNAPSHOT is added for the nightlyTestImplementation configuration

    com.datadoghq:ddprof:1.35.0-SNAPSHOT=nightlyTestImplementation
    

}

tasks.named("shadowJar", ShadowJar) {
Expand Down