Skip to content

Submit only runtimeClasspath to the dependency graph - #82

Merged
abashev merged 1 commit into
mainfrom
dependency-graph-runtime-only
Sep 25, 2026
Merged

abashev merged 1 commit into
mainfrom
dependency-graph-runtime-only

Conversation

@abashev

@abashev abashev commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

All 24 open Dependabot alerts, the critical tika-core one (#18) among them, are for build tooling that never ships. This limits the submitted dependency graph to runtimeClasspath.

Why the current setting does not help. dependency-submission resolves every configuration of every project and submits all of it: 452 packages, among them buildSrc's buildScriptClasspath and compileClasspath (JReleaser 1.26.0 and its tika-core, httpclient5, httpcore5-h2) and the root project's buildscript classpath (jsoup, Jackson 2.20.2 and 2.21.0, plexus-utils). DEPENDENCY_GRAPH_RUNTIME_INCLUDE_CONFIGURATIONS does not filter anything: it only labels each package runtime or development. Dependabot raises alerts for both, and the auto-triage rule the old comment counted on to dismiss the development ones was never created.

Why runtimeClasspath is enough. Everything that ships is built from it: the published jars and their POMs, the native image (open-java-format-native compiles from runtimeClasspath), the Eclipse plugin (embeds it), and the IntelliJ plugin (bundles it, and its formatter configuration resolves the same 14 packages as :open-java-format's runtimeClasspath). The plugin matches the regex against the whole configuration name, so testRuntimeClasspath stays out.

The scope label goes: with only runtime configurations in the graph it would say nothing, and without a scope parameter the plugin writes none. Nothing in this repository reads it.

Checked locally with the GitHub Dependency Graph Gradle Plugin 1.4.2 that gradle/actions v6.3.0 runs, applied through an init script to :ForceDependencyResolutionPlugin_resolveAllDependencies:

before after
packages in the graph 452 24
runtime packages of the old graph still present 24 24
open alerts whose vulnerable version is in the graph 24 0

Without the filter the local run reproduces the snapshot of the last submission on main (run 36137459303) package for package, except the platform-specific JetBrains Runtime. The action passes the input to Gradle as DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS (sources/src/dependency-graph.ts at the pinned SHA).

The workflow runs only on pushes to main, so this PR's checks do not exercise it. After the merge the next run replaces the snapshot under the same correlator (submit_dependency_graph-full-build), and the 24 alerts should close as fixed.

The submission put every configuration the build resolves into the graph: buildSrc with JReleaser,
the root buildscript's plugins, annotation processors and test dependencies, 452 packages in all.
DEPENDENCY_GRAPH_RUNTIME_INCLUDE_CONFIGURATIONS only labelled everything but runtimeClasspath as
'development'. Dependabot alerts on development dependencies all the same, and the auto-triage rule
the comment counted on to dismiss them was never created, so all 24 open alerts, the critical
tika-core one among them, are for build tooling.

Filter the graph instead. Everything that ships is built from runtimeClasspath, so the graph keeps
the same 24 runtime packages and drops the rest. With no scope parameter the packages carry no
scope, which nothing here reads.
@abashev
abashev merged commit 4479a4f into main Sep 25, 2026
15 checks passed
@abashev
abashev deleted the dependency-graph-runtime-only branch September 25, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant