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

gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 413ebb7be4d4 Fix detect-dependencies excluding modules that conflict 
with inclusion
413ebb7be4d4 is described below

commit 413ebb7be4d41e68267c33d13092606cb3c334c1
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Mar 19 08:25:11 2026 +0100

    Fix detect-dependencies excluding modules that conflict with inclusion
    
    When a property change in parent/pom.xml only affects modules that are
    in the exclusion list (e.g., camel-jbang-core), Maven fails because the
    same module appears as both included and excluded in the -pl argument.
    
    Filter out excluded modules before running the test command, and skip
    the test entirely if all affected modules are excluded.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .github/actions/detect-dependencies/detect-test.sh | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/.github/actions/detect-dependencies/detect-test.sh 
b/.github/actions/detect-dependencies/detect-test.sh
index c6d91f40b72d..2362fd16957e 100755
--- a/.github/actions/detect-dependencies/detect-test.sh
+++ b/.github/actions/detect-dependencies/detect-test.sh
@@ -272,8 +272,27 @@ main() {
     exit 0
   fi
 
+  # Filter out modules that are in the exclusion list
+  local filtered_ids=""
+  local IFS_backup="$IFS"
+  IFS=','
+  for mod_id in $all_module_ids; do
+    if ! echo ",$exclusionList," | grep -q ",!${mod_id},"; then
+      filtered_ids="${filtered_ids:+${filtered_ids},}${mod_id}"
+    else
+      echo "  Skipping excluded module: $mod_id"
+    fi
+  done
+  IFS="$IFS_backup"
+
+  if [ -z "$filtered_ids" ]; then
+    echo "All affected modules are in the exclusion list, skipping targeted 
tests"
+    write_comment "$changed_props" "$all_module_ids" "$module_count" "skip"
+    exit 0
+  fi
+
   echo "Running targeted tests for affected modules..."
-  $mavenBinary -l $log $MVND_OPTS test -pl 
"${all_module_ids},${exclusionList}" -amd
+  $mavenBinary -l $log $MVND_OPTS test -pl "${filtered_ids},${exclusionList}" 
-amd
   local ret=$?
 
   if [ ${ret} -eq 0 ]; then

Reply via email to