Skip to content

ci: fix incremental build exclusion list failing on leaf modules#22657

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:ci-fix/incremental-build-exclusion-reactor
Apr 16, 2026
Merged

ci: fix incremental build exclusion list failing on leaf modules#22657
Croway merged 1 commit into
apache:mainfrom
Croway:ci-fix/incremental-build-exclusion-reactor

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented Apr 16, 2026

Summary

  • Fix Could not find the selected project in the reactor: :camel-allcomponents error that breaks CI for PRs changing leaf modules (e.g. camel-jbang)
  • The EXCLUSION_LIST appended to -pl with -amd references modules that may not be dependents of the changed modules, causing Maven to fail when they're not in the resolved reactor
  • Resolve the -amd reactor and drop exclusions for modules not present in it
  • Reuse the threshold check's Maven call to capture reactor artifact IDs, avoiding a second invocation

Root cause: introduced in #22247 (Apr 8) — the EXCLUSION_LIST was appended to -pl -amd without validating that excluded modules are reachable as dependents. Works for core modules (whose dependents include everything) but fails for leaf modules with small reactors.

Reproducer: ./mvnw -B -q help:evaluate -Dexpression=project.artifactId -pl "dsl/camel-jbang/camel-jbang-core,!:camel-allcomponents" -amd

Test plan

  • Reproduced locally: the above command fails before the fix
  • Verified camel-allcomponents is correctly identified as NOT in the -amd reactor for camel-jbang-core
  • Verified camel-allcomponents IS in the -amd reactor for core/camel-api (exclusion kept)
  • CI passes on a PR that changes only leaf modules (e.g. camel-jbang)

Maven errors with "Could not find the selected project in the reactor"
when -pl exclusions (e.g. !:camel-allcomponents) reference modules
that are not dependents of the changed modules and therefore not in
the -amd reactor.

Fix by resolving the -amd reactor and dropping exclusions for modules
not present in it. The threshold check's Maven call is reused to
capture reactor artifact IDs, avoiding a second invocation.
@github-actions
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.

@Croway Croway merged commit 889c048 into apache:main Apr 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants