Conditionally enable OpenRewrite FQCN shortening in CI#23060
Open
gnodet wants to merge 1 commit intoapache:mainfrom
Open
Conditionally enable OpenRewrite FQCN shortening in CI#23060gnodet wants to merge 1 commit intoapache:mainfrom
gnodet wants to merge 1 commit intoapache:mainfrom
Conversation
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
|
Instead of always running OpenRewrite (which quadruples build time), detect FQCNs in the diff and only enable -Prewrite when needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced May 7, 2026
Contributor
Author
|
Claude Code on behalf of Guillaume Nodet Benchmark resultsTested with two companion PRs to measure the impact:
~8 minutes saved (~36% faster) on builds that don't introduce FQCNs, which is the common case (dependency bumps, doc changes, clean code). When FQCNs are detected, OpenRewrite runs as before — no regression in correctness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #23041 which disabled OpenRewrite entirely because it quadrupled CI build times.
This re-enables OpenRewrite conditionally:
regen.shnow greps the diff for fully qualified class name patterns and only adds-Prewritewhen FQCNs are detected. Most builds (dependency bumps, doc changes, code without FQCNs) skip it entirely.How it works
Before the build, the script:
git fetch --deepen=1for shallow clones)HEAD~1 HEADon.javafiles (excluding generated, imports, packages, comments)java.util.List,org.apache.camel.Exchange), appends-PrewritetoMAVEN_EXTRA_ARGSmvn installpicks it up — no separate build pass neededFor PR builds,
actions/checkoutcreates a merge commit whereHEAD~1is the base branch tip, so the diff covers all PR changes. For main builds,HEAD~1is the previous (squash-merged) commit.Test plan
--deepen=1to get parent commit)