Skip to content

CAMEL-23491: Add known 3rd party plugin catalog to camel-jbang#23443

Open
davsclaus wants to merge 3 commits into
mainfrom
camel-23491
Open

CAMEL-23491: Add known 3rd party plugin catalog to camel-jbang#23443
davsclaus wants to merge 3 commits into
mainfrom
camel-23491

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • Add a human-curated catalog of known 3rd party plugins (known-plugins.json) so users can install them by name without specifying GAV coordinates (e.g., camel plugin add forage)
  • Add vendor field to PluginType enum to distinguish ASF vs Community plugins
  • camel plugin get --all now shows three sections: active, supported (ASF), and known 3rd party (Community)
  • Users can pin a specific version with --version flag; defaults to LATEST for 3rd party plugins
  • Initial catalog includes: forage, camel-kit

Test plan

  • All 21 existing plugin tests pass (PluginGetTest, PluginAddTest, PluginDeleteTest, PluginHelperTest)
  • Updated PluginGetTest assertions for new VENDOR column
  • Manual: camel plugin get --all shows vendor column and 3rd party section
  • Manual: camel plugin add forage auto-fills GAV from catalog
  • Manual: camel plugin add forage --version=1.2.3 pins specific version

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davsclaus
Copy link
Copy Markdown
Contributor Author

@Croway do you have a better forage jbang plugin description we can use
@luigidemasi the same for you for camel kit

@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.

@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

@davsclaus davsclaus requested a review from Croway May 22, 2026 05:03
@Croway
Copy link
Copy Markdown
Contributor

Croway commented May 22, 2026

for Forage, something like Configure components via opinionated bean factories

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feature -- the known-plugin catalog is a nice UX improvement. A couple of items to address:

  1. FQCN in PluginHelper.loadKnownPlugins(): java.nio.charset.StandardCharsets.UTF_8 is used inline instead of importing StandardCharsets. The project convention (and the OpenRewrite CI check) requires using simple class names with an import statement.

  2. Forage description: @Croway suggested a better description in the comments: "Configure components via opinionated bean factories". The known-plugins.json should be updated accordingly.

Otherwise the implementation looks clean, the tests are properly updated, and the documentation is good.

Claude Code on behalf of Guillaume Nodet

Comment thread dsl/camel-jbang/camel-jbang-core/src/main/resources/known-plugins.json Outdated
davsclaus and others added 2 commits May 24, 2026 14:13
…l/dsl/jbang/core/common/PluginHelper.java

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
…ins.json

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
@davsclaus
Copy link
Copy Markdown
Contributor Author

davsclaus commented May 24, 2026

for Forage, something like Configure components via opinionated bean factories

@Croway can we come up with a better description. As an end user I would not really what that means and why I should care.

Its something about connectors and adapters that adjust to chosen runtimes, and their best practices. The bean factory is more an implementation detail.

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review after commits 08cc321 and 09c358d.

Compile error in PluginHelper.loadKnownPlugins()

The web-editor commit (08cc321) appears to have mangled the method body. The current code has three issues that will prevent compilation:

  1. Duplicate variable declaration: String text is declared twice — the original FQCN line (java.nio.charset.StandardCharsets.UTF_8) was not removed when the replacement line (StandardCharsets.UTF_8) was added.

  2. Missing for loop: The for (Object o : arr) loop structure was lost — only the body (if (o instanceof JsonObject jo) { ... }) and closing braces remain.

  3. Double stream consumption: is.readAllBytes() would be called twice on the same InputStream, which yields an empty byte array on the second call.

The corrected method should be:

public static List<JsonObject> loadKnownPlugins() {
    try (InputStream is = PluginHelper.class.getClassLoader().getResourceAsStream("known-plugins.json")) {
        if (is != null) {
            String text = new String(is.readAllBytes(), StandardCharsets.UTF_8);
            JsonArray arr = (JsonArray) Jsoner.deserialize(text);
            List<JsonObject> result = new ArrayList<>(arr.size());
            for (Object o : arr) {
                if (o instanceof JsonObject jo) {
                    result.add(jo);
                }
            }
            return result;
        }
    } catch (Exception e) {
        // ignore
    }
    return List.of();
}

Other observations on the new commits:

  • known-plugins.json: The updated forage description ("Configure components via opinionated bean factories") is more accurate — good improvement.
  • The rest of the changeset (PluginGet, PluginAdd, PluginType vendor field, docs, tests) looks solid.

Please fix the loadKnownPlugins() method — it's the only blocking issue.

Claude Code on behalf of Guillaume Nodet

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.

3 participants