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

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


The following commit(s) were added to refs/heads/master by this push:
     new fab71d228 NUTCH-3211 Skip SonarCloud when test artifacts are absent; 
pin Ubuntu runners before ubuntu-latest moves to 26.04 (#966)
fab71d228 is described below

commit fab71d228322d34a29436a7b855a4dbb5355e21e
Author: Lewis John McGibbney <[email protected]>
AuthorDate: Tue Sep 22 18:38:29 2026 -0700

    NUTCH-3211 Skip SonarCloud when test artifacts are absent; pin Ubuntu 
runners before ubuntu-latest moves to 26.04 (#966)
---
 .github/workflows/jenkins-smoke-test.yml  |  2 +-
 .github/workflows/junit-report.yml        |  6 +--
 .github/workflows/master-build.yml        | 63 ++++++++++++++++++++++---------
 .github/workflows/sonarcloud.yml          | 25 +++++++++---
 .github/workflows/yetus-comment.yml       |  2 +-
 .github/workflows/yetus.yml               |  2 +-
 Jenkinsfile.smoke-test-single-node-hadoop |  3 +-
 7 files changed, 71 insertions(+), 32 deletions(-)

diff --git a/.github/workflows/jenkins-smoke-test.yml 
b/.github/workflows/jenkins-smoke-test.yml
index c906f6288..4dbb87563 100644
--- a/.github/workflows/jenkins-smoke-test.yml
+++ b/.github/workflows/jenkins-smoke-test.yml
@@ -35,7 +35,7 @@ permissions:
 
 jobs:
   trigger-smoke-test:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     # GitHub cannot filter issue_comment events by body under "on:", so it 
records
     # a (skipped) workflow run for every comment. This job-level guard ensures 
a
     # runner only starts for tag pushes or PR comments that mention 
/smoke-test;
diff --git a/.github/workflows/junit-report.yml 
b/.github/workflows/junit-report.yml
index ce000e3fd..69a0c8cc8 100644
--- a/.github/workflows/junit-report.yml
+++ b/.github/workflows/junit-report.yml
@@ -35,7 +35,7 @@ jobs:
       github.event.workflow_run.event == 'pull_request' &&
       (github.event.workflow_run.conclusion == 'success' ||
        github.event.workflow_run.conclusion == 'failure')
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - name: Set up JDK 17
         uses: actions/setup-java@v6
@@ -43,13 +43,13 @@ jobs:
           java-version: '17'
           distribution: 'temurin'
       - name: Download Test Report (Ubuntu JDK 17)
-        continue-on-error: true
         uses: dawidd6/action-download-artifact@v24
         with:
-          name: junit-test-results-ubuntu-latest-jdk17
+          name: junit-test-results-linux-jdk17
           workflow: master-build.yml
           run_id: ${{ github.event.workflow_run.id }}
           path: ./junit-ubuntu-jdk17
+          if_no_artifact_found: ignore
       - name: Verify JUnit XML layout
         id: xml
         run: |
diff --git a/.github/workflows/master-build.yml 
b/.github/workflows/master-build.yml
index 27d4f49cb..8d1df20c8 100644
--- a/.github/workflows/master-build.yml
+++ b/.github/workflows/master-build.yml
@@ -39,7 +39,7 @@ jobs:
     strategy:
       matrix:
         java: ['17', '21']
-        os: [ubuntu-latest]
+        os: [ubuntu-24.04]
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v7
@@ -62,7 +62,7 @@ jobs:
     strategy:
       matrix:
         java: ['17', '21']
-        os: [ubuntu-latest]
+        os: [ubuntu-24.04]
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v7
@@ -92,7 +92,7 @@ jobs:
         run: exit 1
 
   openapi-lint:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v7
       - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d
@@ -118,7 +118,7 @@ jobs:
   # Path-filtered: only runs when Jenkinsfile* changes. Local mode validates
   # vanilla Declarative syntax, not every plugin on ci-builds.apache.org.
   jenkinsfile-lint:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v7
       - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d
@@ -145,7 +145,7 @@ jobs:
       fail-fast: false
       matrix:
         java: ['17', '21']
-        os: [ubuntu-latest]
+        os: [ubuntu-24.04]
     runs-on: ${{ matrix.os }}
     name: build (jdk ${{ matrix.java }}, javac.version=17)
     steps:
@@ -194,7 +194,7 @@ jobs:
       fail-fast: false
       matrix:
         java: ['17', '21']
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     name: runtime-smoke (jdk ${{ matrix.java }})
     steps:
       - uses: actions/checkout@v7
@@ -225,7 +225,7 @@ jobs:
       fail-fast: false
       matrix:
         java: ['17', '21']
-        os: [ubuntu-latest, macos-latest]
+        os: [ubuntu-24.04, macos-latest]
     runs-on: ${{ matrix.os }}
     name: tests (jdk ${{ matrix.java }}, ${{ matrix.os }})
     timeout-minutes: 45
@@ -263,30 +263,57 @@ jobs:
               - '.github/workflows/*'
       # run if the build configuration or both 'core' and 'plugins' files were 
changed
       - name: test all
+        id: test_all
         if: ${{ steps.filter.outputs.buildconf == 'true' || ( 
steps.filter.outputs.core  == 'true' && steps.filter.outputs.plugins  == 'true' 
) }}
         run: ant clean test forbidden-api-checks -buildfile build.xml | tee 
build.log
       # run only if 'core' files were changed
       - name: test core
+        id: test_core
         if: ${{ steps.filter.outputs.core == 'true' && 
steps.filter.outputs.plugins == 'false' && steps.filter.outputs.buildconf == 
'false' }}
         run: ant clean test-core forbidden-api-checks -buildfile build.xml | 
tee build.log
       # run only if 'plugins' files were changed
       - name: test plugins
+        id: test_plugins
         if: ${{ steps.filter.outputs.plugins == 'true' && 
steps.filter.outputs.core == 'false' && steps.filter.outputs.buildconf == 
'false' }}
         run: ant clean test-plugins forbidden-api-checks -buildfile build.xml 
| tee build.log
-      # run indexer integration tests when indexer plugin files change (Docker 
required, ubuntu-latest only)
+      # run indexer integration tests when indexer plugin files change (Docker 
required, ubuntu-24.04 only)
       - name: test indexer integration
-        if: ${{ steps.filter.outputs.indexer_plugins == 'true' && matrix.os == 
'ubuntu-latest' }}
+        id: test_indexer
+        if: ${{ steps.filter.outputs.indexer_plugins == 'true' && matrix.os == 
'ubuntu-24.04' }}
         run: ant test-indexer-integration -buildfile build.xml
-      # run protocol integration tests when protocol plugin files change 
(Docker required, ubuntu-latest only)
+      # run protocol integration tests when protocol plugin files change 
(Docker required, ubuntu-24.04 only)
       - name: test protocol integration
-        if: ${{ steps.filter.outputs.protocol_plugins == 'true' && matrix.os 
== 'ubuntu-latest' }}
+        id: test_protocol
+        if: ${{ steps.filter.outputs.protocol_plugins == 'true' && matrix.os 
== 'ubuntu-24.04' }}
         run: ant test-protocol-integration -buildfile build.xml
+      - name: Record whether tests ran
+        id: ran
+        if: always()
+        env:
+          TEST_ALL: ${{ steps.test_all.outcome }}
+          TEST_CORE: ${{ steps.test_core.outcome }}
+          TEST_PLUGINS: ${{ steps.test_plugins.outcome }}
+          TEST_INDEXER: ${{ steps.test_indexer.outcome }}
+          TEST_PROTOCOL: ${{ steps.test_protocol.outcome }}
+        run: |
+          ran=false
+          for o in "$TEST_ALL" "$TEST_CORE" "$TEST_PLUGINS" "$TEST_INDEXER" 
"$TEST_PROTOCOL"; do
+            if [ "$o" = "success" ] || [ "$o" = "failure" ]; then
+              ran=true
+              break
+            fi
+          done
+          echo "value=$ran" >> "$GITHUB_OUTPUT"
+          if [ "$ran" != true ]; then
+            echo "::notice::No test steps ran (path-filtered). Skipping JaCoCo 
and artifact uploads."
+          fi
       - name: Generate JaCoCo XML report
+        if: always() && steps.ran.outputs.value == 'true'
         run: ant jacoco-report -buildfile build.xml
         continue-on-error: true
       - name: Check for test results
         id: check_tests
-        if: always() && matrix.os == 'ubuntu-latest'
+        if: always() && matrix.os == 'ubuntu-24.04' && steps.ran.outputs.value 
== 'true'
         run: |
           shopt -s globstar nullglob
           files=(./build/test/TEST-*.xml ./build/**/test/TEST-*.xml)
