Skip to content

Add GitHub Dependency Submission workflow for vendored Java subprojects - #41651

Open
derrickaw wants to merge 5 commits into
masterfrom
vuln/vendor-java-dependency-submission
Open

derrickaw wants to merge 5 commits into
masterfrom
vuln/vendor-java-dependency-submission

Conversation

@derrickaw

@derrickaw derrickaw commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR remediates a confirmed, live vulnerability on master that Dependabot is not already addressing
  • The version update is minimal, respects Beam's compatibility bounds, and avoids unrelated dependency churn
  • Relevant lockfiles, package constraints, and tests have been verified

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Adds a GitHub Actions workflow (.github/workflows/beam_Vendor_Java_Dependency_Submission.yml) using gradle/actions/dependency-submission to resolve and submit Maven dependency graphs for Beam's vendored Java subprojects (:vendor:*, currently :vendor:calcite-1_40_0, :vendor:grpc-1_69_0, and :vendor:guava-32_1_2-jre).

Motivation

Beam's vendored Java artifacts (beam-vendor-*) shade and relocate dependencies under org.apache.beam.vendor.* (and :vendor:calcite-1_40_0 strips META-INF/maven/**), leaving both GitHub's static Dependency Graph and downstream JAR/container scanners unable to detect CVEs in shaded transitive libraries. Resolving runtimeClasspath across :vendor:.* at the Gradle layer enables GitHub Dependabot Alerts to track vulnerabilities in vendored artifacts without flooding the repository with unshaded module alerts.

Workflow Behavior

  • Weekly Schedule & Manual Dispatch Only (schedule / workflow_dispatch): Runs dependency-graph: generate-submit-and-upload scoped to dependency-graph-include-projects: ':vendor:.*' and dependency-graph-include-configurations: 'runtimeClasspath' once weekly (Mondays 06:00 UTC) or via manual workflow_dispatch, avoiding any pull_request / push overhead.

@derrickaw derrickaw added the dependencies Pull requests that update a dependency file label Nov 24, 2026
@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR adds a GitHub Actions workflow (beam_Vendor_Java_Dependency_Submission.yml) to resolve and submit the dependency graphs for Beam's vendored Java modules (vendor/*) via gradle/actions/dependency-submission@v5. There are a couple of critical issues in the Gradle invocation and gradle/actions inputs that will cause the workflow to fail at runtime, along with a local composite action reference that should be updated for zizmor compliance.

🔍 General Feedback

  • Gradle Configuration Gating: In settings.gradle.kts, all vendor/* subprojects are only included in the Gradle build when -PvendoredDependenciesOnly is passed. Without this property, the :vendor:* project paths do not exist and Gradle fails with a project-not-found error.
  • Gradle Argument Quoting: gradle/actions parses additional-arguments using whitespace-splitting without shell quote stripping, which breaks quoted multi-token -Dorg.gradle.jvmargs values.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR adds a GitHub Actions workflow (.github/workflows/beam_Vendor_Java_Dependency_Submission.yml) and documentation updates to resolve and submit Maven dependency graphs for Beam's vendored Java subprojects (:vendor:*) to GitHub's Dependency Graph API. The previous review feedback regarding GRADLE_OPTS heap sizing and argument quoting has been cleanly addressed, and the workflow adheres to Beam's CI and security conventions.

🔍 General Feedback

  • Actions are pinned to full commit SHAs with least-privilege permissions (permissions: {} at top-level, contents: read on PR validation, and contents: write restricted to non-PR runs on apache/beam).
  • Scoping dependency graph generation to :vendor:.* and runtimeClasspath with GRADLE_OPTS: -Xms2g -Xmx5g and -Dorg.gradle.vfs.watch=false is well-configured and verified in CI.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@github-actions github-actions Bot added build vendor size/m M: 50-249 lines changed labels Nov 24, 2026
@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR adds a GitHub Actions workflow (.github/workflows/beam_Vendor_Java_Dependency_Submission.yml) and documentation updates to resolve and submit Maven dependency graphs for Beam's vendored Java subprojects (:vendor:*) to GitHub's Dependency Graph API. Consolidating the PR validation and master submission steps into a single job on [self-hosted, ubuntu-24.04, small] eliminates duplication while preserving safe behavior across pull_request, push, and workflow_dispatch events.

🔍 General Feedback

  • All external actions (actions/checkout, actions/setup-java, gradle/actions/dependency-submission) are pinned to full commit SHAs with persist-credentials: false on checkout.
  • Using dependency-graph: ${{ github.event_name == 'pull_request' && 'generate-and-upload' || 'generate-submit-and-upload' }} cleanly validates dependency graph generation on pull requests without submitting snapshots to the Dependency Submission API until merged to master.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@derrickaw derrickaw added ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review and removed ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review labels Nov 24, 2026
@derrickaw
derrickaw marked this pull request as ready for review November 24, 2026 20:54
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Abacn for label build.
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn

Abacn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

I'm not sure the value of this newly introduced workflow, at least it should only have schedule / workflow_dispatch trigger

@github-actions github-actions Bot added size/s S: 10-49 lines changed and removed size/m M: 50-249 lines changed labels Nov 24, 2026
@derrickaw

derrickaw commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

I'm not sure the value of this newly introduced workflow, at least it should only have schedule / workflow_dispatch trigger

In terms of value, this workflow in theory would have caught the CVE that Cham is dealing with now potentially a few weeks before 2.78 release cut. I am trying to flush these CVEs out and fix them in follow-up PRs.

Updated this to run only on a weekly schedule + workflow_dispatch so it never runs on PRs or unrelated settings.gradle.kts commits.

@Abacn

Abacn commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context. Then I think this workflow actually won't help.

The original issue was BeamModulePlugin's guava version was stale. After #41594 it's now managed by GCP-BOM and we're good for now

The vendored guava (and grpc, calcite), however, undergoes a different release process decoupled with Beam. It updates infrequently (last time beam-vendor-guava release was 3 years ago). We're unlikely to take action even if this workflow report findings

If we really want to keep vendored dependency version to be up-to-date, consider unvendor them. In the past guava experienced backward compatibility issues (#18309) but seems to be stable in recent years. We can start a discussion in dev list to unvendor guava

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

Labels

build dependencies Pull requests that update a dependency file Next Action: Reviewers size/s S: 10-49 lines changed vendor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants