Repository navigation
CAMEL-26012: camel-yaml-dsl-validator - TextBodyFlowTest no longer expects a pulsar finding - #29807
Conversation
…pects a pulsar finding Since #29753 the pulsar producer body depends on allowJavaSerializedObject, an option that may also be set on the component. The validator then does not know the body a route sends to pulsar, and says nothing, as it does for spring-rabbitmq. The test still expected the "to: pulsar needs the body as text" finding, and failed on every PR whose build runs camel-yaml-dsl-validator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. No issues found.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 1 of 722 tested, 0 compile-only — current: 7 all testedMaveniverse Scalpel detected 1 affected modules (current approach: 7). Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules) Modules only in current approach (6)
Modules Scalpel would test (1)
All tested modules (7 modules, 1m 9s total)Total reactor time: 1m 9s
Top 20 slowest modules:
|
oscerd
left a comment
There was a problem hiding this comment.
Reviewed as the root-cause fix for the TextBodyFlowTest regression, and it is the right one.
testTheBodyOfMessaging started failing on every build that runs camel-yaml-dsl-validator because #29753 gave pulsar's producerIn a dependsOn: [allowJavaSerializedObject], and that option exists on both the component and the endpoint. That moves pulsar out of the group the test counted as "parsed data must be marshalled first" and into the same bucket as spring-rabbitmq, where a component option decides the behaviour and the body type says nothing definite. So the finding count going from four to three, and the comment rewrite that puts pulsar next to spring-rabbitmq's "may be set on the component", is the accurate description of what the resolver now sees, not just a number bumped to make the test pass.
Since you own the pulsar change this follows from, the reading of why the finding dropped is authoritative. Worth noting #29810 is a second fix for the same failure, and its author says plainly it is a stopgap without the root cause; this one has the cause, so it is the one to take and that can close in its favour. Clean.
Claude Code on behalf of oscerd
…e set on the component keeps its default when reading the body (#29808) The YAML validator treated a body type that depends on an option the route does not set, but that can be set on the component, as not known, and said nothing. For the insecure opt-ins (security insecure:ssl, insecure:serialization or insecure:dev) that made it go quiet where it should not: pulsar (allowJavaSerializedObject), jms/activemq/activemq6/amqp (transferExchange, objectMessageEnabled), sjms/sjms2 (objectMessageEnabled), mina (transferExchange, objectCodecPattern), netty (transferExchange), keycloak/spiffe (allowOperationHeader). Such an option is off unless turned on, and one turned on for the whole component is reported by the security policy at startup, so CatalogBodyTypes.componentSide() no longer counts it as "can be set elsewhere": it keeps its default unless the route sets it. - BodyTypeResolver documents it on the hidden parameter, and body-types.adoc states the rule. - TextBodyFlowTest expects the pulsar finding again (dropped by #29807), and testTheBodyOfAnInsecureOptIn checks that a route leaving allowJavaSerializedObject alone is reported and one turning it on is not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Description
Fixes
TextBodyFlowTest.testTheBodyOfMessagingon main, which fails on every PR whose build runscamel-yaml-dsl-validator(seen on #29594 and #29706).Since #29753 (CAMEL-26012) the
producerInbody type of pulsar hasdependsOn: [allowJavaSerializedObject], and that option exists on the component as well as on the endpoint.BodyTypeResolvertreats adependsOnoption that the step does not set, but that can be set elsewhere, as not known, so the validator says nothing about the body a route sends to pulsar, as it already does for spring-rabbitmq. The test still expected theto: pulsar needs the body as text, bytes, a stream or a filefinding (4 findings, CI found 3).The test now expects 3 findings and asserts that the pulsar route is not reported; smtp and google-pubsub keep covering a producer that needs text.
#29753's own build and the main build passed because neither ran this module.
Whether options such as
allowJavaSerializedObjectshould be endpoint-only, so they cannot be switched on for a whole component (which would also bring the pulsar finding back), is checked separately.Testing
Claude Code on behalf of davsclaus
🤖 Generated with Claude Code