Camel-jbang - adds target java version of exported app (during RUN)#22071
Camel-jbang - adds target java version of exported app (during RUN)#22071JiriOndrusek wants to merge 4 commits intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
…letion candidates - Resolve merge conflicts with apache#22196 (completionCandidates) - Remove duplicate eq.javaVersion assignments in runQuarkus() and runSpringBoot() - Add "17" to JavaVersionCompletionCandidates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of Guillaume Nodet
I've merged main into the branch and resolved the merge conflicts with #22196 (completionCandidates). I also fixed:
- Duplicate
eq.javaVersionassignments — bothrunQuarkus()andrunSpringBoot()had the field set twice (once from the PR, once from the merge with #22196). Removed the duplicates. - Added "17" to
JavaVersionCompletionCandidates— the PR's intent to support Java 17 needs to be reflected in the completion candidates (added by #22196), not just in the description string.
Remaining items that need attention:
- Annotation style inconsistency: The new option in
Run.javauses@CommandLine.Optionwhile most other options in the same file use the imported short form@Option - No tests: No tests verify the
--java-versionoption is parsed and propagated fromRunto the export commands - Generated files:
camel-jbang-commands-metadata.jsonand docs need regeneration after adding the new option toRun
|
The remaining items were addressed in the latest commit |
gnodet
left a comment
There was a problem hiding this comment.
Second In-Depth Review
Claude Code on behalf of Guillaume Nodet
Thanks for the updates — the test addition addresses one item from the first review. Here's a thorough second pass:
1. Accidental files (blocking)
.superset/config.json and TODO-4.19-ideas.md are unrelated to this PR and should not be committed. Please remove them from the branch.
2. Overlap with CAMEL-23235 (important)
Commit c00319b ("CAMEL-23235: Propagate --java-version option to jbang run/debug commands") was merged to main on March 23 and already implements the core feature this PR was targeting:
- Added
--java-versiontoRun.javawithJavaVersionCompletionCandidates - Propagated
javaVersiontorunQuarkus(),runSpringBoot(), profile settings, jbang args, andExportBaseCommand
After the merge-with-main in the second commit, the actual new changes in this PR are now limited to:
- Annotation style cleanup (
@CommandLine.Option→@Option) — nice to have - Reordering
eq.javaVersion/eq.camelVersionlines — cosmetic - Adding
"17"toJavaVersionCompletionCandidates— useful - New
RunTest.java— useful but see notes below
The PR description and JIRA should be updated to reflect the reduced scope.
3. Generated metadata not updated (blocking)
The --java-version option for the run command is NOT in camel-jbang-commands-metadata.json. The export command metadata still shows (21, 25) but the code now lists (17, 21, 25). Please regenerate:
mvn install -B -pl dsl/camel-jbang/camel-jbang-core -DskipTestsand commit the updated metadata.
4. Test quality concerns
shouldParseJavaVersion11 — this test passes --java-version=11 and asserts it's accepted. Java 11 is not in the completion candidates and is not supported by Camel 4.x (minimum Java 17). This test documents that any arbitrary string is accepted, which could be confusing. Either:
- Add validation to reject unsupported versions, or
- Remove this test and add a comment noting that picocli completion candidates are advisory only, or
- At minimum rename it to make the intent clear (e.g.,
shouldAcceptArbitraryJavaVersion)
Tests are shallow — they only verify picocli parsing. They don't test that javaVersion is propagated from Run to ExportQuarkus/ExportSpringBoot. A propagation test (create Run, set javaVersion, call runQuarkus()/runSpringBoot() with a mock, verify the export command received the right value) would add real confidence.
5. Formatting
Please run mvn formatter:format impsort:sort -B -pl dsl/camel-jbang/camel-jbang-core to ensure the new test file passes formatting checks.
Summary
| Item | Severity |
|---|---|
Remove .superset/config.json and TODO-4.19-ideas.md |
Blocking |
Regenerate camel-jbang-commands-metadata.json |
Blocking |
| Update PR description for reduced scope (overlap with CAMEL-23235) | Suggested |
Fix or remove shouldParseJavaVersion11 test |
Suggested |
| Add propagation tests | Suggested |
| Run formatter | Blocking (CI will fail) |
gnodet
left a comment
There was a problem hiding this comment.
Second In-Depth Review (updated)
Claude Code on behalf of Guillaume Nodet
(Replacing my previous review — the .superset/config.json and TODO-4.19-ideas.md files were introduced by our merge commit, not by this PR. Apologies for the noise.)
Thanks for the updates — the test addition addresses one item from the first review. Here's a thorough second pass:
1. Overlap with CAMEL-23235 (important)
Commit c00319b ("CAMEL-23235: Propagate --java-version option to jbang run/debug commands") was merged to main on March 23 and already implements the core feature this PR was targeting:
- Added
--java-versiontoRun.javawithJavaVersionCompletionCandidates - Propagated
javaVersiontorunQuarkus(),runSpringBoot(), profile settings, jbang args, andExportBaseCommand
After the merge-with-main in the second commit, the actual new changes in this PR are now limited to:
- Annotation style cleanup (
@CommandLine.Option→@Option) — nice to have - Reordering
eq.javaVersion/eq.camelVersionlines — cosmetic - Adding
"17"toJavaVersionCompletionCandidates— useful - New
RunTest.java— useful but see notes below
The PR description and JIRA should be updated to reflect the reduced scope.
2. Generated metadata not updated (blocking)
The --java-version option for the run command is NOT in camel-jbang-commands-metadata.json. The export command metadata still shows (21, 25) but the code now lists (17, 21, 25). Please regenerate:
mvn install -B -pl dsl/camel-jbang/camel-jbang-core -DskipTestsand commit the updated metadata.
3. Test quality concerns
shouldParseJavaVersion11 — this test passes --java-version=11 and asserts it's accepted. Java 11 is not in the completion candidates and is not supported by Camel 4.x (minimum Java 17). This test documents that any arbitrary string is accepted, which could be confusing. Either:
- Add validation to reject unsupported versions, or
- Remove this test and add a comment noting that picocli completion candidates are advisory only, or
- At minimum rename it to make the intent clear (e.g.,
shouldAcceptArbitraryJavaVersion)
Tests are shallow — they only verify picocli parsing. They don't test that javaVersion is propagated from Run to ExportQuarkus/ExportSpringBoot. A propagation test (create Run, set javaVersion, call runQuarkus()/runSpringBoot() with a mock, verify the export command received the right value) would add real confidence.
4. Formatting
Please run mvn formatter:format impsort:sort -B -pl dsl/camel-jbang/camel-jbang-core to ensure the new test file passes formatting checks.
Summary
| Item | Severity |
|---|---|
Regenerate camel-jbang-commands-metadata.json |
Blocking |
| Update PR description for reduced scope (overlap with CAMEL-23235) | Suggested |
Fix or remove shouldParseJavaVersion11 test |
Suggested |
| Add propagation tests | Suggested |
| Run formatter | Blocking (CI will fail) |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fixes https://issues.apache.org/jira/browse/CAMEL-23208
Adds an option to specify java version for RUN command, so the exported app will use it (this is required to be able to execute RUN with java 17)
Description
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.