bitflicker64 commented on code in PR #3326:
URL: https://github.com/apache/hugegraph/pull/3326#discussion_r4265614814


##########
.github/workflows/submit-dependencies.yml:
##########
@@ -0,0 +1,315 @@
+#
+# 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: Dependency baseline
+
+on:
+  push:
+    branches: [master]
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+concurrency:
+  group: dependency-baseline-${{ github.repository }}-master
+  cancel-in-progress: false
+
+jobs:
+  validate:
+    if: >-
+      (github.repository == 'apache/hugegraph' || github.repository == 
'hugegraph/hugegraph') &&
+      github.ref == 'refs/heads/master' &&
+      (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    env:
+      PYTHONDONTWRITEBYTECODE: '1'
+    steps:
+      - name: Checkout event commit
+        uses: actions/checkout@v7
+        with:
+          ref: ${{ github.sha }}
+          persist-credentials: false
+      - name: Test CI policy and dependency inventory
+        run: |
+          python3 -m unittest discover -s .github/scripts -p 
'test_ci_policy.py'
+          python3 -m unittest discover -s .github/scripts -p 
'test_dependency_snapshot.py'
+          python3 -m unittest discover -s install-dist/scripts/dependency -p 
'test_*.py'
+
+  generate:
+    needs: validate
+    if: >-
+      ((github.repository == 'apache/hugegraph' && 
github.event.repository.fork == false) ||
+       github.repository == 'hugegraph/hugegraph') &&
+      github.ref == 'refs/heads/master' &&
+      (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
+    runs-on: ubuntu-latest
+    timeout-minutes: 60
+    permissions:
+      contents: read
+    env:
+      PYTHONDONTWRITEBYTECODE: '1'
+      INPUT_TOKEN: ''
+      GITHUB_TOKEN: ''
+      GH_TOKEN: ''
+    outputs:
+      artifact_id: ${{ steps.snapshot.outputs.artifact-id }}
+    steps:
+      - name: Checkout event commit
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: ${{ github.sha }}
+          persist-credentials: false
+      - name: Set up project JDK
+        uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # 
v6.0.1
+        with:
+          java-version-file: .github/workflows/.java-version
+          distribution: 'temurin'
+      - name: Verify checkout and current master
+        env:
+          EXPECTED_SHA: ${{ github.sha }}
+        run: |
+          test "$(git rev-parse HEAD)" = "$EXPECTED_SHA"
+          test "$(git ls-remote origin refs/heads/master | cut -f1)" = 
"$EXPECTED_SHA"

Review Comment:
   Important: a master commit that is no longer the branch tip when this check 
runs never gets a baseline, and nothing can add one later, so pull requests 
based on that commit keep failing dependency review.
   
   Evidence: this step, the repeat at line 100 and the writer's `Stale master 
before submission` check (line 307) all fail the run when `refs/heads/master` 
is not `github.sha`. `workflow_dispatch` only runs for the current tip, and the 
concurrency group (line 28) keeps one pending run, so a superseded or replaced 
commit has no recovery path. Master moves faster than one run: #3337 and #3335 
merged 46 seconds apart (20:01:23Z and 20:02:09Z on 2026-10-13), four commits 
landed between 08:56:45Z and 08:58:58Z on 2026-10-12, and `mvn install` alone 
took 3m48s in this PR's `dependency-check` job. `dependency-review` compares 
exact SHAs: on this head it logged "snapshots compared for the base SHA (0) and 
the head SHA (1) do not match", listed every dependency as added (5058 entries 
from the compare API) and failed on vulnerable packages. Open PRs sit on such 
commits: #3334 has base `c1e7aba77`, which was the tip for under 8 minutes 
before `b84454fb0`.
   
   Requested change: submit the snapshot for the event SHA even after master 
advances. The run, artifact, SHA and ref identity checks already bind it to 
that commit, and the concurrency group already serializes submissions. If the 
tip-only rule has to stay, add a way to backfill a named master SHA and state 
in `docs/ci.md` that a PR whose base commit was skipped has no baseline until 
it is updated onto a submitted commit.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to