github-actions[bot] commented on code in PR #41651: URL: https://github.com/apache/beam/pull/41651#discussion_r4685128996
########## .github/workflows/beam_Vendor_Java_Dependency_Submission.yml: ########## @@ -0,0 +1,118 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Beam Vendor Java Dependency Submission + +on: + push: + branches: + - master + paths: + - 'vendor/**' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/*Vendoring*.groovy' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy' + - 'settings.gradle.kts' + - '.github/workflows/beam_Vendor_Java_Dependency_Submission.yml' + pull_request: + paths: + - 'vendor/**' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/*Vendoring*.groovy' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy' + - 'settings.gradle.kts' + - '.github/workflows/beam_Vendor_Java_Dependency_Submission.yml' + workflow_dispatch: + +permissions: {} + +concurrency: + group: '${{ github.workflow }} @ ${{ github.ref }}' + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + validate_vendor_dependency_graph: + name: Validate Vendor Java Dependency Graph + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up JDK 21 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + with: + distribution: 'temurin' + java-version: '21' + + - name: Remove runner Maven settings.xml + run: | + # Workaround for net.linguica.maven-settings decryption issue with + # GitHub-hosted runner's default ~/.m2/settings.xml. + rm -f ~/.m2/settings.xml + + - name: Generate vendor Java dependency graph artifact + uses: gradle/actions/dependency-submission@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + with: + cache-disabled: true + validate-wrappers: false + dependency-graph: generate-and-upload + dependency-graph-include-projects: ':vendor:.*' + dependency-graph-include-configurations: 'runtimeClasspath' + artifact-retention-days: 5 + additional-arguments: >- Review Comment: **🟡 Medium**: Consistent with recent `zizmor` security hardening across Beam workflows (e.g., #41516, #41526) and the `beam_PreCommit_GHA` check, local composite actions should use the `$/` self-repository syntax instead of `./`. ```suggestion uses: $/.github/actions/setup-environment-action ``` ########## .github/workflows/beam_Vendor_Java_Dependency_Submission.yml: ########## @@ -0,0 +1,118 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Beam Vendor Java Dependency Submission + +on: + push: + branches: + - master + paths: + - 'vendor/**' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/*Vendoring*.groovy' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy' + - 'settings.gradle.kts' + - '.github/workflows/beam_Vendor_Java_Dependency_Submission.yml' + pull_request: + paths: + - 'vendor/**' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/*Vendoring*.groovy' + - 'buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy' + - 'settings.gradle.kts' + - '.github/workflows/beam_Vendor_Java_Dependency_Submission.yml' + workflow_dispatch: + +permissions: {} + +concurrency: + group: '${{ github.workflow }} @ ${{ github.ref }}' + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + validate_vendor_dependency_graph: + name: Validate Vendor Java Dependency Graph + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up JDK 21 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + with: + distribution: 'temurin' + java-version: '21' + + - name: Remove runner Maven settings.xml + run: | + # Workaround for net.linguica.maven-settings decryption issue with + # GitHub-hosted runner's default ~/.m2/settings.xml. + rm -f ~/.m2/settings.xml + + - name: Generate vendor Java dependency graph artifact + uses: gradle/actions/dependency-submission@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + with: + cache-disabled: true + validate-wrappers: false + dependency-graph: generate-and-upload + dependency-graph-include-projects: ':vendor:.*' + dependency-graph-include-configurations: 'runtimeClasspath' + artifact-retention-days: 5 + additional-arguments: >- + -Dorg.gradle.jvmargs="-Xms2g -Xmx5g -Xss10240k" + -Dorg.gradle.vfs.watch=false + + submit_vendor_dependency_graph: + name: Submit Vendor Java Dependency Graph + if: github.event_name != 'pull_request' && github.repository == 'apache/beam' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write # Required by GitHub's Dependency Submission API (/dependency-graph/snapshots). + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up JDK 21 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + with: + distribution: 'temurin' + java-version: '21' + + - name: Remove runner Maven settings.xml + run: | + # Workaround for net.linguica.maven-settings decryption issue with + # GitHub-hosted runner's default ~/.m2/settings.xml. + rm -f ~/.m2/settings.xml + + - name: Generate and submit vendor Java dependency graph + uses: gradle/actions/dependency-submission@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + with: + cache-disabled: true + validate-wrappers: false + dependency-graph: generate-submit-and-upload + dependency-graph-include-projects: ':vendor:.*' + dependency-graph-include-configurations: 'runtimeClasspath' + artifact-retention-days: 5 Review Comment: **🔴 Critical**: Two issues here will cause the Gradle execution to fail: 1. **Missing `-PvendoredDependenciesOnly`**: In `settings.gradle.kts`, the `vendor/*` subprojects are conditionally included only when `settings.ext.has("vendoredDependenciesOnly")` is true. Without `-PvendoredDependenciesOnly`, Gradle fails immediately with `Project 'vendor' not found in root project 'beam'`. 2. **Quoted `org.gradle.jvmargs` in `additional-arguments`**: `gradle/actions/dependency-submission` splits `additional-arguments` by whitespace without stripping quotes (`parseCmdLine`), passing `-Dorg.gradle.jvmargs="-Xms2g`, `-Xmx5g`, and `-Xss10240k"` as separate arguments to `./gradlew`, causing Gradle/JVM startup to fail with `Unrecognized option: -Xmx5g`. Since `gradle.properties` already sets `org.gradle.jvmargs=-Xss10240k`, you can either pass `GRADLE_OPTS: -Xms2g -Xmx5g` via `env:` on this step or pass `-PvendoredDependenciesOnly` without the multi-arg quoted string. ```suggestion additional-arguments: -PvendoredDependenciesOnly -Dorg.gradle.vfs.watch=false ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
