Skip to content

chore(ci): Fix parent POM dependency change detection#22022

Merged
gnodet merged 2 commits intomainfrom
detect-dependencies-fix
Mar 16, 2026
Merged

chore(ci): Fix parent POM dependency change detection#22022
gnodet merged 2 commits intomainfrom
detect-dependencies-fix

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 16, 2026

Summary

The detect-dependencies CI action was never finding affected modules for dependabot PRs that bump versions in parent/pom.xml.

Root cause: The script searched for ${property-name} (e.g., ${jaxb-impl-version}) in module pom.xml files. This never matches because modules inherit managed versions from the parent's <dependencyManagement> without referencing the property directly — they just declare <artifactId>jaxb-impl</artifactId> without a <version>.

Fix: New approach that maps properties to artifacts to modules:

  1. Diff parent/pom.xml to find changed property names
  2. Parse parent/pom.xml to find which <artifactId> uses each property as its <version> in <dependencyManagement>
  3. Search module pom.xml files for those artifact IDs
  4. Run tests for affected modules

Example: For PR #22019 (jaxb-impl-version bump), the old script found 0 modules. The new script correctly finds camel-drill, camel-ibm-cos, and camel-swift.

Additional improvements

  • Posts a PR comment summarizing which modules were tested and whether tests passed/failed
  • Writes step summary output
  • Removes the overly restrictive version|dependency|artifact keyword filter on property names
  • Adds proper skip-mvnd-install input to avoid reinstalling mvnd
  • Only runs on non-experimental matrix builds (skips JDK 25)
  • Caps at 50 modules to avoid excessive test runs

Test plan

  • Verified locally that jaxb-impl-versionjaxb-implcamel-drill, camel-ibm-cos, camel-swift detection works
  • CI will validate the script runs without errors
  • Next dependabot PR touching parent/pom.xml will exercise the full flow

The detect-dependencies action was not finding affected modules because
it searched for ${property-name} references in module pom.xml files.
This never matches because modules inherit managed versions from the
parent without referencing the property directly.

New approach:
1. Detect changed properties in parent/pom.xml diff
2. Map each property to the artifact(s) it versions in dependencyManagement
3. Find modules that depend on those artifacts by searching for artifactId
4. Run tests for affected modules

Also adds:
- PR comment posting with test results summary
- Step summary output
- Proper skip-mvnd-install input in action.yaml
- Run only on non-experimental matrix (skip JDK 25)
- Remove overly restrictive version|dependency|artifact filter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
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 build-all, build-dependents, 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.

Instead of grepping pom.xml files for artifactId references (which
misses transitive dependencies), use toolbox:tree-find to scan the
full dependency tree of every module in the reactor.

This accurately detects modules affected by BOM version bumps (e.g.,
netty-bom -> all modules using any io.netty artifact transitively).

Key changes:
- Extract groupId:artifactId from parent pom (not just artifactId)
- Detect BOM imports and search by groupId wildcard
- Use awk to parse toolbox output (mvnd strips module prefixes
  when captured to variables)
- Add coverage to exclusion list

Tested locally: jaxb-impl-version correctly finds camel-parquet-avro
(transitive via hadoop-common -> jersey-json -> jaxb-impl).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit 5ccc089 into main Mar 16, 2026
2 checks passed
vignesh-manel pushed a commit to vignesh-manel/camel that referenced this pull request Mar 18, 2026
* chore(ci): Fix parent POM dependency change detection

The detect-dependencies action was not finding affected modules because
it searched for ${property-name} references in module pom.xml files.
This never matches because modules inherit managed versions from the
parent without referencing the property directly.

New approach:
1. Detect changed properties in parent/pom.xml diff
2. Map each property to the artifact(s) it versions in dependencyManagement
3. Find modules that depend on those artifacts by searching for artifactId
4. Run tests for affected modules

Also adds:
- PR comment posting with test results summary
- Step summary output
- Proper skip-mvnd-install input in action.yaml
- Run only on non-experimental matrix (skip JDK 25)
- Remove overly restrictive version|dependency|artifact filter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(ci): Use Maveniverse Toolbox for accurate dependency detection

Instead of grepping pom.xml files for artifactId references (which
misses transitive dependencies), use toolbox:tree-find to scan the
full dependency tree of every module in the reactor.

This accurately detects modules affected by BOM version bumps (e.g.,
netty-bom -> all modules using any io.netty artifact transitively).

Key changes:
- Extract groupId:artifactId from parent pom (not just artifactId)
- Detect BOM imports and search by groupId wildcard
- Use awk to parse toolbox output (mvnd strips module prefixes
  when captured to variables)
- Add coverage to exclusion list

Tested locally: jaxb-impl-version correctly finds camel-parquet-avro
(transitive via hadoop-common -> jersey-json -> jaxb-impl).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant