Apache Nutch is an extensible and scalable web crawler
NUTCH-3211 Skip SonarCloud when test artifacts are absent; pin Ubuntu runners before ubuntu-latest moves to 26.04 (#966)
Lewis John McGibbneyfab71d228322
diff --git a/.github/workflows/jenkins-smoke-test.yml b/.github/workflows/jenkins-smoke-test.ymlindex 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.ymlindex 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.04steps:- name: Set up JDK 17uses: actions/setup-java@v6@@ -43,13 +43,13 @@ jobs:java-version: '17'distribution: 'temurin'- name: Download Test Report (Ubuntu JDK 17)- continue-on-error: trueuses: dawidd6/action-download-artifact@v24with:- name: junit-test-results-ubuntu-latest-jdk17+ name: junit-test-results-linux-jdk17workflow: master-build.ymlrun_id: ${{ github.event.workflow_run.id }}path: ./junit-ubuntu-jdk17+ if_no_artifact_found: ignore- name: Verify JUnit XML layoutid: xmlrun: |diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.ymlindex 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 1openapi-lint:- runs-on: ubuntu-latest+ runs-on: ubuntu-24.04steps:- 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.04steps:- uses: actions/checkout@v7- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d@@ -145,7 +145,7 @@ jobs:fail-fast: falsematrix: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: falsematrix:java: ['17', '21']- runs-on: ubuntu-latest+ runs-on: ubuntu-24.04name: runtime-smoke (jdk ${{ matrix.java }})steps:- uses: actions/checkout@v7@@ -225,7 +225,7 @@ jobs:fail-fast: falsematrix: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_allif: ${{ 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_coreif: ${{ 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_pluginsif: ${{ 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.xmlcontinue-on-error: true- name: Check for test resultsid: check_tests- if: always() && matrix.os == 'ubuntu-latest'+ if: always() && matrix.os == 'ubuntu-24.04' && steps.ran.outputs.value == 'true'run: |shopt -s globstar nullglobfiles=(./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 Reportuses: 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-*.xmlretention-days: 1- name: Upload Coverage Datauses: 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.xmldiff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.ymlindex 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.04steps:- 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: binsuses: dawidd6/action-download-artifact@v24with:- name: build-artifacts-ubuntu-latest-jdk17+ name: build-artifacts-linux-jdk17workflow: master-build.ymlrun_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@v24with:- name: coverage-data-ubuntu-jdk17+ name: coverage-data-linux-jdk17workflow: master-build.ymlrun_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@v24with:- name: junit-test-results-ubuntu-latest-jdk17+ name: junit-test-results-linux-jdk17workflow: master-build.ymlrun_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-reportsfind ./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 pipefailif ! 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: versionrun: |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: prrun: |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@ba9859eae8dd6bd29e412f25ddbbef3d032000f4with: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@ba9859eae8dd6bd29e412f25ddbbef3d032000f4with:args: >diff --git a/.github/workflows/yetus-comment.yml b/.github/workflows/yetus-comment.ymlindex 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.04steps:- name: Download Yetus PR comment artifactscontinue-on-error: truediff --git a/.github/workflows/yetus.yml b/.github/workflows/yetus.ymlindex 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.04timeout-minutes: 45env:PATCH_DIR: ${{ github.workspace }}/outdiff --git a/Jenkinsfile.smoke-test-single-node-hadoop b/Jenkinsfile.smoke-test-single-node-hadoopindex 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')}