You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/17 09:36:21 UTC

[PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

davsclaus opened a new pull request, #28002:
URL: https://github.com/apache/camel/pull/28002

   ## What
   
   The AI catalog tools now know the top-level entries of the YAML DSL that they missed:
   
   - **`beans`.** `camel_catalog_doc` answers for it: its items are bean factories, so the options are those of the `beanFactory` model, and the answer says where the entry goes, how a route uses a bean (`#bean:name`, `${bean:name.method}`, the bean EIP), and has an example. `camel_catalog_find` lists it for `beans` and for `bean` (after the bean EIP). Before, both answered that nothing was found, while `camel_catalog_sample` had the example.
   - **Samples for five more entries.** `templatedRoute`, `restConfiguration`, `transformers`, `validators` and `sslContextParameters` had no sample, because their examples are on the page of what they belong to. The sample generator now reads those pages for them (`entryPages` in the camel-jbang-core pom); `eip-samples.json` is regenerated.
   
   ## Why
   
   In the local-model benchmark (Oct 16-17), a model that had to declare a Java class as a bean looked up `beans` four times in one step, and was told "EIP not found".
   
   Left for later: `camel_catalog_doc` and `camel_catalog_find` do not know `sslContextParameters` either (it has a sample now), and `interceptFrom`, `interceptSendToEndpoint` and `dataFormats` still have no sample: the first two are on the same page as `intercept`, and the generator maps a page to one entry.
   
   ## Tests
   
   `CatalogDocsTest` and `CatalogSamplesTest` have a test each; camel-jbang-core and camel-jbang-mcp pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #28002:
URL: https://github.com/apache/camel/pull/28002


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28002:
URL: https://github.com/apache/camel/pull/28002#issuecomment-6232368723

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #28002:
URL: https://github.com/apache/camel/pull/28002#discussion_r4302246039


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogDocs.java:
##########
@@ -624,6 +630,41 @@ private static JsonObject eipDoc(
         return result;
     }
 
+    /** The top-level entry of the YAML DSL that declares beans: a list of bean factories, with no model of its own. */
+    static final String BEANS_ENTRY = "beans";
+
+    private static final String BEANS_DESCRIPTION
+            = "The top-level entry of the YAML DSL that declares beans: a list of beans, each with a name and how to create"
+              + " it (type, properties, constructors, a factory method or a script)";
+
+    /**
+     * The beans entry of the YAML DSL (CAMEL-25719). Each item of its list is a bean factory, so the options are those
+     * of the beanFactory model, and the answer says where the entry goes and how a route uses a bean, with an example.
+     * A model that looked up beans before was told "EIP not found" four times in one step, while camel_catalog_sample
+     * had the example all along. Null when the catalog has no beanFactory model.
+     */
+    private static JsonObject beansDoc(CamelCatalog catalog, String filter, OptionScope scope, boolean includeDoc) {
+        EipModel factory = catalog.eipModel("beanFactory");
+        if (factory == null) {
+            return null;
+        }
+        JsonObject result = eipDoc(catalog, factory, filter, scope, includeDoc, null);
+        result.put("name", BEANS_ENTRY);
+        result.put("title", "Beans");
+        result.put("description", BEANS_DESCRIPTION + ". The options are those of one bean; name is required. A route uses"
+                                  + " a bean as #bean:name in an option, ${bean:name.method} in Simple, or with the bean EIP"
+                                  + " (ref: name). The entry goes in the file of the routes, or in a file of its own such as"
+                                  + " beans.yaml next to them.");
+        result.put("placement", CatalogSamples.placement(BEANS_ENTRY));
+        // the example itself, short as it is, rather than a hint to fetch it with another call
+        JsonArray samples = (JsonArray) CatalogSamples.sample(catalog, BEANS_ENTRY, 1).get("samples");
+        if (samples != null && !samples.isEmpty()) {
+            result.put("sample", ((JsonObject) samples.get(0)).getString("yaml"));
+            result.remove("sampleHint");

Review Comment:
   💡 **Minor: `sampleHint` from `eipDoc()` may survive when samples are absent**
   
   `eipDoc()` is called with the `beanFactory` model, which sets a `sampleHint` referencing `"beanFactory"`. The `result.remove("sampleHint")` is only executed inside the `if (samples != null && !samples.isEmpty())` guard — if the `"beans"` sample is absent from the catalog, the stale `"beanFactory"` hint leaks through.
   
   Consider removing it unconditionally before the conditional block:
   
   ```suggestion
           result.put("placement", CatalogSamples.placement(BEANS_ENTRY));
           // the example itself, short as it is, rather than a hint to fetch it with another call
           JsonArray samples = (JsonArray) CatalogSamples.sample(catalog, BEANS_ENTRY, 1).get("samples");
           result.remove("sampleHint");
           if (samples != null && !samples.isEmpty()) {
               result.put("sample", ((JsonObject) samples.get(0)).getString("yaml"));
           }
   ```
   
   This way the method either provides the real sample or nothing — never a stale `beanFactory` hint.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28002:
URL: https://github.com/apache/camel/pull/28002#issuecomment-6232650935

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-core`
   
   :repeat: **2 tests passed only after a retry on JDK 25** (2 retried attempts)
   
   <details><summary>Recovered flaky tests on JDK 25 (2)</summary>
   
   | Module | Test | Failed attempts | First failure |
   | --- | --- | --- | --- |
   | `dsl/camel-jbang/camel-jbang-plugin-tui` | `AiPanelAcpTest.retryReplaysAnAgentCommandWithoutThePrefix` | 1 | Index 1 out of bounds for length 1 |
   | `dsl/camel-jbang/camel-jbang-plugin-tui` | `LaunchManagerOutcomeTest.startedWhenTheStatusFileSaysSo` | 1 | expected: null but was: LaunchOutcome[ok=false, log=null] |
   
   > :information_source: These tests did **not** fail the build. Surefire retried them and they passed.
   > Retries are enabled project-wide by `surefire.rerunFailingTestsCount` in `parent/pom.xml`.
   
   </details>
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 5 of 706 tested, 0 compile-only — current: 5 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **5 affected modules** (current approach: 5).
   
   **Skip-tests mode would test 5 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (5)</summary>
   
   - `camel-jbang-mcp` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← depends on affected reactor module org.apache.camel:camel-launcher
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   
   :bulb: **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
   > ```
   
   <details><summary>All tested modules (14 modules, 2m 59s total)</summary>
   
   **Total reactor time:** 2m 59s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 51.0s | SUCCESS |
   | Camel :: JBang :: MCP | 42.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 37.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 17.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 16.7s | SUCCESS |
   | Camel :: Coverage | 5.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 3.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.5s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: JBang :: Main | 0.9s | SUCCESS |
   | Camel :: Launcher :: Container | 0.8s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (51.0s)
   - `Camel :: JBang :: MCP` (42.6s)
   - `Camel :: JBang :: Plugin :: Validate` (37.0s)
   - `Camel :: JBang :: Plugin :: Testing` (17.2s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (16.7s)
   - `Camel :: Coverage` (5.2s)
   - `Camel :: JBang :: Plugin :: MCP` (3.0s)
   - `Camel :: JBang :: Plugin :: Edit` (1.9s)
   - `Camel :: JBang :: Plugin :: Generate` (1.5s)
   - `Camel :: JBang :: Integration tests` (1.2s)
   - `Camel :: JBang :: Main` (0.9s)
   - `Camel :: Launcher :: Container` (0.8s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/39021767299)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25719: camel-jbang - camel_catalog_doc and camel_catalog_find know the beans entry of the YAML DSL, and five more entries have samples [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #28002:
URL: https://github.com/apache/camel/pull/28002#discussion_r4303237758


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/CatalogDocs.java:
##########
@@ -624,6 +630,41 @@ private static JsonObject eipDoc(
         return result;
     }
 
+    /** The top-level entry of the YAML DSL that declares beans: a list of bean factories, with no model of its own. */
+    static final String BEANS_ENTRY = "beans";
+
+    private static final String BEANS_DESCRIPTION
+            = "The top-level entry of the YAML DSL that declares beans: a list of beans, each with a name and how to create"
+              + " it (type, properties, constructors, a factory method or a script)";
+
+    /**
+     * The beans entry of the YAML DSL (CAMEL-25719). Each item of its list is a bean factory, so the options are those
+     * of the beanFactory model, and the answer says where the entry goes and how a route uses a bean, with an example.
+     * A model that looked up beans before was told "EIP not found" four times in one step, while camel_catalog_sample
+     * had the example all along. Null when the catalog has no beanFactory model.
+     */
+    private static JsonObject beansDoc(CamelCatalog catalog, String filter, OptionScope scope, boolean includeDoc) {
+        EipModel factory = catalog.eipModel("beanFactory");
+        if (factory == null) {
+            return null;
+        }
+        JsonObject result = eipDoc(catalog, factory, filter, scope, includeDoc, null);
+        result.put("name", BEANS_ENTRY);
+        result.put("title", "Beans");
+        result.put("description", BEANS_DESCRIPTION + ". The options are those of one bean; name is required. A route uses"
+                                  + " a bean as #bean:name in an option, ${bean:name.method} in Simple, or with the bean EIP"
+                                  + " (ref: name). The entry goes in the file of the routes, or in a file of its own such as"
+                                  + " beans.yaml next to them.");
+        result.put("placement", CatalogSamples.placement(BEANS_ENTRY));
+        // the example itself, short as it is, rather than a hint to fetch it with another call
+        JsonArray samples = (JsonArray) CatalogSamples.sample(catalog, BEANS_ENTRY, 1).get("samples");
+        if (samples != null && !samples.isEmpty()) {
+            result.put("sample", ((JsonObject) samples.get(0)).getString("yaml"));
+            result.remove("sampleHint");

Review Comment:
   Applied in a0c8bf1ce5aa. The hint is removed in every case, so the answer has the real sample or none.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org