@@ -332,9 +359,9 @@ jobs:
           exit 0
       - name: Upload Build and Test Artifacts (Binaries)
         uses: actions/upload-artifact@v7
-        if: always() && matrix.os == 'ubuntu-latest' && matrix.java == '17' && 
steps.check_tests.outputs.has_results == 'true'
+        if: always() && matrix.os == 'ubuntu-24.04' && matrix.java == '17' && 
steps.ran.outputs.value == 'true' && steps.check_tests.outputs.has_results == 
'true'
         with:
-          name: build-artifacts-${{ matrix.os }}-jdk${{ matrix.java }}
+          name: build-artifacts-linux-jdk${{ matrix.java }}
           path: |
             # core class files
             ./build/classes/**/*.class
@@ -348,18 +375,18 @@ jobs:
           retention-days: 1
       - name: Upload Test Report
         uses: actions/upload-artifact@v7
-        if: always() && matrix.os == 'ubuntu-latest' && matrix.java == '17' && 
steps.check_tests.outputs.has_results == 'true'
+        if: always() && matrix.os == 'ubuntu-24.04' && matrix.java == '17' && 
steps.ran.outputs.value == 'true' && steps.check_tests.outputs.has_results == 
'true'
         with:
-          name: junit-test-results-${{ matrix.os }}-jdk${{ matrix.java }}
+          name: junit-test-results-linux-jdk${{ matrix.java }}
           path: |
             ./build/test/TEST-*.xml
             ./build/**/test/TEST-*.xml
           retention-days: 1
       - name: Upload Coverage Data
         uses: actions/upload-artifact@v7
-        if: always() && matrix.os == 'ubuntu-latest'
+        if: always() && matrix.os == 'ubuntu-24.04' && steps.ran.outputs.value 
== 'true'
         with:
-          name: coverage-data-ubuntu-jdk${{ matrix.java }}
+          name: coverage-data-linux-jdk${{ matrix.java }}
           path: |
             ./build/coverage/*.exec
             ./build/coverage/jacoco.xml
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index 49ce1a57c..de022089c 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -32,7 +32,7 @@ jobs:
   # It is triggered after the Build workflow completes; avoid running any code 
from the pull request itself.
   sonarcloud-scan:
     if: ${{ github.event.workflow_run.conclusion == 'success' }}
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
 
     steps:
       - uses: actions/checkout@v7
@@ -56,25 +56,34 @@ jobs:
 
       # Coverage and JUnit XML come only from the master-build Ubuntu JDK 17 
matrix job.
       - name: Download Binary Artifacts (Ubuntu JDK 17)
+        id: bins
         uses: dawidd6/action-download-artifact@v24
         with:
-          name: build-artifacts-ubuntu-latest-jdk17
+          name: build-artifacts-linux-jdk17
           workflow: master-build.yml
           run_id: ${{ github.event.workflow_run.id }}
           path: ./build/
+          if_no_artifact_found: ignore
+
+      - name: Skip SonarCloud when test artifacts are absent
+        if: steps.bins.outputs.found_artifact != 'true'
+        run: |
+          echo "::notice::No Ubuntu JDK 17 build artifacts (tests may have 
been path-filtered). Skipping SonarCloud scan."
 
       - name: Download coverage data (Ubuntu JDK 17)
+        if: steps.bins.outputs.found_artifact == 'true'
         uses: dawidd6/action-download-artifact@v24
         with:
-          name: coverage-data-ubuntu-jdk17
+          name: coverage-data-linux-jdk17
           workflow: master-build.yml
           run_id: ${{ github.event.workflow_run.id }}
           path: ./build/coverage/
 
       - name: Download test reports (Ubuntu JDK 17)
+        if: steps.bins.outputs.found_artifact == 'true'
         uses: dawidd6/action-download-artifact@v24
         with:
-          name: junit-test-results-ubuntu-latest-jdk17
+          name: junit-test-results-linux-jdk17
           workflow: master-build.yml
           run_id: ${{ github.event.workflow_run.id }}
           # Artifact has build/ stripped (upload-artifact LCA); re-root under 
build/
@@ -82,11 +91,13 @@ jobs:
           path: ./build/
 
       - name: Flatten test reports (JDK 17 only)
+        if: steps.bins.outputs.found_artifact == 'true'
         run: |
           mkdir -p ./build/test-reports
           find ./build/test ./build/*/test/ -name 'TEST-*.xml' -exec cp {} 
