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

davsclaus 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 b645eda281fa chore: ci - Scalpel ignores the top-level directories 
that hold no module (design/, camel-sbom/, plugins/) (#31339)
b645eda281fa is described below

commit b645eda281fa4dcb83a3ba85f58fc0f033e56bde
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Dec 4 07:26:48 2026 +0100

    chore: ci - Scalpel ignores the top-level directories that hold no module 
(design/, camel-sbom/, plugins/) (#31339)
    
    Scalpel gave a change under design/ to the root module, and -amd of the 
root is every module, so the design doc PR #31332 tested 703 modules for 2h19m. 
Add design/**, camel-sbom/** and plugins/** to -Dscalpel.excludePaths (the 
file-path step already skips them).
    
    When every changed file is excluded, Scalpel reports status "skipped" 
together with fullBuildTriggered=true. Treat that as "nothing to add" instead 
of a Scalpel failure, so a doc-only PR comment no longer says "Scalpel 
triggered a full build (changed file: null)".
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .github/CI-ARCHITECTURE.md                             |  2 +-
 .github/actions/incremental-build/incremental-build.sh | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/CI-ARCHITECTURE.md b/.github/CI-ARCHITECTURE.md
index 25615417d8ae..85fbe1a499a2 100644
--- a/.github/CI-ARCHITECTURE.md
+++ b/.github/CI-ARCHITECTURE.md
@@ -238,7 +238,7 @@ The comparison is apples-to-apples: the current approach's 
reactor is filtered t
 
 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).
 
-It also passes `-Dscalpel.excludePaths` with `.github/**` and the root-level 
files that do not affect the build (`AGENTS.md`, `CLAUDE.md`, `README.md`, 
`KEYS`, `LICENSE.txt`, `Jenkinsfile*`, `.gitignore`, ...). Since Scalpel 0.5.0 
a changed root-level file that no module owns triggers a full build, which the 
script treats as a Scalpel failure, so a PR that touches `CLAUDE.md` would lose 
Scalpel's module list. `mvnw`, `mvnw.cmd` and `pom.xml` are not excluded: a 
change to them should stil [...]
+It also passes `-Dscalpel.excludePaths` with `.github/**` and the root-level 
files that do not affect the build (`AGENTS.md`, `CLAUDE.md`, `README.md`, 
`KEYS`, `LICENSE.txt`, `Jenkinsfile*`, `.gitignore`, ...). Since Scalpel 0.5.0 
a changed root-level file that no module owns triggers a full build, which the 
script treats as a Scalpel failure, so a PR that touches `CLAUDE.md` would lose 
Scalpel's module list. The top-level directories that hold no module 
(`design/`, `camel-sbom/`, `plugi [...]
 
 The grep-based script fetches the PR diff via the GitHub REST API. When the 
API does not return it (HTTP 406 for a PR beyond the GitHub diff limits, such 
as more than 300 files), the diff is computed from the local checkout against 
its merge base with the base branch, fetching the base branch when the checkout 
does not have it (camel-spring-boot runs this action after a depth-1 checkout); 
without either, the step fails rather than pass without testing (`pr_diff.sh`). 
Scalpel uses local g [...]
 
diff --git a/.github/actions/incremental-build/incremental-build.sh 
b/.github/actions/incremental-build/incremental-build.sh
index 287f73639b97..aab2263c6107 100755
--- a/.github/actions/incremental-build/incremental-build.sh
+++ b/.github/actions/incremental-build/incremental-build.sh
@@ -408,6 +408,9 @@ runScalpelDetection() {
   # - excludePaths: .github/** plus the root-level files that do not affect 
the build.
   #   Since Scalpel 0.5.0 a changed root-level file that no module owns 
triggers a full
   #   build, so a PR that only edits CLAUDE.md or README.md would lose its 
module list.
+  #   The same goes for the top-level directories that hold no module (design/,
+  #   camel-sbom/, plugins/): Scalpel gives their files to the root module, 
and -amd
+  #   of the root is every module, so a design doc PR would test the whole 
project.
   #   mvnw, mvnw.cmd and pom.xml are left out on purpose: they do affect the 
build.
   #   A pattern without a "/" also matches at any depth (e.g. a module's 
README.md);
   #   the file-path step above still picks up the module of such a file.
@@ -421,7 +424,7 @@ runScalpelDetection() {
   # Always pass baseBranch explicitly — relying on Scalpel's 
env.GITHUB_BASE_REF
   # auto-detection is fragile across Maven wrappers and CI rerun contexts.
   local base_branch="origin/${GITHUB_BASE_REF:-main}"
-  local 
exclude_paths=".github/**,AGENTS.md,CLAUDE.md,CONTRIBUTING.md,README.md,SECURITY.md,KEYS,LICENSE.txt,NOTICE.txt,doap.rdf,Jenkinsfile*,.asf.yaml,.gitattributes,.gitignore,.gitmodules,.sdkmanrc,jbang-catalog.json"
+  local 
exclude_paths=".github/**,AGENTS.md,CLAUDE.md,CONTRIBUTING.md,README.md,SECURITY.md,KEYS,LICENSE.txt,NOTICE.txt,doap.rdf,Jenkinsfile*,.asf.yaml,.gitattributes,.gitignore,.gitmodules,.sdkmanrc,jbang-catalog.json,design/**,camel-sbom/**,plugins/**"
   local gen_root
   for gen_root in $generated_only_modules; do
     exclude_paths="${exclude_paths},${gen_root}/src/generated/**"
@@ -456,6 +459,13 @@ runScalpelDetection() {
     return
   fi
 
+  # Every changed file is excluded (only docs or repository files changed): 
Scalpel
+  # skips the detection and reports a full build, but there is nothing for it 
to add.
+  if [ "$(jq -r '.status // ""' "$report")" = "skipped" ]; then
+    echo "  Scalpel: skipped ($(jq -r '.reason // "no reason given"' 
"$report"))"
+    return
+  fi
+
   # Check if full build was triggered
   local full_build
   full_build=$(jq -r '.fullBuildTriggered' "$report")

Reply via email to