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 790694141 NUTCH-3191 Fix SonarCloud PR analysis: missing JaCoCo XML, 
test binaries path, and source encoding warnings (#943)
790694141 is described below

commit 790694141756b0c931a5433d2fdd61feb8cdf059
Author: Lewis John McGibbney <[email protected]>
AuthorDate: Thu Jul 23 12:31:32 2026 -0700

    NUTCH-3191 Fix SonarCloud PR analysis: missing JaCoCo XML, test binaries 
path, and source encoding warnings (#943)
---
 .github/workflows/junit-report.yml             | 10 ++++++----
 .github/workflows/master-build.yml             |  6 +++++-
 .github/workflows/sonarcloud.yml               |  6 +++---
 sonar-project.properties                       |  2 +-
 src/java/org/apache/nutch/util/StringUtil.java |  4 ++--
 src/java/org/apache/nutch/util/TableUtil.java  |  2 +-
 6 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/junit-report.yml 
b/.github/workflows/junit-report.yml
index 8eae9f5f2..08fb180be 100644
--- a/.github/workflows/junit-report.yml
+++ b/.github/workflows/junit-report.yml
@@ -55,13 +55,15 @@ jobs:
             echo "::error::Download path $root is missing."
             exit 1
           fi
-          files=("$root"/build/**/TEST-*.xml)
+          # upload-artifact strips the common 'build/' prefix from the uploaded
+          # paths, so reports land as $root/test/... and 
$root/<plugin>/test/...
+          files=("$root"/**/TEST-*.xml)
           if [ ${#files[@]} -eq 0 ] || [ ! -e "${files[0]}" ]; then
-            echo "::error::No TEST-*.xml under $root/build/ (artifact missing, 
wrong layout, or download failed)."
+            echo "::error::No TEST-*.xml under $root/ (artifact missing, wrong 
layout, or download failed)."
             find "$root" -maxdepth 5 -type d -print 2>/dev/null | head -80 || 
true
             exit 1
           fi
-          echo "Found ${#files[@]} JUnit report file(s) under $root/build/."
+          echo "Found ${#files[@]} JUnit report file(s) under $root/."
       - name: Resolve PR number
         id: pr
         run: |
@@ -82,7 +84,7 @@ jobs:
       - name: Publish Test Report
         uses: mikepenz/action-junit-report@v6
         with:
-          report_paths: ./junit-ubuntu-jdk17/build/**/TEST-*.xml
+          report_paths: ./junit-ubuntu-jdk17/**/TEST-*.xml
           check_name: JUnit Test Report
           commit: ${{ github.event.workflow_run.head_sha }}
           fail_on_failure: false
diff --git a/.github/workflows/master-build.yml 
b/.github/workflows/master-build.yml
index 5e6b0302a..74072f591 100644
--- a/.github/workflows/master-build.yml
+++ b/.github/workflows/master-build.yml
@@ -280,6 +280,8 @@ jobs:
             ./build/classes/**/*.class
             # plugin and test class files
             ./build/**/classes/**/*.class
+            # plugin test class files (compiled into build/<plugin>/test/)
+            ./build/*/test/**/*.class
             # dependencies
             ./build/lib/*.jar
             ./build/test/lib/*.jar
@@ -298,6 +300,8 @@ jobs:
         if: always() && matrix.os == 'ubuntu-latest'
         with:
           name: coverage-data-ubuntu-jdk${{ matrix.java }}
-          path: ./build/coverage/*.exec
+          path: |
+            ./build/coverage/*.exec
+            ./build/coverage/jacoco.xml
           retention-days: 1
           if-no-files-found: ignore
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index ed51d67a8..b68976fd5 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -79,9 +79,9 @@ jobs:
           name: junit-test-results-ubuntu-latest-jdk17
           workflow: master-build.yml
           run_id: ${{ github.event.workflow_run.id }}
-          path: |
-            ./build/test/TEST-*.xml
-            ./build/**/test/TEST-*.xml
+          # Artifact has build/ stripped (upload-artifact LCA); re-root under 
build/
+          # so paths match build/test/... and build/<plugin>/test/...
+          path: ./build/
         continue-on-error: true
 
       - name: Flatten test reports (JDK 17 only)
diff --git a/sonar-project.properties b/sonar-project.properties
index c8d7c8024..16e049ca8 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -27,7 +27,7 @@ sonar.links.ci=https://github.com/apache/nutch/actions
 sonar.sources=src/java,src/plugin
 sonar.tests=src/test,src/plugin
 sonar.test.inclusions=**/src/test/**/*.java,**/Test*.java,**/*IT.java
-sonar.exclusions=**/build.xml,**/build-ivy.xml,**/build-plugin.xml,**/ivy.xml,**/plugin.xml
+sonar.exclusions=**/build.xml,**/build-ivy.xml,**/build-plugin.xml,**/ivy.xml,**/plugin.xml,**/sample/**,**/data/**,**/logs/**
 sonar.source.encoding=UTF-8
 sonar.java.source=17
 
diff --git a/src/java/org/apache/nutch/util/StringUtil.java 
b/src/java/org/apache/nutch/util/StringUtil.java
index 70e8b13b5..c8a84c298 100644
--- a/src/java/org/apache/nutch/util/StringUtil.java
+++ b/src/java/org/apache/nutch/util/StringUtil.java
@@ -151,12 +151,12 @@ public class StringUtil {
   }
 
   /**
-   * Simple character substitution which cleans/removes all � chars from a 
given String.
+   * Simple character substitution which cleans/removes all \uFFFD chars from 
a given String.
    * @param value the String to clean
    * @return substituted cleaned string
    */
   public static String cleanField(String value) {
-    return value.replaceAll("�", "");
+    return value.replaceAll("\uFFFD", "");
   }
 
   /**
diff --git a/src/java/org/apache/nutch/util/TableUtil.java 
b/src/java/org/apache/nutch/util/TableUtil.java
index aab01543c..bd3c5c75a 100644
--- a/src/java/org/apache/nutch/util/TableUtil.java
+++ b/src/java/org/apache/nutch/util/TableUtil.java
@@ -146,7 +146,7 @@ public class TableUtil {
   }
 
   /**
-   * Convert given Utf8 instance to String and and cleans out any offending "�"
+   * Convert given Utf8 instance to String and and cleans out any offending 
"\uFFFD"
    * from the String.
    * 
    * 

Reply via email to