./build/test-reports/ \;
 
       - name: Verify Sonar inputs
+        if: steps.bins.outputs.found_artifact == 'true'
         run: |
           set -euo pipefail
           if ! find ./build -name '*.class' -print -quit | grep -q .; then
@@ -104,6 +115,7 @@ jobs:
           echo "Sonar inputs OK: classes, jacoco.xml, and JUnit reports 
present."
 
       - name: Set Sonar project version
+        if: steps.bins.outputs.found_artifact == 'true'
         id: version
         run: |
           NUTCH_VERSION=$(grep '^version=' default.properties | cut -d= -f2)
@@ -115,6 +127,7 @@ jobs:
           echo "Sonar project version: ${NUTCH_VERSION}"
 
       - name: Resolve PR number
+        if: steps.bins.outputs.found_artifact == 'true'
         id: pr
         run: |
           if [ "${{ github.event.workflow_run.event }}" != "pull_request" ]; 
then
@@ -148,7 +161,7 @@ jobs:
           GH_TOKEN: ${{ github.token }}
 
       - name: SonarCloud Scan (PR)
-        if: steps.pr.outputs.is_pr == 'true'
+        if: steps.bins.outputs.found_artifact == 'true' && 
steps.pr.outputs.is_pr == 'true'
         uses: 
SonarSource/sonarqube-scan-action@ba9859eae8dd6bd29e412f25ddbbef3d032000f4
         with:
           args: >
@@ -161,7 +174,7 @@ jobs:
           SONAR_HOST_URL: https://sonarcloud.io
 
       - name: SonarCloud Scan (branch)
-        if: steps.pr.outputs.is_pr == 'false' && steps.pr.outputs.skip != 
'true'
+        if: steps.bins.outputs.found_artifact == 'true' && 
steps.pr.outputs.is_pr == 'false' && steps.pr.outputs.skip != 'true'
         uses: 
SonarSource/sonarqube-scan-action@ba9859eae8dd6bd29e412f25ddbbef3d032000f4
         with:
           args: >
diff --git a/.github/workflows/yetus-comment.yml 
b/.github/workflows/yetus-comment.yml
index 8bc5d0d13..b18a714d8 100644
--- a/.github/workflows/yetus-comment.yml
+++ b/.github/workflows/yetus-comment.yml
@@ -37,7 +37,7 @@ jobs:
       github.event.workflow_run.event == 'pull_request' &&
       (github.event.workflow_run.conclusion == 'success' ||
        github.event.workflow_run.conclusion == 'failure')
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - name: Download Yetus PR comment artifacts
         continue-on-error: true
diff --git a/.github/workflows/yetus.yml b/.github/workflows/yetus.yml
index 73c5b712e..0fdecaabc 100644
--- a/.github/workflows/yetus.yml
+++ b/.github/workflows/yetus.yml
@@ -39,7 +39,7 @@ permissions:
 
 jobs:
   yetus:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     timeout-minutes: 45
     env:
       PATCH_DIR: ${{ github.workspace }}/out
diff --git a/Jenkinsfile.smoke-test-single-node-hadoop 
b/Jenkinsfile.smoke-test-single-node-hadoop
index 95b10a052..87b208286 100644
--- a/Jenkinsfile.smoke-test-single-node-hadoop
+++ b/Jenkinsfile.smoke-test-single-node-hadoop
@@ -51,12 +51,11 @@ String nutchSmokePrCommentBody(String statusEmoji, String 
statusText, String dur
         "๐Ÿงช Nutch smoke test โ€” ${statusEmoji} ${statusText}",
         "๐ŸŒฟ GIT_REF: `${gitRef}`",
         "๐Ÿ˜ Hadoop: `${params.HADOOP_VERSION}`",
-        "๐Ÿท๏ธ Build: #${env.BUILD_NUMBER}",
+        "๐Ÿท๏ธ Build: [${env.BUILD_NUMBER}](${env.BUILD_URL})",
     ]
     if (durationText) {
         lines.add("โฑ๏ธ ${durationText}")
     }
-    lines.add("๐Ÿ”— ${env.BUILD_URL}")
     return lines.join('\n')
 }
 

Reply via email to