Fix JBang metadata generation to detect all commands and resolve completion candidates#22221
Open
Fix JBang metadata generation to detect all commands and resolve completion candidates#22221
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:
Build reactor — dependencies compiled but only changed modules were tested (6 modules)
|
09aeeca to
c599fd5
Compare
4 tasks
c599fd5 to
c0f74cd
Compare
506b03a to
0b80621
Compare
The PrepareCamelJBangCommandsMojo was not discovering all commands because: - It searched for `new CommandLine(main)` but CamelJBangMain uses `new CommandLine(this)` - The SUBCOMMAND_PATTERN regex only matched `(main)` constructor arg, not `(this)` This caused several commands and options to be missing from generated docs: - Missing `wrapper` command, `dataweave` subcommand - Missing `bind` deprecation notice - Wrong description for `--skip-plugins` option Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add resolveCompletionCandidates() to find and parse picocli
completionCandidates classes, replacing ${COMPLETION-CANDIDATES}
with actual values in generated docs
- Improve sanitizeDescription() to clean up residual empty parentheses
- Add missing JavaSource import to avoid FQCN usage
- Regenerate jbang command docs and metadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When glob-stream hits ENOENT, it stops emitting files from the entire source — even if the error only affects one glob pattern. This caused only 47 of 71 "others" symlinks to be created. Fix by processing each source pattern as a separate gulp.src stream and merging results into a single passthrough. An ENOENT in one pattern (e.g. the dsl glob hitting .camel-jbang/work) no longer aborts the other patterns (core, components). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0b80621 to
b53baba
Compare
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.
Summary
Fixes the
PrepareCamelJBangCommandsMojoto correctly detect all JBang commands and resolve picocli${COMPLETION-CANDIDATES}placeholders in generated documentation.Changes
Mojo fixes (
PrepareCamelJBangCommandsMojo.java):SUBCOMMAND_PATTERNregex to match bothnew CommandLine(this)andnew CommandLine(main), detecting previously missed commands (wrapper,dataweave)resolveCompletionCandidates()to find and parse picoclicompletionCandidatesclasses, replacing${COMPLETION-CANDIDATES}with actual values in generated docssanitizeDescription()to clean up residual empty parenthesesJavaSourceimportDocs build resilience (
docs/gulpfile.js):resilientSrc()to process each glob pattern as a separate stream, so an ENOENT from one pattern (e.g. dsl glob hitting.camel-jbang/work) doesn't abort the other patterns (core, components). Previously, a single ENOENT would stop the entire stream, producing only 47 of 71 expected symlinks and causing xref-check failures.Regenerated content:
camel-jbang-commands-metadata.json— now includeswrapperanddataweavecommands with all options.adoccommand doc files — completion candidates resolved (e.g.,Java version (21, 25)instead ofJava version ())