oscerd opened a new pull request, #2878:
URL: https://github.com/apache/camel-kamelets/pull/2878
## Summary
`listKamelets` in `script/validator/validator.go` appended the first Kamelet
file and then `break`-ed out of the loop, so the validator only ever inspected
**one** Kamelet (`avro-deserialize-action`, alphabetically first) out of ~250.
Every rule (`verifyParameters`, `verifyDescriptors`, `verifyAnnotations`,
`verifyUsedParams`, …) silently ran against that single file and the tool
exited `0`.
The stray `break` was introduced in `1caed85e3` (2025-09-05, _"make the
golang independent from camel k"_), so the catalog's authoring safety net — the
`cd script/validator && go run . ../../kamelets/` gate referenced in CI and in
the contributor guide — has effectively been a no-op for ~9 months.
## Fix
Remove the stray `break` so every Kamelet is validated again.
Re-arming the validator surfaced exactly two latent
`declared-but-never-used` findings in Kamelets that had simply never been
checked:
- **`aws-sqs-source` → `queueURL`**: a vestigial KEDA scaler hint (added in
2022 together with KEDA markers; the KEDA descriptors were later removed). Its
twin `aws-s3-event-based-source` carries the same property and is already in
the `verifyUsedParams` exclusion list — `aws-sqs-source` was simply missed.
- **`data-type-action` → `dataTypeProcessor`**: not a parameter at all but a
`template.beans` entry, used via `process: ref:`. The used-params check only
detects `{{property}}` placeholders, so it does not yet recognise `ref:` /
`#bean:` usage.
Both are added to the existing `verifyUsedParams` exclusion list to keep the
validator green, consistent with the entries already there. Deliberately kept
minimal so this can be reviewed and merged quickly to restore CI protection.
## Verification
- `go vet` and `gofmt -l`: clean.
- `go run . ../../kamelets/`: exits `0` across all 250 Kamelets.
- **Coverage proof:** injecting a violation into `log-sink` (which is *not*
alphabetically first) is now reported — `ERROR: kamelet "log-sink" does not
contain title`, exit `1`. Before this change it was silently ignored.
## Follow-ups (separate PRs)
- Improve `verifyUsedParams` bean / `ref:` detection and replace the
hard-coded relative-path exclusion list with an in-Kamelet opt-out annotation,
so the entries above (and most of the existing list) can be retired.
- Add new validator rules: reject the deprecated
`urn:alm:descriptor:com.tectonic.ui` descriptors, enforce
`camel.apache.org/catalog.version` matches the pom version, enforce the
source→`kamelet:sink` / sink→`kamelet:source` convention, and validate
dependency syntax.
---
_AI-generated by Claude Code on behalf of Andrea Cosentino (@oscerd)._
--
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]