Skip to content

CAMEL-24856: the properties validator reports a nested segment under an option group, which fails at startup - #26639

Merged
davsclaus merged 2 commits into
mainfrom
fix/CAMEL-24856
Sep 21, 2026
Merged

davsclaus merged 2 commits into
mainfrom
fix/CAMEL-24856

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

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.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj

…an option group (camel.resilience4j.circuitbreaker.<id>.<option>): the options are global, or per circuit breaker in the route

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 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 have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Sep 20, 2026

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue in the new nestedGroupKeyHint method.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

…main model

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after the null-guard commit.

The previous CHANGES_REQUESTED finding — NPE risk from catalog.mainModel() returning null — is addressed: the new commit adds if (mm == null) { return null; } before dereferencing .getOptions(), matching the defensive pattern used in mainOptionHint().

The rest of the nestedGroupKeyHint logic is correct:

  • NESTING_GROUPS correctly excludes component, dataformat, language, beans, variable, kamelet, jbang, route-template, routeTemplate, main, rest, server, management — all prefixes that legitimately nest or are owned by other checks.
  • The rest.contains(".") guard prevents false positives on valid single-segment keys.
  • The options filter (!o.getName().substring(prefix.length()).contains(".")) correctly isolates flat group options.
  • Placement before catalog.validateConfigurationProperty() is correct: the catalog silently accepts these invented per-id forms, so the intercept must come first.

Test coverage is adequate: two representative cases (resilience4j and faulttolerance), the valid single-segment form excluded (line 2), and message content verified.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 6 of 692 tested, 8 compile-only — current: 6 all tested

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)

⚠️ Modules only in Scalpel (9)
  • 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
Modules Scalpel would test (6)
  • 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
Modules with tests skipped (8)
  • 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

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

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

💡 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
All tested modules (15 modules, 3m 18s total)

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)

⚙️ View full build and test results

@davsclaus davsclaus added this to the 4.23.0 milestone Sep 21, 2026
@davsclaus
davsclaus merged commit 100afa6 into main Sep 21, 2026
5 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-24856 branch September 21, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants