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


##########
.github/workflows/check-dependencies.yml:
##########
@@ -3,66 +3,147 @@ name: "3rd-party"
 
 on:
   workflow_call:
+    inputs:
+      submit-baseline:
+        type: boolean
+        default: false
+      check-inventory:
+        type: boolean
+        default: true
+    outputs:
+      artifact_id:
+        value: ${{ jobs.dependency-check.outputs.artifact_id }}
+      inventory_artifact_id:
+        value: ${{ jobs.dependency-check.outputs.inventory_artifact_id }}
 
 permissions:
   contents: read
 
 jobs:
   dependency-check:
+    name: dependency-check
     runs-on: ubuntu-24.04
+    # Preserve the existing inventory job budget; baseline-only builds keep 
their 60-minute limit.
+    timeout-minutes: ${{ inputs.check-inventory && 360 || 60 }}
+    outputs:
+      artifact_id: ${{ steps.snapshot.outputs.artifact-id }}
+      inventory_artifact_id: ${{ steps.inventory.outputs.artifact-id }}
     env:
       USE_STAGE: 'false' # Whether to include the stage repository.
       SCRIPT_DEPENDENCY: install-dist/scripts/dependency
       PYTHONDONTWRITEBYTECODE: '1' # Keep generated Python caches out of 
source style checks.
+      INPUT_TOKEN: ''
+      GITHUB_TOKEN: ''
+      GH_TOKEN: ''
     steps:
       - name: Checkout source
-        uses: actions/checkout@v7
+        id: checkout
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: ${{ github.sha }}
+          persist-credentials: false
       - name: Set up project JDK
-        uses: actions/setup-java@v6
+        uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # 
v6.0.1
         with:
           java-version-file: .github/workflows/.java-version
           distribution: 'temurin'
+          cache: maven
 
       - name: use staged maven repo settings
         if: ${{ env.USE_STAGE == 'true' }}
         run: |
-          cp $HOME/.m2/settings.xml /tmp/settings.xml
-          mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
+          cp "$HOME/.m2/settings.xml" /tmp/settings.xml
+          mv -vf .github/configs/settings.xml "$HOME/.m2/settings.xml"
 
       - name: Test shared foundation checks
+        if: inputs.check-inventory
         run: python3 -m unittest discover -s 
install-dist/scripts/shared-foundation -p 'test_*.py'
 
       - name: Test dependency inventory producer and checker
         run: python3 -m unittest discover -s install-dist/scripts/dependency 
-p 'test_*.py'
 
+      - name: Verify baseline checkout and current master
+        if: inputs.submit-baseline
+        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: On a manual `mainline` or `full` run on master, this check now 
fails the whole dependency job if master has moved since the run was 
dispatched, and the existing inventory checks that follow it are skipped.
   
   Evidence: `server-ci.yml` line 76 enables `submit-baseline` for a 
`workflow_dispatch` on master with `mainline`, `full` or `dependencies`. 
`mainline` and `full` also select `dependency_license`, so `check-inventory` is 
true in the same job. Manual runs keep a `run_id` concurrency group 
(`server-ci.yml` line 20), so a newer master push does not cancel them. When 
this line fails, `mvn install`, the shared-foundation check, `generate current 
dependencies` and `check third dependencies` (lines 73-96) have no status 
function in their `if`, so they are skipped and the job is red. Before this PR 
the same manual run had no freshness check and always ran them. Line 113 does 
the same after the checks have passed, so a clean inventory run still ends red. 
The timing is realistic: the manual master run 38620815596 was dispatched at 
2026-10-14T19:06:11Z on 97a7b2982, and master then took 449beb023, e4934c206 
and a1045160c between 19:12:16Z and 19:13:28Z.
   
   Requested change: treat a stale master as "no baseline for this run" rather 
than as a job failure. For example, have this step write `fresh=true` or 
`fresh=false` to `$GITHUB_OUTPUT` with a `::notice::`, gate the snapshot, 
inventory, stale-report and upload steps on it, and expose it as a job output 
so `dependency_baseline` stays skipped. Keep the hard failure only where the 
baseline is the reason for the run (a master push or the `dependencies` preset).



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