Skip to content

Build: Add Gradle dependency-submission workflow#16367

Open
kevinjqliu wants to merge 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/ci-add-gradle-dependency-submission
Open

Build: Add Gradle dependency-submission workflow#16367
kevinjqliu wants to merge 1 commit into
apache:mainfrom
kevinjqliu:kevinjqliu/ci-add-gradle-dependency-submission

Conversation

@kevinjqliu
Copy link
Copy Markdown
Contributor

Runs gradle/actions/dependency-submission against the full multi-project build (-DallModules) to populate GitHub's dependency graph and enable Dependabot alerts for transitive Gradle deps across all subprojects. Complements cve-scan.yml (Trivy on shipped jars).

Once merged, the resolved graph shows up at https://github.com/apache/iceberg/network/dependencies and lights up GitHub's native Dependabot CVE alerts for every transitive Maven coordinate the build pulls in.

Scope

  • -DallModules covers every Spark/Flink/Kafka versioned subproject.
  • Excludes :buildSrc and *Test{Compile,Runtime}Classpath so Dependabot only alerts on shipped deps.

Safety

  • Triggers: push: main + daily cron (06:17 UTC) + workflow_dispatch. No pull_request, so contents: write is never granted to fork PRs.
  • if: github.repository_owner == 'apache' no-ops on forks.
  • timeout-minutes: 30, cache-read-only: true, persist-credentials: false, all actions pinned to SHAs matching java-ci.yml.

Validation
Tested on my fork: 1,500 unique Maven artifacts resolved in ~1 min, buildSrc and test-classpath entries correctly excluded (0 hits each).

Adds a workflow that runs gradle/actions/dependency-submission against the full multi-project build (-DallModules) to populate GitHub's dependency graph and enable Dependabot alerts for transitive Gradle dependencies across all subprojects. Complements cve-scan.yml (Trivy on shipped jars) by surfacing the declared Gradle dependency graph across every known Spark/Flink/Kafka versioned module.

Triggers / safety:
- push: main only — GitHub only consumes the default branch's graph for Dependabot, and limiting writes here keeps 'contents: write' off fork PRs.
- schedule: daily at 06:17 UTC so newly-disclosed CVEs surface on quiet days; off-peak minute to avoid the top-of-hour GHA scheduler stampede.
- workflow_dispatch for manual reruns.
- if: github.repository_owner == 'apache' (matches stale.yml, publish-snapshot.yml, recurring-jmh-benchmarks.yml) so the job no-ops on forks where the Submission API rejects writes.
- timeout-minutes: 30 caps the daily cron so a stalled metadata download cannot tie up the runner / contents:write slot indefinitely.

Graph scope:
- additional-arguments: -DallModules expands all Spark/Flink/Kafka versioned subprojects in settings.gradle.
- dependency-graph-exclude-configurations: skip *TestCompile/*TestRuntime classpaths so JUnit, AssertJ, Mockito, TestContainers, etc. don't generate Dependabot noise for non-shipped deps.
- dependency-graph-exclude-projects: ':buildSrc' — pure build-time tooling, never ships.
- dependency-graph: generate-and-submit — skip the redundant 30-day workflow-artifact upload (snapshot is already persisted via the API).

Other:
- cache-read-only: true — java-ci's build-checks remains the canonical cache writer.
- persist-credentials: false on checkout.
- concurrency without cancel-in-progress so cron runs are never killed by overlapping pushes.
- All actions pinned to SHAs matching java-ci.yml.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow that submits Iceberg's full multi-project Gradle dependency graph to GitHub's Dependency Submission API, enabling native Dependabot CVE alerts for all transitive Maven coordinates across every Spark/Flink/Kafka subproject.

Changes:

  • Adds .github/workflows/dependency-submission.yml running on push to main, a daily cron, and workflow_dispatch.
  • Uses -DallModules to resolve every versioned subproject, while excluding :buildSrc and test classpaths so only shipped dependencies surface.
  • Pins all actions to SHAs matching java-ci.yml, uses cache-read-only: true, persist-credentials: false, a 30‑minute timeout, and a fork-skip guard via github.repository_owner == 'apache'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants