This is an automated email from the ASF dual-hosted git repository. oscerd pushed a commit to branch fix/camel-validate-runtime-check in repository https://gitbox.apache.org/repos/asf/camel-kit.git
commit ef59eedaf8889afc91d4624b8619124c67994655 Author: Andrea Cosentino <[email protected]> AuthorDate: Thu Nov 12 19:15:19 2026 +0100 Fix #145: stop /camel-validate from running camel run --check The Camel CLI has no --check option on camel run, so Stage 3 of the endpoint validation guide failed on every run. /camel-validate is a static gate (docs/modules/ROOT/pages/camel-validate.adoc), and the checks the stage claimed already exist: YAML parsing in Stage 1, endpoint options in Stage 2, property placeholders and bean references in quality-checks.md 7.2 and 7.3, and startup failures in the /camel-execute verification loop. Stage 3 now records that hand-off instead of running a command, ResourceConsistencyTest pins the guide to no shell command, and the README and getting-started prerequisites drop the non-existent flag. A stubbed camel run was considered and rejected: on Camel 4.22.0 it catches broken YAML, undefined placeholders and missing beans, but accepts unknown endpoint options under --stub=all, downloads dependencies and runs code, duplicating the verification loop. The Camel 4.18+ validate plugin is the YAML DSL validator Stage 1 already runs. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Andrea Cosentino <[email protected]> --- CHANGELOG.md | 3 ++ docs/modules/ROOT/pages/getting-started.adoc | 2 +- kit/README.md | 2 +- .../camel-validate/guides/endpoint-validation.md | 50 ++++++++-------------- .../kit/generator/ResourceConsistencyTest.java | 8 +++- 5 files changed, 29 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b4cb37..f8134f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Preserve legitimate init layouts containing unrelated symlinks and normal permissions on new generated files. - Exclude VCS, build and dependency trees from graphs; support up to 256 MiB of recognized sources while retaining per-file limits and validation before XML sniffing. - Derive Claude MCP grants from the workflow manifest and validate catalog cache version components. +- `/camel-validate` no longer tells the agent to run `camel run --check`, an option the Camel CLI does not have (#145). + Stage 3 of the endpoint guide is a static hand-off to the placeholder and bean checks and to the `/camel-execute` + verification loop. ### Added diff --git a/docs/modules/ROOT/pages/getting-started.adoc b/docs/modules/ROOT/pages/getting-started.adoc index 39ac88a4..a80570ef 100644 --- a/docs/modules/ROOT/pages/getting-started.adoc +++ b/docs/modules/ROOT/pages/getting-started.adoc @@ -20,7 +20,7 @@ xref:manual::camel-jbang.adoc[Camel JBang]. Both forms provide the same commands | See the installation commands below | xref:manual::camel-jbang.adoc[Camel JBang] -| `camel run` and `camel run --check` for route execution and validation +| `camel run` for route execution and runtime verification | `jbang app install camel@apache/camel` | Camel JBang test plugin diff --git a/kit/README.md b/kit/README.md index b1d49a72..f778a972 100644 --- a/kit/README.md +++ b/kit/README.md @@ -59,7 +59,7 @@ Utilities: /camel-ship (Technology Preview — delegate to the local |-------------|---------|---------| | Java 17+ | Runtime | [SDKMAN](https://sdkman.io/), [Adoptium](https://adoptium.net/), or your package manager | | [JBang](https://www.jbang.dev/) | CLI launcher for camel-kit | See below | -| [Camel JBang](https://camel.apache.org/manual/camel-jbang.html) | `camel run`, `camel run --check` for route execution and validation | `jbang app install camel@apache/camel` | +| [Camel JBang](https://camel.apache.org/manual/camel-jbang.html) | `camel run` for route execution and runtime verification | `jbang app install camel@apache/camel` | | [Camel JBang test plugin](https://camel.apache.org/manual/camel-jbang.html) | `camel test run` for Citrus integration tests in the verify loop | `camel plugin add test` | | [Docker](https://docs.docker.com/get-docker/) | Conditional: external-service probes and full Citrus/Testcontainers verification | Install Docker Engine or Docker Desktop | diff --git a/kit/camel-kit-core/src/main/resources/skills/camel-validate/guides/endpoint-validation.md b/kit/camel-kit-core/src/main/resources/skills/camel-validate/guides/endpoint-validation.md index 23395fcd..905aa462 100644 --- a/kit/camel-kit-core/src/main/resources/skills/camel-validate/guides/endpoint-validation.md +++ b/kit/camel-kit-core/src/main/resources/skills/camel-validate/guides/endpoint-validation.md @@ -85,44 +85,28 @@ Validating component existence... --- -## Stage 3: Camel Runtime Validation +## Stage 3: Runtime Handoff -Use Camel CLI to validate the route compiles: +`/camel-validate` is a static gate: it never starts the routes, runs a build or downloads dependencies, and the Camel +CLI has no dry-run option for `camel run` (no `--check` flag exists). Do not run anything in this stage. Every concern +a runtime start would surface is covered elsewhere — record where: -```bash -camel run --check {ROUTE_FILE} {PROPS_FILE} -``` - -This validates: -- YAML parsing -- Property placeholder resolution -- Component URI syntax -- Missing dependencies -- Bean references - -Show results: - -``` -== CAMEL RUNTIME VALIDATION == +| Runtime concern | Covered by | +|---|---| +| YAML parsing and DSL structure | Stage 1 (`schema-validation.md`) | +| Component existence and endpoint options | Stage 2 above | +| Property placeholders defined in `PROPS_FILE` | `quality-checks.md` §7.2 Property Completeness | +| Bean references and `camel.beans.*` definitions | `quality-checks.md` §7.3 Bean Definitions | +| Startup, dependency resolution and connection failures | the verification loop of `/camel-execute` (Step 3.5), recorded as the `Verification:` line of `execution-report.md`; `/camel-debug` outside a pipeline | -Running: camel run --check {ROUTE_FILE} {PROPS_FILE} +Show the handoff, quoting the `Verification:` value from `execution-report.md` when the run is pipeline-scoped: -✅ Route compiles successfully -✅ Components: [kafka, sql] - all valid -✅ Properties: All placeholders resolved -✅ Beans: All references found ``` +== RUNTIME VALIDATION == -Or if errors: - +Not run by /camel-validate (static gate; `camel run` has no check mode). +Runtime verification: {PASS | PARTIAL | FAIL | NOT_RUN} per execution-report.md ``` -❌ Validation failed: -Error: Property '{{kafka.topic.input}}' not defined -Fix: Add to application.properties: - kafka.topic.input=your-topic-name - -Error: Bean 'dataSource' not found -Fix: Add to application.properties: - camel.beans.dataSource=#class:org.apache.commons.dbcp2.BasicDataSource -``` +In a project-scoped run there is no execution report: print `Runtime verification: not available — run the routes +through the /camel-execute verification loop or /camel-debug` instead. diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ResourceConsistencyTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ResourceConsistencyTest.java index 52a9950f..5b116ca6 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ResourceConsistencyTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ResourceConsistencyTest.java @@ -1675,7 +1675,13 @@ class ResourceConsistencyTest { "`{MODULE_PREFIX}src/main/resources/camel/*.camel.yaml`")); assertTrue(validate.contains("`{MODULE_PREFIX}` is empty at the project root")); assertTrue(schema.contains("-Dcamel.validator.files={ROUTE_FILE}")); - assertTrue(endpoint.contains("camel run --check {ROUTE_FILE} {PROPS_FILE}")); + assertFalse(endpoint.contains("camel run --check"), "camel run has no --check option (#145)"); + assertFalse(endpoint.contains("```bash"), + "/camel-validate is static: the endpoint guide runs no shell command"); + assertTrue(endpoint.contains("## Stage 3: Runtime Handoff")); + assertTrue(endpoint.contains("`quality-checks.md` §7.2 Property Completeness")); + assertTrue(endpoint.contains("`quality-checks.md` §7.3 Bean Definitions")); + assertTrue(endpoint.contains("`Verification:` line of `execution-report.md`")); assertTrue(replan.contains("Never execute tasks copied from the stale original plan")); assertTrue(replan.contains("plan analyze <plan-path>")); assertTrue(replan.contains("doc unstale <plan-path>"));
