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

   ## Summary
   
   Fixes two related bugs in `camel_configuration_validate` (MCP tool) that 
caused it to return `{accepted:false, valid:true}` for `camel.server.*`, 
`camel.management.*`, `camel.vault.*`, and all other `camel.*` groups not in 
the ten hardcoded prefixes.
   
   ## Root Cause
   
   **Bug 1 — `AbstractCamelCatalog.acceptConfigurationPropertyKey()`** 
hardcoded only 10 of the 36 `camel.*` groups defined in 
`camel-main-configuration-metadata.json`:
   
   ```
   camel.component.  camel.dataformat.  camel.language.  camel.main.
   camel.resilience4j.  camel.faulttolerance.  camel.threadpool.
   camel.health.  camel.lra.  camel.rest.
   ```
   
   Missing: `camel.server.*`, `camel.management.*`, `camel.ssl.*`, 
`camel.debug.*`, `camel.trace.*`, `camel.security.*`, `camel.vault.*`, 
`camel.opentelemetry.*`, `camel.metrics.*`, `camel.cluster.*`, 
`camel.routecontroller.*`, `camel.startupcondition.*`, and others (26 groups 
total).
   
   When a key was not accepted, `validateConfigurationProperty()` set 
`accepted=false` and returned immediately without recording any error. Since 
`PropertiesValidationResult.isSuccess()` returns `true` when there are no 
recorded errors, the result was the contradictory `{accepted:false, 
valid:true}`.
   
   **Bug 2 — `ConfigurationValidateTools.toPropertyValidationInfo()`** at the 
MCP layer computed `valid = result.isSuccess()`, ignoring the `accepted` flag 
entirely.
   
   ## Fix
   
   **`AbstractCamelCatalog`**: `acceptConfigurationPropertyKey()` is now an 
instance method that reads `mainModel().getGroups()` dynamically. Any group 
declared in `camel-main-configuration-metadata.json` is automatically accepted 
without requiring a code change. `component/dataformat/language` keep their 
static prefixes because they use a different per-artifact model.
   
   The validation branch for main-model groups is also updated to use the same 
dynamic lookup (`matchMainModelGroup()`) to correctly locate the option suffix 
offset for nested groups like `camel.vault.aws.*` (3-segment group name).
   
   **`ConfigurationValidateTools`**: `valid` is now computed as `accepted && 
result.isSuccess()`, so an unaccepted key is never reported as valid even when 
the catalog returned no validation errors.
   
   ## Test
   
   Six new test cases added to `ConfigurationValidateToolsTest`:
   - `camelServerPortIsAcceptedAndValid` — `camel.server.port=9999` must be 
`accepted=true, valid=true`
   - `camelServerInventedKeyIsAcceptedButNotValid` — 
`camel.server.bindPort=9999` (nonexistent) must be `accepted=true, valid=false` 
with an `unknown` issue
   - `acceptedFalseImpliesValidFalseForNonCamelKey` — invented namespace: 
`accepted=false, valid=false`, summary `valid=0`
   - `camelManagementKeyIsAccepted` — `camel.management.enabled=true` must be 
accepted and valid
   - `camelVaultAwsKeyIsAccepted` — nested 3-segment group `camel.vault.aws.*` 
must be accepted
   - Extended `nonCamelKeyMarkedNotAccepted` with `valid=false` regression guard
   
   All 16 tests in `ConfigurationValidateToolsTest` pass.
   
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


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