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

[PR] CAMEL-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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

   ## Summary
   
   Resolve `camel:` and `camel-` dependencies from the Camel catalog when an artifact model exists. Keep the running Camel version as the fallback and preserve explicit Maven coordinates.
   
   Document the rule and cover cataloged, uncataloged, and explicit dependencies in a regression test.
   
   ## Test
   
   `CommandLineDependencyDownloaderTest` passes.
   
   Jira: https://issues.apache.org/jira/browse/CAMEL-25270
   


-- 
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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #27285:
URL: https://github.com/apache/camel/pull/27285#issuecomment-5953786616

   @davsclaus this is the implemented logic:
   
   Input | Current behavior | Previous behavior
   -- | -- | --
   Artifact has a catalog model | Use the model’s group, artifact, and version from the catalog | Always use org.apache.camel:camel-<name> at the running Camel version
   No catalog model, e.g. camel:core | Use the running Camel version | Use the running Camel version
   Full group:artifact:version | Use the version supplied by the user | Use the version supplied by the user
   
   


-- 
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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #27285:
URL: https://github.com/apache/camel/pull/27285#issuecomment-5953926804

   @Croway please disregard point 2 of my review (the custom-distribution question). How a vendor builds and versions its own distribution isn't something we need to design for upstream. Only point 1 remains: the catalog cache retaining ~33 MB. Please use `new DefaultCamelCatalog()` with your `COORDINATES` map, and ideally skip `camel-core`/`camel-kamelet` before resolving, as in the inline comments.
   
   _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


Re: [PR] CAMEL-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-kamelet-main`
   
   :repeat: **1 test passed only after a retry on JDK 25** (1 retried attempt)
   
   <details><summary>Recovered flaky tests on JDK 25 (1)</summary>
   
   | Module | Test | Failed attempts | First failure |
   | --- | --- | --- | --- |
   | `dsl/camel-jbang/camel-jbang-plugin-tui` | `AiPanelAcpTest.clearOpensANewSessionOnTheNextPrompt` | 1 | expected: &lt;2&gt; but was: &lt;1&gt; |
   
   > :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: 6 of 698 tested, 9 compile-only — current: 6 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **6 affected modules** (current approach: 6).
   
   **Skip-tests mode would test 6 modules** (2 direct + 6 downstream), **skip tests for 9** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (6)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (9)</summary>
   
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (17 modules, 2m 29s total)</summary>
   
   **Total reactor time:** 2m 29s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: JBang :: Plugin :: TUI | 44.3s | SUCCESS |
   | Camel :: Launcher | 25.0s | SUCCESS |
   | Camel :: JBang :: MCP | 17.5s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 16.0s | SUCCESS |
   | Camel :: Docs | 13.9s | SUCCESS |
   | Camel :: Kamelet Main | 13.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 7.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 5.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 1.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.0s | SUCCESS |
   | Camel :: Coverage | 0.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.8s | SUCCESS |
   | Camel :: JBang :: Integration tests | 0.7s | SUCCESS |
   | Camel :: JBang :: Main | 0.6s | SUCCESS |
   | Camel :: Launcher :: Container | 0.5s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: JBang :: Plugin :: TUI` (44.3s)
   - `Camel :: Launcher` (25.0s)
   - `Camel :: JBang :: MCP` (17.5s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (16.0s)
   - `Camel :: Docs` (13.9s)
   - `Camel :: Kamelet Main` (13.0s)
   - `Camel :: JBang :: Plugin :: Testing` (7.6s)
   - `Camel :: JBang :: Plugin :: Validate` (5.7s)
   - `Camel :: JBang :: Plugin :: MCP` (1.2s)
   - `Camel :: JBang :: Plugin :: Generate` (1.0s)
   - `Camel :: JBang :: Plugin :: Edit` (1.0s)
   - `Camel :: Coverage` (0.8s)
   - `Camel :: JBang :: Plugin :: Route Parser` (0.8s)
   - `Camel :: JBang :: Integration tests` (0.7s)
   - `Camel :: JBang :: Main` (0.6s)
   - `Camel :: Launcher :: Container` (0.5s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37012730828)


-- 
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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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


##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/CatalogDependencyResolver.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.main.download;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.catalog.CamelCatalog;
+import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.apache.camel.tooling.maven.MavenGav;
+import org.apache.camel.tooling.model.ArtifactModel;
+
+final class CatalogDependencyResolver {
+
+    private final CamelContext camelContext;
+    private final CamelCatalog catalog = new DefaultCamelCatalog();

Review Comment:
   `new DefaultCamelCatalog()` has caching turned off, and each of the four call sites creates its own resolver and catalog. `modelFromMavenGAV` parses the JSON of every component, then every data format, language, "other" and transformer, until one matches. I measured it on a fresh catalog: `camel-aws2-s3` 60 ms, `camel-zipfile` (a data format) 179 ms, `camel-main` (an "other") 127 ms, and still about 20 ms on a repeat. An uncataloged artifact costs the full scan every time.
   
   `KnownDependenciesResolver.mavenGavForClass` runs this for every lookup that maps to a `camel:` value, including `DependencyDownloaderPropertiesComponent`, which looks up each property key, value and line. So many properties for one component repeat the scan at startup. Could the four call sites share one resolver, using `new DefaultCamelCatalog(true)`, and keep a small map from shorthand to resolved GAV?



-- 
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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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


##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderKamelet.java:
##########
@@ -179,9 +179,9 @@ private void downloadDependencies(List<String> dependencies) {
             final List<String> gavs = new ArrayList<>();
             for (String dep : dependencies) {
                 String gav = dep;
-                if (dep.startsWith("camel:")) {
-                    // it's a known camel component
-                    gav = "org.apache.camel:camel-" + dep.substring("camel:".length()) + ":" + camelContext.getVersion();
+                if (CatalogDependencyResolver.isCamelShorthand(dep)) {

Review Comment:
   This resolves `camel:core`, which almost every kamelet declares, through the catalog before `isValidGav` drops `org.apache.camel:camel-core` as already included. `camel-core` isn't in the catalog, so this costs a full scan (~245 ms, and the retained heap with the cached catalog) for a dependency that is thrown away a few lines later. Could `camel-core` (and `camel-kamelet`) be skipped before resolving?



##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/CatalogDependencyResolver.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.main.download;
+
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.camel.catalog.CamelCatalog;
+import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.apache.camel.tooling.maven.MavenGav;
+import org.apache.camel.tooling.model.ArtifactModel;
+
+final class CatalogDependencyResolver {
+
+    private static final CamelCatalog CATALOG = new DefaultCamelCatalog(true);

Review Comment:
   Since `COORDINATES` already caches the result per artifact, the catalog's own cache only retains the models parsed during each scan: about +33 MB after resolving one artifact that isn't in the catalog (`camel-core`). Uncached, each artifact is still looked up once, and the models can be garbage-collected:
   
   ```suggestion
       private static final CamelCatalog CATALOG = new DefaultCamelCatalog();
   ```



-- 
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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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

   :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-25270: Use catalog coordinates for Camel shorthand dependencies [camel]

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


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