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/09/16 05:56:12 UTC
[PR] CAMEL-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
davsclaus opened a new pull request, #26488:
URL: https://github.com/apache/camel/pull/26488
`camel validate yaml` and `camel validate source` checked a file against the CLI's own catalog and YAML DSL schema, whatever version the project runs. They now take `--camel-version` and `--runtime` like `camel catalog` and `camel doc`, and `camel_validate_source` answers for its `camelVersion` on both halves — noted while reviewing PR 26378: the catalog half alone would have made `--camel-version` misleading.
**What changed**
- `YamlValidator(boolean canonical, String schemaJson, CamelCatalog catalog)`: a validator for a schema document handed to it (and the catalog of that version for the canonical one-of check); the existing constructors keep the classpath schema.
- `CatalogLoader.loadYamlDslSchema(repos, version, canonical, download)`: reads `schema/camelYamlDsl[-canonical].json` from `org.apache.camel:camel-yaml-dsl:<version>` through the Maven downloader; null for the CLI's own version (nothing to download). Every 4.x jar ships the classic schema; the canonical one exists from 4.22 (CAMEL-22987), so `--canonical` with an older version is an error, not a silent fallback.
- `SourceValidator` keys its schema validator on the version of the catalog it is given (`getCatalogVersion()` of a catalog `CatalogLoader.loadCatalog` downloaded), one per version. That covers `camel_validate_source` with `camelVersion`, `camel_write_file`, and the TUI, which already sets the selected integration's version on the `ToolContext` — no call site changed. A `validate(..., YamlValidator)` overload takes an explicit validator for the runtime catalogs, whose version the catalog does not report.
- `CatalogVersionMixin` in the validate plugin: `--camel-version`, `--runtime`, `MavenResolverMixin` (`--repos`, `--download`, `--fresh`) and `QuarkusPlatformMixin` (`--quarkus-version`, registry); `main` loads the plain catalog, `spring-boot` the Spring Boot catalog, `quarkus` the platform resolved from the Camel version (or `--quarkus-version`) and its `camel-quarkus-catalog`; the schema is read for the Camel version the platform pins.
- `EndpointChecks`: a component the runtime catalog does not have while Camel has it is an error (`kafka: Camel Quarkus has no extension for this component (no camel-quarkus-kafka)`, or the Spring Boot starter). The plain catalog keeps saying nothing about an unknown scheme: a project can register a component of its own.
**Not version-aware, said in the docs**: Simple expressions are parsed by the CLI's own Simple language (the other version's catalog supplies the function list); the Java, XSLT and XML checks of `camel validate source` use the CLI's classpath.
**Local model / tool cost**: no tool schema changed; `camelVersion` stays optional and the default path stays offline. The TUI core prompt budget is untouched.
**Tests**: `YamlValidatorSchemaDocumentTest` (the given document is the schema), `SourceValidatorVersionTest` (a fake Quarkus provider that knows timer and log only; the 4.18.0 catalog gets the 4.18.0 schema, one validator per version; canonical before 4.22 errors), `ValidateCamelVersionTest` in the validate plugin (own version offline; `--camel-version=4.18.0`; `--runtime=quarkus --quarkus-version=3.30.1` reports `atmosphere-websocket`). The tests that download another version are `@DisabledIfSystemProperty(ci.env.name)` like the existing catalog download tests. Module suites: camel-yaml-dsl-validator 98, camel-jbang-core AI 149, the MCP authoring/transform and TUI budget tests all green.
**Docs**: the validate plugin section of `camel-jbang-devtools.adoc` (new "Validating against another Camel version or runtime"), the `camel_validate_source` row of the MCP page. No upgrade-guide entry: additive.
_Claude Code on behalf of davsclaus_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #26488:
URL: https://github.com/apache/camel/pull/26488#discussion_r4023285315
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/EndpointChecks.java:
##########
@@ -191,6 +200,36 @@ public static List<String> validateYamlEndpoints(String content, CamelCatalog ca
return errors;
}
+ private static volatile CamelCatalog defaultCatalog;
+
+ /**
+ * The message for a component the catalog of a runtime (Camel Quarkus, Camel Spring Boot) does not have while Camel
+ * has it: the runtime has no extension or starter for it. Null for the default catalog, whose unknown components
+ * are not reported: a project can register a component of its own (CAMEL-24711).
+ */
+ static String missingInRuntime(CamelCatalog catalog, String scheme) {
+ RuntimeProvider provider = catalog.getRuntimeProvider();
+ String name = provider != null ? provider.getProviderName() : null;
+ if (name == null || "default".equals(name)) {
+ return null;
+ }
+ CamelCatalog plain = defaultCatalog;
+ if (plain == null) {
+ plain = new DefaultCamelCatalog();
+ defaultCatalog = plain;
+ }
+ if (plain.componentModel(scheme) == null) {
+ return null;
Review Comment:
Applied in aead5ca6f283 — same double-checked locking as `SourceValidator.yamlValidator()`. (The race was benign, two equal catalogs with one dropped, but one construction is what the field is for.)
_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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #26488:
URL: https://github.com/apache/camel/pull/26488#discussion_r4022963847
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CatalogLoader.java:
##########
@@ -240,6 +243,51 @@ public static CamelCatalog loadQuarkusCatalog(MavenGav quarkusCamelBom, Function
return answer;
}
+ /**
+ * The YAML DSL JSON schema of a Camel version, read from the {@code org.apache.camel:camel-yaml-dsl} jar of that
+ * version (every 4.x release ships {@code schema/camelYamlDsl.json}; the canonical schema exists from 4.22).
+ *
+ * @param repos extra Maven repositories, comma separated; null for the defaults
+ * @param version the Camel version
+ * @param canonical whether to read the canonical schema
+ * @param download whether to download when the jar is not in the local repository
+ * @return the schema document as JSON, or null when the version is the one of the CLI, whose schema is
+ * on the classpath
+ * @throws IOException when the jar cannot be downloaded or has no such schema
Review Comment:
**`@throws IOException` doesn't match the method signature.**
The method declares `throws Exception`, so callers are already forced to handle `Exception` — but the Javadoc says only `IOException` can be thrown. A reader learning the API from the Javadoc won't know that `downloader.start()` or `downloadArtifact()` can throw arbitrary checked exceptions beyond `IOException`.
Change to:
```suggestion
* @throws Exception when the jar cannot be downloaded or has no such schema
```
--
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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #26488:
URL: https://github.com/apache/camel/pull/26488#discussion_r4023266311
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/EndpointChecks.java:
##########
@@ -191,6 +200,36 @@ public static List<String> validateYamlEndpoints(String content, CamelCatalog ca
return errors;
}
+ private static volatile CamelCatalog defaultCatalog;
+
+ /**
+ * The message for a component the catalog of a runtime (Camel Quarkus, Camel Spring Boot) does not have while Camel
+ * has it: the runtime has no extension or starter for it. Null for the default catalog, whose unknown components
+ * are not reported: a project can register a component of its own (CAMEL-24711).
+ */
+ static String missingInRuntime(CamelCatalog catalog, String scheme) {
+ RuntimeProvider provider = catalog.getRuntimeProvider();
+ String name = provider != null ? provider.getProviderName() : null;
+ if (name == null || "default".equals(name)) {
+ return null;
+ }
+ CamelCatalog plain = defaultCatalog;
+ if (plain == null) {
+ plain = new DefaultCamelCatalog();
+ defaultCatalog = plain;
+ }
+ if (plain.componentModel(scheme) == null) {
+ return null;
Review Comment:
⚠️ **Concurrency: check-then-act without synchronization.**
`defaultCatalog` is `volatile`, so the read on line 219 is safe — but two threads that both observe `null` will both construct a `DefaultCamelCatalog` and one's instance will be silently overwritten. `DefaultCamelCatalog` construction loads the full catalog from the classpath; this is not cheap. The MCP server runs in a multi-threaded context, so `missingInRuntime` can be entered concurrently.
The same PR uses proper DCL for `VERSION_VALIDATORS` in `SourceValidator.yamlValidator(CamelCatalog)`. Apply the same pattern here:
```suggestion
CamelCatalog plain = defaultCatalog;
if (plain == null) {
synchronized (EndpointChecks.class) {
plain = defaultCatalog;
if (plain == null) {
defaultCatalog = plain = 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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #26488:
URL: https://github.com/apache/camel/pull/26488
--
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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #26488:
URL: https://github.com/apache/camel/pull/26488#discussion_r4023198974
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CatalogLoader.java:
##########
@@ -240,6 +243,51 @@ public static CamelCatalog loadQuarkusCatalog(MavenGav quarkusCamelBom, Function
return answer;
}
+ /**
+ * The YAML DSL JSON schema of a Camel version, read from the {@code org.apache.camel:camel-yaml-dsl} jar of that
+ * version (every 4.x release ships {@code schema/camelYamlDsl.json}; the canonical schema exists from 4.22).
+ *
+ * @param repos extra Maven repositories, comma separated; null for the defaults
+ * @param version the Camel version
+ * @param canonical whether to read the canonical schema
+ * @param download whether to download when the jar is not in the local repository
+ * @return the schema document as JSON, or null when the version is the one of the CLI, whose schema is
+ * on the classpath
+ * @throws IOException when the jar cannot be downloaded or has no such schema
Review Comment:
Right — the downloader's own checked exceptions come through as well. Changed to `@throws Exception` in 868538f27833.
_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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26488:
URL: https://github.com/apache/camel/pull/26488#issuecomment-5692749033
: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-24711: camel-jbang - camel validate yaml/source --camel-version and --runtime: the catalog and the YAML DSL schema of that version, a component without a Quarkus extension is an error [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26488:
URL: https://github.com/apache/camel/pull/26488#issuecomment-5693035620
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `docs`
- `dsl/camel-jbang/camel-jbang-core`
- `dsl/camel-jbang/camel-jbang-plugin-validate`
- `dsl/camel-yaml-dsl/camel-yaml-dsl-validator`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 10 tested, 8 compile-only — current: 8 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **18 affected modules** (current approach: 8).
<details><summary>:warning: Modules only in Scalpel (10)</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`
- `docs`
</details>
**Skip-tests mode would test 10 modules** (4 direct + 6 downstream), **skip tests for 8** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (10)</summary>
- `camel-jbang-core`
- `camel-jbang-mcp`
- `camel-jbang-plugin-mcp`
- `camel-jbang-plugin-route-parser`
- `camel-jbang-plugin-tui`
- `camel-jbang-plugin-validate`
- `camel-launcher-container`
- `camel-yaml-dsl-validator`
- `camel-yaml-dsl-validator-maven-plugin`
- `docs`
</details>
<details><summary>Modules with tests skipped (8)</summary>
- `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>
: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
- `dsl/camel-jbang/camel-jbang-plugin-validate`: 1 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 (18 modules, 4m 13s total)</summary>
**Total reactor time:** 4m 13s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: Launcher | 54.6s | SUCCESS |
| Camel :: JBang :: Plugin :: TUI | 53.0s | SUCCESS |
| Camel :: JBang :: MCP | 43.2s | SUCCESS |
| Camel :: JBang :: Plugin :: Kubernetes | 24.5s | SUCCESS |
| Camel :: Docs | 23.7s | SUCCESS |
| Camel :: YAML DSL :: Validator | 18.0s | SUCCESS |
| Camel :: JBang :: Plugin :: Testing | 11.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 8.2s | SUCCESS |
| Camel :: YAML DSL :: Validator Maven Plugin | 4.4s | SUCCESS |
| Camel :: Coverage | 2.4s | SUCCESS |
| Camel :: JBang :: Plugin :: Edit | 1.7s | SUCCESS |
| Camel :: JBang :: Integration tests | 1.7s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 1.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Generate | 1.5s | SUCCESS |
| Camel :: JBang :: Plugin :: Route Parser | 1.0s | SUCCESS |
| Camel :: JBang :: Main | 0.9s | SUCCESS |
| Camel :: Launcher :: Container | 0.8s | SUCCESS |
| Camel :: JBang :: Core | n/a | |
**Top 20 slowest modules:**
- `Camel :: Launcher` (54.6s)
- `Camel :: JBang :: Plugin :: TUI` (53.0s)
- `Camel :: JBang :: MCP` (43.2s)
- `Camel :: JBang :: Plugin :: Kubernetes` (24.5s)
- `Camel :: Docs` (23.7s)
- `Camel :: YAML DSL :: Validator` (18.0s)
- `Camel :: JBang :: Plugin :: Testing` (11.6s)
- `Camel :: JBang :: Plugin :: Validate` (8.2s)
- `Camel :: YAML DSL :: Validator Maven Plugin` (4.4s)
- `Camel :: Coverage` (2.4s)
- `Camel :: JBang :: Plugin :: Edit` (1.7s)
- `Camel :: JBang :: Integration tests` (1.7s)
- `Camel :: JBang :: Plugin :: MCP` (1.6s)
- `Camel :: JBang :: Plugin :: Generate` (1.5s)
- `Camel :: JBang :: Plugin :: Route Parser` (1.0s)
- `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/35061523000)
--
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