You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/09/20 21:07:06 UTC
[PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
davsclaus opened a new pull request, #26639:
URL: https://github.com/apache/camel/pull/26639
## Description
From the round-2 benchmark (series l3, circuit-breaker, twice):
```
camel.resilience4j.circuitbreaker.supplierCircuitBreaker.slidingWindowSize=4
```
an invented per-id form, passed the properties validation and the run died at startup with "Cannot find getter method: supplierCircuitBreaker on bean: class java.lang.String when binding property: circuitbreaker.supplierCircuitBreaker.failureRateThreshold".
`PropertiesChecks` now reports a key with a nested segment under one of the main model's option groups (resilience4j, faulttolerance, threadpool, health...), before the catalog check, with the global form and, for resilience4j, the per-circuit-breaker form in the route:
```
Line 1: circuitbreaker Unknown option (camel.resilience4j has no nested settings such as circuitbreaker: its options are global, camel.resilience4j.slidingWindowSize=..., or per circuit breaker in the route: circuitBreaker: {resilience4jConfiguration: {slidingWindowSize: ...}})
```
The prefixes whose keys nest by design (`camel.component`, `camel.beans`, `camel.variable`, `camel.kamelet`, `camel.main`, bracketed keys such as `camel.threadpool.config[x]`) are left to the checks that own them.
## Tests
`SourceValidatorPropertiesTest.aNestedKeyUnderAnOptionGroupIsReported`: the resilience4j and a faulttolerance nested key are reported, the global form between them is not. The ai package of camel-jbang-core green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26639:
URL: https://github.com/apache/camel/pull/26639#issuecomment-5752673242
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26639:
URL: https://github.com/apache/camel/pull/26639#issuecomment-5752919384
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `dsl/camel-jbang/camel-jbang-core`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 6 of 692 tested, 8 compile-only — current: 6 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **15 affected modules** (current approach: 6).
**Skip-tests mode would test 6 modules** (1 direct + 6 downstream), **skip tests for 8** (generated code, meta-modules)
<details><summary>:warning: Modules only in Scalpel (9)</summary>
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-launcher`
- `coverage`
</details>
<details><summary>Modules Scalpel would test (6)</summary>
- `camel-jbang-core` ← dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/PropertiesChecks.java, dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorPropertiesTest.java
- `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
- `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
</details>
<details><summary>Modules with tests skipped (8)</summary>
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-launcher`
- `coverage`
</details>
> :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
:warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
- `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
:bulb: **Manual integration tests recommended:**
> You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
> ```
> mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
> ```
<details><summary>All tested modules (15 modules, 3m 18s total)</summary>
**Total reactor time:** 3m 18s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: Launcher | 53.4s | SUCCESS |
| Camel :: JBang :: Plugin :: TUI | 50.1s | SUCCESS |
| Camel :: JBang :: MCP | 41.8s | SUCCESS |
| Camel :: JBang :: Plugin :: Kubernetes | 20.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Testing | 10.9s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 8.0s | SUCCESS |
| Camel :: Coverage | 5.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Generate | 1.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Edit | 1.5s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 1.2s | SUCCESS |
| Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
| Camel :: JBang :: Main | 1.0s | SUCCESS |
| Camel :: JBang :: Plugin :: Route Parser | 0.9s | SUCCESS |
| Camel :: Launcher :: Container | 0.8s | SUCCESS |
| Camel :: JBang :: Core | n/a | |
**Top 20 slowest modules:**
- `Camel :: Launcher` (53.4s)
- `Camel :: JBang :: Plugin :: TUI` (50.1s)
- `Camel :: JBang :: MCP` (41.8s)
- `Camel :: JBang :: Plugin :: Kubernetes` (20.6s)
- `Camel :: JBang :: Plugin :: Testing` (10.9s)
- `Camel :: JBang :: Plugin :: Validate` (8.0s)
- `Camel :: Coverage` (5.6s)
- `Camel :: JBang :: Plugin :: Generate` (1.6s)
- `Camel :: JBang :: Plugin :: Edit` (1.5s)
- `Camel :: JBang :: Plugin :: MCP` (1.2s)
- `Camel :: JBang :: Integration tests` (1.2s)
- `Camel :: JBang :: Main` (1.0s)
- `Camel :: JBang :: Plugin :: Route Parser` (0.9s)
- `Camel :: Launcher :: Container` (0.8s)
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/35538317905)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #26639:
URL: https://github.com/apache/camel/pull/26639#discussion_r4058107865
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/PropertiesChecks.java:
##########
@@ -46,6 +47,52 @@ public static List<String> validateProperties(
return validatePropertiesLines(content, line -> validatePropertyLine(line, catalog, extraPropertyLine));
}
+ /** camel.<group>.<rest>=: the option groups of the main model (resilience4j, faulttolerance, threadpool...). */
+ static final Pattern GROUP_KEY_PATTERN = Pattern.compile("^\\s*camel\\.([a-zA-Z0-9-]+)\\.([^=\\s]+)\\s*=");
+
+ /** The camel.* prefixes whose keys legitimately nest, or that other checks own. */
+ private static final Set<String> NESTING_GROUPS = Set.of("component", "dataformat", "language", "beans", "variable",
+ "kamelet", "jbang", "route-template", "routeTemplate", "main", "rest", "server", "management");
+
+ /**
+ * camel.resilience4j.circuitbreaker.supplierCircuitBreaker.slidingWindowSize=4, an invented per-id form: the
+ * catalog accepts it and the run dies at startup ("Cannot find getter method: supplierCircuitBreaker on bean: class
+ * java.lang.String"). The options of a group are global, one segment after the group; resilience4j is also set per
+ * circuit breaker in the route (CAMEL-24856).
+ */
+ static String nestedGroupKeyHint(String line, CamelCatalog catalog) {
+ Matcher m = GROUP_KEY_PATTERN.matcher(line);
+ if (!m.find()) {
+ return null;
+ }
+ String group = m.group(1);
+ String rest = m.group(2);
+ if (!rest.contains(".") || rest.contains("[") || NESTING_GROUPS.contains(group)) {
+ return null;
+ }
+ String prefix = "camel." + group + ".";
+ List<String> options = new ArrayList<>();
+ for (var o : catalog.mainModel().getOptions()) {
Review Comment:
⚠️ **NPE risk — `catalog.mainModel()` is documented to return `null`.**
`CamelCatalog.mainModel()` has the Javadoc: `@return the requested main model or {@code null} in case it is not available in this CamelCatalog`. Calling `.getOptions()` on a null model throws NPE.
Unlike `mainOptionHint()`, which wraps its `catalog.mainModel()` calls inside a `try/catch (Exception e)` block, `nestedGroupKeyHint()` has no such guard — and it's invoked from `validatePropertyLine` *before* the `try` block. A null catalog would crash the entire validation.
Fix: add a null guard before dereferencing:
```suggestion
MainModel mm = catalog.mainModel();
if (mm == null) {
return null;
}
List<String> options = new ArrayList<>();
for (var o : mm.getOptions()) {
```
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #26639:
URL: https://github.com/apache/camel/pull/26639#discussion_r4058116440
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/PropertiesChecks.java:
##########
@@ -46,6 +47,52 @@ public static List<String> validateProperties(
return validatePropertiesLines(content, line -> validatePropertyLine(line, catalog, extraPropertyLine));
}
+ /** camel.<group>.<rest>=: the option groups of the main model (resilience4j, faulttolerance, threadpool...). */
+ static final Pattern GROUP_KEY_PATTERN = Pattern.compile("^\\s*camel\\.([a-zA-Z0-9-]+)\\.([^=\\s]+)\\s*=");
+
+ /** The camel.* prefixes whose keys legitimately nest, or that other checks own. */
+ private static final Set<String> NESTING_GROUPS = Set.of("component", "dataformat", "language", "beans", "variable",
+ "kamelet", "jbang", "route-template", "routeTemplate", "main", "rest", "server", "management");
+
+ /**
+ * camel.resilience4j.circuitbreaker.supplierCircuitBreaker.slidingWindowSize=4, an invented per-id form: the
+ * catalog accepts it and the run dies at startup ("Cannot find getter method: supplierCircuitBreaker on bean: class
+ * java.lang.String"). The options of a group are global, one segment after the group; resilience4j is also set per
+ * circuit breaker in the route (CAMEL-24856).
+ */
+ static String nestedGroupKeyHint(String line, CamelCatalog catalog) {
+ Matcher m = GROUP_KEY_PATTERN.matcher(line);
+ if (!m.find()) {
+ return null;
+ }
+ String group = m.group(1);
+ String rest = m.group(2);
+ if (!rest.contains(".") || rest.contains("[") || NESTING_GROUPS.contains(group)) {
+ return null;
+ }
+ String prefix = "camel." + group + ".";
+ List<String> options = new ArrayList<>();
+ for (var o : catalog.mainModel().getOptions()) {
Review Comment:
Guarded as suggested in the follow-up commit: `nestedGroupKeyHint` returns `null` when `catalog.mainModel()` is `null`, so the key just goes to the catalog as before.
_Claude Code on behalf of @davsclaus_
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #26639:
URL: https://github.com/apache/camel/pull/26639
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org