Skip to content

ci: run Scalpel shadow comparison for all PRs, add depth=50 step - #24368

Merged
gnodet merged 1 commit into
apache:mainfrom
gnodet:optimize-scalpel-deepening
Jul 2, 2026
Merged

ci: run Scalpel shadow comparison for all PRs, add depth=50 step#24368
gnodet merged 1 commit into
apache:mainfrom
gnodet:optimize-scalpel-deepening

Conversation

@gnodet

@gnodet gnodet commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Run Scalpel for all PRs — not just those changing pom.xml. Scalpel detects source file changes (SOURCE_CHANGE, TEST_CHANGE) and distinguishes test-only changes from main source changes, building confidence for a future switch to Scalpel-driven builds.
  • Add depth=50 first step — recent PRs where the merge base is close avoid fetching 200 commits upfront. Progressive depths: 50 → 200 → 1000 → full.
  • Fix Scalpel comparison — compare against full current detection (file-path + grep + -amd), not just grep POM. Show modules each approach finds that the other misses.
  • Fix reactor list parsing — long module names (e.g. "CSimple Maven Plugin (deprecated)") had no dots in Maven output, leaving SUCCESS/FAILURE attached to the name → duplicates in the "All tested modules" list.

One-line summary format

The Scalpel shadow comparison now shows:

🔬 Scalpel shadow comparison — Scalpel: 10 tested, 29 compile-only — current: 39 all tested

This tells reviewers at a glance: Scalpel would only run tests on 10 modules instead of 39, skipping tests for 29 meta/generated modules while still compiling them.

Changes

File Change
pr-build-main.yml Deepening with 50 → 200 → 1000 → full (was 200 → 1000 → full)
incremental-build.sh Remove pom.xml condition — Scalpel runs for every PR. Fix comparison to use full reactor. Fix reactor name parsing.
CI-ARCHITECTURE.md Update docs

Test plan

  • Java-only PR: verify Scalpel shadow comparison appears, no duplicates in module list
  • POM-changing PR: verify Scalpel comparison shows correct set differences

Claude Code on behalf of Guillaume Nodet

🤖 Generated with Claude Code

@gnodet
gnodet requested review from Croway, apupier and oscerd July 2, 2026 06:34
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the docs label Jul 2, 2026
@gnodet
gnodet marked this pull request as draft July 2, 2026 06:35
@gnodet gnodet changed the title ci: move Scalpel deepening to on-demand (skip for Java-only PRs) ci: run Scalpel shadow comparison for all PRs, add depth=50 step Jul 2, 2026
@gnodet
gnodet force-pushed the optimize-scalpel-deepening branch from fb3b4c6 to 59b6a89 Compare July 2, 2026 06:49
@gnodet
gnodet marked this pull request as ready for review July 2, 2026 06:51
Run Scalpel shadow comparison for all PRs, not just those changing
pom.xml. Scalpel detects source file changes (SOURCE_CHANGE,
TEST_CHANGE) and distinguishes test-only changes — comparing it
against the grep-based approach on every PR builds confidence for
a future switch to Scalpel-driven builds.

Also add depth=50 as the first deepening step so recent PRs avoid
the cost of fetching 200 commits upfront.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the optimize-scalpel-deepening branch from 59b6a89 to 7884e28 Compare July 2, 2026 06:52
@gnodet
gnodet merged commit 71be477 into apache:main Jul 2, 2026
3 checks passed

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Low-risk CI change, and the trust model is sound: on: pull_request (not pull_request_target), permissions: contents: read, persist-credentials: false, and no untrusted PR input is interpolated into run: steps — comment posting is offloaded to a separate workflow_run. CI-ARCHITECTURE.md is updated and matches the code. Scalpel already runs on main; this only widens when it's invoked, and it's defensively coded (guards merge-base reachability, catches mvn validate failure, never fails the build).

Two small non-blocking notes:

  • The step-2b comment calls this "shadow mode … does not affect actual test execution," but step 2c unions scalpel_module_ids into dep_module_ids, which drives the real -pl build. The effect is conservative — it only adds modules, never removes, so it can't cause under-testing — but the wording could mislead a future maintainer.
  • Dropping the grep … pom.xml gate partially relaxes CAMEL-23565 / #23371 (root-pom-only PRs will now run Scalpel and may enlarge the tested set). This looks intentional given the "build confidence for a future switch" goal — a one-line acknowledgement that it relaxes #23371 would help the next reader.

Reviewed with Claude Code on behalf of Andrea Cosentino. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants