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

   Fixes #2958
   
   Two cases where `spec.definition` and the template disagreed.
   
   ### 1. `queueURL` was declared but never used
   
   `aws-sqs-source` and `aws-s3-event-based-source` both declared a `queueURL` 
property, but neither template referenced it — `grep -c '{{queueURL}}'` 
returned 0 in both. The `from:` URIs bound only `queueNameOrArn`. An operator 
setting `queueURL` got no effect and no warning.
   
   Bound to the component option:
   
   ```yaml
   uriEndpointOverride: "{{?uriEndpointOverride}}"
   queueUrl: "{{?queueURL}}"
   ```
   
   The `aws2-sqs` `queueUrl` option is documented as *"To define the queueUrl 
explicitly. All other parameters, which would influence the queueUrl, are 
ignored. This parameter is intended to be used to connect to a mock 
implementation of SQS, for testing purposes."* — the property descriptions now 
say that, since "The full SQS Queue URL" did not convey that it overrides 
everything else.
   
   ### 2. Precondition fallbacks inverted the declared schema defaults
   
   Five templates used `${properties:X:true}` as the precondition fallback 
while the schema declared `default: false` for the same property:
   
   | file | property | schema default | fallback (before) |
   |---|---|---|---|
   | `azure-storage-blob-source` | `deleteAfterRead` | `false` | `true` |
   | `aws-s3-event-based-source` | `getObject` | `false` | `true` |
   | `azure-storage-blob-event-based-source` | `getBlob` | `false` | `true` |
   | `google-storage-event-based-source` | `getObject` | `false` | `true` |
   | `set-kafka-key-action` | `forceHeaderDeletion` | `false` | `true` |
   
   (`cassandra-sink` uses the same idiom but is already consistent — schema 
default `true`.)
   
   Whether the fallback is ever reached depends on whether the consuming 
runtime materialises `spec.definition` defaults before evaluating 
preconditions. For the Camel Kamelet loader it appears not to be, but that is 
not obviously guaranteed for every supported consumer (camel-k operator, 
camel-kafka-connector, Camel JBang). The `azure-storage-blob-source` case is 
the one worth caring about — the fallback direction there is "delete the blob".
   
   Aligning each fallback with its declared default is a no-op where the loader 
already materialises defaults, and the correct behaviour where it does not.
   
   ### Verification
   
   - `script/validator` reports no errors
   - `mvn verify` passes
   - The `queueUrl` binding was checked against the Camel 4.22.0 catalog for 
`aws2-sqs`, not against a live or mock SQS endpoint
   
   ---
   _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