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 0b024d47acd5 ci: filter exclusion list from Scalpel shadow comparison 
(#24387)
0b024d47acd5 is described below

commit 0b024d47acd507ce9eb1d345ed0a93a2ee162b76
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Jul 2 20:23:11 2026 +0200

    ci: filter exclusion list from Scalpel shadow comparison (#24387)
---
 .github/CI-ARCHITECTURE.md                         |  3 +++
 .../actions/incremental-build/incremental-build.sh | 29 ++++++++++++++--------
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/.github/CI-ARCHITECTURE.md b/.github/CI-ARCHITECTURE.md
index e1e8e5ceec26..2e77007d1ad1 100644
--- a/.github/CI-ARCHITECTURE.md
+++ b/.github/CI-ARCHITECTURE.md
@@ -170,8 +170,11 @@ Scalpel runs in **shadow mode**: it observes what 
skip-tests mode *would* have d
 The shadow comparison section shows:
 - How many modules Scalpel would test (direct + downstream)
 - How many downstream modules would have tests skipped (generated code, 
meta-modules)
+- Set differences: modules only Scalpel found vs modules only the current 
approach found
 - The full list of modules in each category
 
+The comparison is apples-to-apples: the current approach's reactor is filtered 
through the `EXCLUSION_LIST` before comparing, so both sides exclude the same 
meta/generated modules (catalog, jbang, docs, etc.).
+
 #### Configuration notes
 
 The script overrides `fullBuildTriggers` to empty 
(`-Dscalpel.fullBuildTriggers=`) because Scalpel's default (`.mvn/**`) would 
trigger a full build whenever `.mvn/extensions.xml` itself changes (e.g., 
Dependabot bumping Scalpel).
diff --git a/.github/actions/incremental-build/incremental-build.sh 
b/.github/actions/incremental-build/incremental-build.sh
index 3d2fa06e08ce..c5d0932d79a0 100755
--- a/.github/actions/incremental-build/incremental-build.sh
+++ b/.github/actions/incremental-build/incremental-build.sh
@@ -414,9 +414,9 @@ checkManualItTests() {
 # ── Scalpel shadow comparison ──────────────────────────────────────────
 
 # Write Scalpel shadow comparison section to the PR comment.
-# Shows what Scalpel would detect vs what the current grep-based approach 
found,
+# Shows what Scalpel would detect vs what the current approach actually tests,
 # with a one-line diff summary. Observation only — does not affect test 
execution.
-# Args: $1=comment_file, $2=grep_dep_module_ids (colon-prefixed, 
comma-separated)
+# Args: $1=comment_file, $2=tested_reactor_ids (newline-separated, already 
filtered by EXCLUSION_LIST)
 writeScalpelComparison() {
   local comment_file="$1"
   local current_reactor_ids="${2:-}"
@@ -495,9 +495,9 @@ writeScalpelComparison() {
   echo "[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected 
**${scalpel_total} affected modules** (current approach: ${current_total})." >> 
"$comment_file"
   echo "" >> "$comment_file"
 
-  # Show modules only Scalpel found (current approach missed)
+  # Show modules only Scalpel found (not in current reactor)
   if [ "$only_scalpel_count" -gt 0 ]; then
-    echo "<details><summary>:warning: Modules only Scalpel found 
(${only_scalpel_count}) — current approach missed these</summary>" >> 
"$comment_file"
+    echo "<details><summary>:warning: Modules only in Scalpel 
(${only_scalpel_count})</summary>" >> "$comment_file"
     echo "" >> "$comment_file"
     echo "$only_in_scalpel" | while read -r m; do
       [ -n "$m" ] && echo "- \`$m\`" >> "$comment_file"
@@ -507,9 +507,9 @@ writeScalpelComparison() {
     echo "" >> "$comment_file"
   fi
 
-  # Show modules only current approach found (Scalpel missed)
+  # Show modules only current approach found (not in Scalpel)
   if [ "$only_current_count" -gt 0 ]; then
-    echo "<details><summary>Modules only current approach found 
(${only_current_count}) — Scalpel missed these</summary>" >> "$comment_file"
+    echo "<details><summary>Modules only in current approach 
(${only_current_count})</summary>" >> "$comment_file"
     echo "" >> "$comment_file"
     echo "$only_in_current" | while read -r m; do
       [ -n "$m" ] && echo "- \`$m\`" >> "$comment_file"
@@ -943,10 +943,19 @@ main() {
   writeComment "$comment_file" "$pl" "$grep_dep_module_ids" 
"$grep_changed_props" "$testedDependents" "$extraModules"
 
   # Scalpel shadow comparison (observation only — after separator)
-  # Pass reactor_ids (artifact IDs of all modules in the -amd reactor) so
-  # Scalpel can compare against the current detection and show modules it
-  # found that the current approach missed.
-  writeScalpelComparison "$comment_file" "$reactor_ids"
+  # Filter reactor_ids through EXCLUSION_LIST so the comparison is
+  # apples-to-apples: both sides exclude the same meta/generated modules.
+  local tested_reactor_ids=""
+  if [ -n "$reactor_ids" ]; then
+    local excl_set
+    excl_set=$(echo "$EXCLUSION_LIST" | sed 's/!://g' | tr ',' '\n')
+    tested_reactor_ids=$(echo "$reactor_ids" | while read -r rid; do
+      if ! echo "$excl_set" | grep -qx "$rid"; then
+        echo "$rid"
+      fi
+    done)
+  fi
+  writeScalpelComparison "$comment_file" "$tested_reactor_ids"
 
   # Check for tests disabled in CI via @DisabledIfSystemProperty(named = 
"ci.env.name")
   local disabled_tests

Reply via email to