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

   _Claude Code on behalf of davsclaus_
   
   Stage 1c-3 of 
[CAMEL-24727](https://issues.apache.org/jira/browse/CAMEL-24727) (stage 1 of 
[CAMEL-24724](https://issues.apache.org/jira/browse/CAMEL-24724)), after #28728.
   
   To find the dependencies, an export boots the integration silently. Today 
that is `camel run` itself: core's `RunDependencyResolver` fills a `Run` 
command from the `ExportRequest`, so a user of the export API needs 
camel-jbang-core (and picocli) on the classpath. This PR adds 
`SilentRunDependencyResolver` to camel-jbang-export, built on the settings 
pipeline of #28728, which needs neither. It is additive: core's resolver stays 
the default, and the next step (1c-4) switches to the new one and deletes the 
old path.
   
   ## Changes
   
   - **`SilentRunDependencyResolver`** (`export.run`): maps the `ExportRequest` 
onto a `RunRequest` (the same fields as `RunDependencyResolver` maps onto 
`Run`, sharing the export's lists of files and dependencies), then does what 
`Run.run()` does for an export: a directory as the file, the work dir, the 
profile properties, the logging settings (written, never configured), the 
OpenAPI file, finding the files, then `RunPipeline`, and boots and stops 
`KameletMain`. The printer and the plugins come from the `ExportContext`.
   - **Shared with `camel run`, not copied:** loading the profile properties 
(`RunProfileProperties`), preparing the work dir, generating the OpenAPI file, 
finding the files and the directory-as-source-dir rule are now in 
camel-jbang-export, and `Run` calls them.
   - **`MavenProjectHelper`** (`export.common`): the Maven project scanning of 
`camel run pom.xml`, moved from core's `RunHelper`. The `pom.xml` block is back 
at its original place inside `RunPipeline.configure()`, so the export resolver 
handles a Maven project too.
   - **Plugins:** `PluginRunCustomizer` moved to `export.common`, next to 
`PluginExporter`, and `ExportContext` has `withPluginRunCustomizers`, which the 
CLI fills from the active plugins.
   - **`DependencyResolver`** has a default `resolve(request, context)`, which 
`Exporter` calls, so a resolver gets the printer and the plugins of the export.
   - The `rest-dsl.yaml.ftl` template moved to camel-jbang-export, next to 
`TemplateHelper`.
   
   ## Same as the current silent run, on purpose
   
   - The silent run uses the profile `dev`: `RunDependencyResolver` never 
passed the export's profile either.
   - `mavenSettings`, `mavenSettingsSecurity`, the Maven Central and Apache 
Snapshots flags and `gav` of the export are not passed (only 
`application.properties` sets them), as today.
   
   ## Different in edge cases, to decide before 1c-4 makes it the default
   
   The old silent run goes through code of `camel run` that is not about 
exporting. The new resolver does not:
   - `camel.jbang.background=true` or `camel.jbang.jvmDebug` in 
`application.properties` make today's silent run start another JVM; the new one 
always runs in this JVM.
   - `--camel-version` from camel-launcher fails today's silent run with a 
usage error; the new one does not check it.
   - The YAML validator's report on a route that does not load 
(`YamlLoadFailureReport`, in core) is not wired in.
   - A `clipboard*` file that does not exist is read from the system clipboard 
today; the new one reports a missing file.
   
   ## Tests
   
   - **`RunExportGoldenTest`** runs its 15 export cases with the new resolver 
too, against the same expected files: the run settings and the exported project 
are identical for every case. The expected files are unchanged.
   - **`SilentRunDependencyResolverTest`** (camel-jbang-export, where neither 
camel-jbang-core nor picocli is on the classpath, which it checks): exports a 
route, and checks the plugin run customizers and exporters.
   - camel-jbang-export: 125 pass. camel-jbang-core: 2496 in the default fork 
and 298 in the serial fork; the failures are local only and fail the same way 
on `main` (`EvalSimpleTest`, and 9 tests of the AI commands).
   - The plugins (edit, generate, kubernetes, mcp, test, tui, validate) and 
camel-launcher compile, with their tests.
   
   The docs change with 1c-4, when the new resolver becomes the default.
   
   🤖 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to