Skip to content

CAMEL-23566: camel-jbang - Source examples from camel-jbang-examples repository#23375

Merged
davsclaus merged 2 commits into
mainfrom
worktree-tui5
May 20, 2026
Merged

CAMEL-23566: camel-jbang - Source examples from camel-jbang-examples repository#23375
davsclaus merged 2 commits into
mainfrom
worktree-tui5

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • Replace the 3 hardcoded built-in examples with a catalog-driven system sourcing examples from the apache/camel-jbang-examples repository
  • Add ExampleHelper with catalog loading, filtering by name/tag/level, bundled extraction, and GitHub fetch for online examples
  • Refactor --example / --example-list in Run.java to use the catalog JSON
  • --example-list now shows NAME, LEVEL, DESCRIPTION, SOURCE columns and supports filtering (e.g. --example-list beginner, --example-list ai)
  • Bundled examples (7) work offline, non-bundled examples fetch from GitHub on demand
  • Add -Psync-example-catalog Maven profile to download the latest catalog from the examples repo
  • Bundle 7 curated examples with READMEs: timer-log, rest-api, cron-log, circuit-breaker, groovy, routes, xslt

The catalog system uses camel-jbang-example-catalog.json generated from per-example metadata.json files in the examples repo (see apache/camel-jbang-examples@66b6871).

Test plan

  • ExampleHelperTest — 14 tests covering catalog loading, filtering, extraction, GitHub URL generation
  • RunTest — 11 tests covering listing, filtering, unknown example suggestions, option parsing
  • Manual: camel run --example-list shows all 21 examples with levels
  • Manual: camel run --example-list beginner filters to 7 beginner examples
  • Manual: camel run --example circuit-breaker runs the bundled example offline

🤖 Generated with Claude Code

Claude Code on behalf of Claus Ibsen

…repository

Replace the 3 hardcoded built-in examples with a catalog-driven system
sourcing examples from the apache/camel-jbang-examples repository.

- Add ExampleHelper with catalog loading, filtering by name/tag/level,
  bundled extraction (with subdirectory support), and GitHub fetch
- Refactor Run.java --example/--example-list to use the catalog JSON
- --example-list now shows NAME, LEVEL, DESCRIPTION, SOURCE columns
  and supports filtering (e.g. --example-list beginner, --example-list ai)
- Bundled examples (7) work offline, others fetch from GitHub on demand
- Add -Psync-example-catalog Maven profile to download latest catalog
- Bundle 7 curated examples with READMEs: timer-log, rest-api, cron-log,
  circuit-breaker, groovy, routes, xslt

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

…ple-list

Remove the separate --example-list flag. Using --example without a value
now lists available examples. Group examples by level (beginner first),
sort alphabetically within groups, and use emoji icons for source/docker
indicators to give descriptions more room.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davsclaus davsclaus merged commit 134c4f0 into main May 20, 2026
7 checks passed
@davsclaus davsclaus deleted the worktree-tui5 branch May 20, 2026 14:02
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • docs
  • dsl/camel-jbang/camel-jbang-core

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (6 modules)
  • Camel :: JBang :: Core
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container

⚙️ View full build and test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant