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

   ## Summary
   
   Adds a new `camel_properties_translate` MCP tool that translates Camel
   `application.properties` entries between the three Camel runtimes
   (CAMEL-23181):
   
   - **camel-main** (jbang / standalone)
   - **camel-spring-boot**
   - **camel-quarkus**
   
   Most `camel.*` properties are runtime-agnostic (`camel.main.*`,
   `camel.component.*`, `camel.dataformat.*`, `camel.health.*`,
   `camel.routecontroller.*`, `camel.cluster.*`, `camel.kamelet.*`,
   `camel.lra.*`, `camel.metrics.*`, `camel.opentelemetry.*`, etc.) and are
   returned with `status=unchanged`. The keys that actually differ across
   runtimes are the embedded HTTP server and management endpoint
   configuration:
   
   | canonical | camel-main | camel-spring-boot | camel-quarkus |
   |---|---|---|---|
   | HTTP port | `camel.server.port` | `server.port` | `quarkus.http.port` |
   | HTTP host | `camel.server.host` | `server.address` | `quarkus.http.host` |
   | HTTP path | `camel.server.path` | `server.servlet.context-path` | 
`quarkus.http.root-path` |
   | management port | `camel.management.port` | `management.server.port` | 
`quarkus.management.port` |
   | management path | `camel.management.path` | 
`management.endpoints.web.base-path` | `quarkus.management.root-path` |
   | management enabled | `camel.management.enabled` | _(Actuator 
auto-enables)_ | `quarkus.management.enabled` |
   
   The tool also rewrites the legacy `camel.springboot.*` prefix to
   `camel.main.*` (deprecated in Camel 4.5 per
   
[`camel-4x-upgrade-guide-4_5.adoc`](https://github.com/apache/camel/blob/main/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_5.adoc),
   removed in 4.13 per
   
[`camel-4x-upgrade-guide-4_13.adoc`](https://github.com/apache/camel/blob/main/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_13.adoc)).
   
   Properties without a known translation rule (`spring.jpa.*`,
   `logging.*`, `quarkus.datasource.*`, etc.) are **passed through with
   `status=unknown` and a note, never guessed**. The issue specifically
   called out that AI agents currently break configurations by guessing,
   so the bar for any rule the tool ships is high.
   
   Comments (`#`, `!`) and blank lines are preserved with `status=comment`
   so round-tripping a properties file is non-destructive.
   
   ## Tool signature
   
   ```java
   camel_properties_translate(
       properties: String,            // single line or multi-line
       fromRuntime: String,           // main | spring-boot | quarkus
       toRuntime: String              // main | spring-boot | quarkus
   ) -> {
       fromRuntime, toRuntime,
       summary { total, translated, unchanged, unknown, comments },
       properties: [
           { lineNumber, original, translated, status, note }
       ]
   }
   ```
   
   `status` is one of `translated` / `unchanged` / `unknown` / `comment`.
   
   A few common runtime-name aliases are accepted (`camel-main`, `jbang`,
   `standalone` -> main; `camel-spring-boot`, `springboot`, `spring` ->
   spring-boot; `camel-quarkus` -> quarkus).
   
   ## Changes
   
   - `PropertiesTranslateTools` — new `@ApplicationScoped` MCP tool. Holds
     a static `CANONICAL` table mapping each logical key
     (`http.port`, `http.host`, `http.path`, `management.port`,
     `management.path`, `management.enabled`) to its physical name in each
     runtime, plus a reverse lookup index, plus a set of recognised
     runtime-agnostic Camel prefixes. No catalog access is needed since
     these are framework-host properties not modeled in the camel-catalog.
   - `PropertiesTranslateToolsTest` — 15 unit tests covering each
     runtime-pair direction (main↔SB, main↔Q, SB↔Q), agnostic-prefix
     passthrough, legacy springboot rewrite, no-equivalent handling
     (Actuator), unknown keys, comments and blank-line preservation, and
     argument validation (blank input, invalid runtime).
   
   No public APIs were modified. No changes to other modules.
   
   ## Test plan
   
   - [x] `mvn test` in `dsl/camel-jbang/camel-jbang-mcp` (221 tests
         passing, 15 new)
   - [x] `mvn -DskipTests install` in the module passes (formatter clean)
   
   ## Issue context
   
   cc @oscerd as operator and @lburgazzoli — the issue was filed by
   @DeMa1980 (Luigi De Masi) with guidance from @davsclaus on which
   properties are actually runtime-specific. The PR scope follows that
   guidance precisely: it does not attempt to translate pure framework
   properties (Spring's `logging.*`, Quarkus' `quarkus.datasource.*`,
   etc.) which are out of Camel's concern.
   
   _Claude Code on behalf of Andrea Cosentino_


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