This is an automated email from the ASF dual-hosted git repository.

merlimat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new ef5e25c3bbf [fix][ci] Use CodeQL build-mode: none to avoid 
intermittent build-cache failures (#25932)
ef5e25c3bbf is described below

commit ef5e25c3bbf2e5de1b31e600dce606fd48d34bdc
Author: Matteo Merli <[email protected]>
AuthorDate: Thu Jun 4 10:20:48 2026 -0700

    [fix][ci] Use CodeQL build-mode: none to avoid intermittent build-cache 
failures (#25932)
---
 .github/workflows/codeql.yaml    | 23 +++++------------------
 .github/workflows/pulsar-ci.yaml | 20 +++++---------------
 2 files changed, 10 insertions(+), 33 deletions(-)

diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml
index 3d102ae3481..5448dc703e0 100644
--- a/.github/workflows/codeql.yaml
+++ b/.github/workflows/codeql.yaml
@@ -30,9 +30,6 @@ concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
   cancel-in-progress: true
 
-env:
-  JDK_DISTRIBUTION: corretto
-
 jobs:
   analyze:
     # only run on push and schedule in apache/pulsar repo
@@ -52,29 +49,19 @@ jobs:
         language: [ 'java-kotlin' ]
 
     steps:
-      - name: Set up JDK
-        uses: actions/setup-java@v5
-        with:
-          distribution: ${{ env.JDK_DISTRIBUTION }}
-          java-version: 21
-
       - name: Checkout repository
         uses: actions/checkout@v6
 
-      - name: Setup Gradle
-        uses: ./.github/actions/setup-gradle
-        with:
-          develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
-          cache-read-only: true
-
       # Initializes the CodeQL tools for scanning.
+      # Use build-mode: none so CodeQL extracts the source directly instead of
+      # tracing a Gradle build. A traced build fails intermittently because the
+      # Gradle build cache restores compileJava/compileKotlin FROM-CACHE, so no
+      # compiler runs and CodeQL sees no source ("could not process any of 
it").
       - name: Initialize CodeQL
         uses: github/codeql-action/init@v4
         with:
           languages: ${{ matrix.language }}
-
-      - name: Build Java code
-        run: ./gradlew assemble
+          build-mode: none
 
       - name: Perform CodeQL Analysis
         uses: github/codeql-action/analyze@v4
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 4de420d3d07..c1912f8e691 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -836,7 +836,6 @@ jobs:
       contents: read
       security-events: write
     env:
-      CI_JDK_MAJOR_VERSION: ${{ needs.preconditions.outputs.jdk_major_version 
}}
       CODEQL_LANGUAGE: java-kotlin
     steps:
       - name: checkout
@@ -853,24 +852,15 @@ jobs:
         with:
           limit-access-to-actor: true
 
-      - name: Set up JDK ${{ env.CI_JDK_MAJOR_VERSION }}
-        uses: actions/setup-java@v5
-        with:
-          distribution: ${{ env.JDK_DISTRIBUTION }}
-          java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
-
-      - name: Setup Gradle
-        uses: ./.github/actions/setup-gradle
-        with:
-          develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
-
+      # Use build-mode: none so CodeQL extracts the source directly instead of
+      # tracing a Gradle build. A traced build fails intermittently because the
+      # Gradle build cache restores compileJava/compileKotlin FROM-CACHE, so no
+      # compiler runs and CodeQL sees no source ("could not process any of 
it").
       - name: Initialize CodeQL
         uses: github/codeql-action/init@v4
         with:
           languages: ${{ env.CODEQL_LANGUAGE }}
-
-      - name: Build Java code
-        run: ./gradlew assemble
+          build-mode: none
 
       - name: Perform CodeQL Analysis
         uses: github/codeql-action/analyze@v4

Reply via email to