Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle build scan fails when there is a plugin whose code source does not have a location URL #29003

Open
nikita-tkachenko-datadog opened this issue Apr 30, 2024 · 1 comment

Comments

@nikita-tkachenko-datadog
Copy link

nikita-tkachenko-datadog commented Apr 30, 2024

Current Behavior

If a Gradle build has a plugin whose classes' CodeSource returns null location, then the following exception is thrown when running build scan:

Gradle version: 8.6
23562Plugin version: 3.15.1
23563
23564com.gradle.scan.plugin.internal.operations.a: Build operation dispatch of started notification failed.
23565Operation context:
23566 org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$1 (1): {}
23567 org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild$1 (104): {getBuildPath=:}
23568 org.gradle.initialization.buildsrc.BuildSourceBuilder$2$1 (169): {getBuildPath=:}
23569 org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild$1 (178): {getBuildPath=:buildSrc}
23570 org.gradle.initialization.ProjectsEvaluatedNotifier$NotifyProjectsEvaluatedListeners$1 (293): {getBuildPath=:buildSrc}
23571 org.gradle.api.internal.plugins.DefaultPluginManager$OperationDetails (294): {pluginId=null, targetPath=:, pluginClass=datadog.trace.instrumentation.gradle.CiVisibilityPlugin, targetType=project, applicationId=32, buildPath=:buildSrc}
23572Caused by: java.lang.NullPointerException: Cannot invoke "java.net.URL.getProtocol()" because "<local4>" is null
23573 at com.gradle.scan.plugin.internal.c.ae.a.a.b.a(SourceFile:62)
23574 at com.gradle.scan.plugin.internal.c.ae.a.a.e.a(SourceFile:47)
23575 at com.gradle.scan.plugin.internal.c.ae.a.b.a(SourceFile:59)
23576 at com.gradle.scan.plugin.internal.c.ae.a.b.a(SourceFile:47)
23577 at com.gradle.scan.plugin.internal.operations.b$c.started(SourceFile:140)
23578 at com.gradle.scan.plugin.internal.operations.b.a(SourceFile:55)
23579 at com.gradle.scan.plugin.internal.operations.n.a(SourceFile:33)
23580 at com.gradle.scan.plugin.internal.operations.d.a(SourceFile:60)
23581 at com.gradle.scan.plugin.internal.operations.h.a(SourceFile:39)
23582 at com.gradle.scan.plugin.internal.r.a$a.a(SourceFile:31)
23583 at com.gradle.scan.plugin.internal.r.a$a.a(SourceFile:20)
23584 at com.gradle.scan.plugin.internal.r.a.c(SourceFile:67)
23585----------

Expected Behavior

The build scan should not assume that every plugin class has a code source whose location is non-null.

Context (optional)

No response

Steps to Reproduce

When running a Gradle build with the Datadog Java tracer attached, the tracer dynamically registers a plugin.
This plugin's classes have a code source that has no location specified.

wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
./gradlew --scan cleanTest test -Dorg.gradle.jvmargs=\
-javaagent:dd-java-agent.jar=\
dd.civisibility.enabled=true,\
dd.env=ci,\
dd.service=dummy

Gradle version

8.6

Build scan URL (optional)

No response

Your Environment (optional)

No response

@ov7a
Copy link
Member

ov7a commented May 7, 2024

The issue is in the backlog of the relevant team and is prioritized by them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants