davsclaus opened a new pull request, #28739: URL: https://github.com/apache/camel/pull/28739
_Claude Code on behalf of davsclaus_ Stage 2a of [CAMEL-24726](https://issues.apache.org/jira/browse/CAMEL-24726): the runner API of camel-jbang-export, after stage 1 ([CAMEL-24727](https://issues.apache.org/jira/browse/CAMEL-24727)). The plan for stage 2: the runner goes into camel-jbang-export, next to the exporter, and is built on it, as a run is an export with a run on top. `RunRequest` extends `ExportRequest` (this PR), then `ProjectRunner` extends `ProjectExporter` and `RunContext` extends `ExportContext`, for the Maven runs (Camel Main, then Quarkus and Spring Boot) and then for the run in the current JVM. `ProjectRunner.start` returns a handle to the running integration, and `run` starts and waits, as `camel run` does. The module is renamed to camel-jbang-run once this works. ## Changes - **`RunRequest` extends `ExportRequest`.** The 31 options that a run shares with an export (the files, the dependencies, the runtime, the versions, the Maven resolver and settings, the ports, ...) are the fields of `ExportRequest` now; `RunRequest` keeps the 28 that only a run has (dev mode, the source and data directories, stubs, tracing, the execution limits, JFR, ...). - The `RunRequest()` constructor keeps the defaults of `camel run` where they differ from those of an export: the name `CamelJBang`, the `jbang` runtime, no lazy beans, and no Java, Spring Boot or Quarkus platform version (they come from the application properties when not given). The work directory is the one of an export, `.camel-jbang`, where it was not set before; `camel run` and the silent run set it. - `RunRequest(ExportRequest)` is the run of an export: a shallow copy of the export request. - **Renamed fields, so that the two requests have one name for each option:** `ExportRequest.exportBaseDir` is `baseDir`, as in `RunRequest`, and `RunRequest.property` is `applicationProperties`, as in `ExportRequest`. The options of the commands keep their names. - **The silent run of an export is the run of its request.** `SilentRunDependencyResolver.toRunRequest` used `new RunRequest()` and copied the fields of the export request one by one; it is `new RunRequest(export)` now. The run now also has the Maven settings of the export (`mavenSettings`, `mavenSettingsSecurity`, `mavenCentralEnabled`, `mavenApacheSnapshotEnabled`), which it did not have before. The GAV is cleared, as it is the one of the exported project: with it, the run settings of the export had a `camel.jbang.gav` line that nothing reads, and the golden files would have changed. No behaviour changes otherwise: `camel run` builds its request field by field as before. - **A flaky test.** `ExportApiTest.aYamlRouteThatDoesNotLoadIsReportedAsCamelRunDoes` (from #28735) failed when a command that turns the logging off ran before it in the same fork: the report is logged at ERROR, and the appender of the test got nothing. The test sets the level of the logger of the report itself now. It failed in one of the two full runs of camel-jbang-core for this PR, and fails every time when the test turns the logging off first, as a command does. ## Tests - `RunExportGoldenTest`: no change to the expected files (45 tests). - `RunRequestTest` (new): the defaults of a run, the run of an export (the options and the shared lists), and the silent run of an export (no GAV, the dev profile). - camel-jbang-export: 132 tests pass. - camel-jbang-core: 2497 tests in the default fork and 287 in the serial fork. The only failures, `EvalSimpleTest` (it runs the Camel installed with JBang) and 9 tests of the AI tools about the elvis operator of Simple, fail on `main` locally too. - The Kubernetes plugin and the launcher compile. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0128ThHB3iQdrvSRLVBGRrdP -- 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]
