Skip to content

ci: validate all Kamelets (remove early break in listKamelets)#2878

Merged
oscerd merged 1 commit into
apache:mainfrom
oscerd:ci-fix/validator-check-all-kamelets
Jun 24, 2026
Merged

ci: validate all Kamelets (remove early break in listKamelets)#2878
oscerd merged 1 commit into
apache:mainfrom
oscerd:ci-fix/validator-check-all-kamelets

Conversation

@oscerd

@oscerd oscerd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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-sourcequeueURL: 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-actiondataTypeProcessor: 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).

listKamelets in script/validator appended the first Kamelet file and
then broke out of the loop, so the validator only ever checked a single
Kamelet (avro-deserialize-action, alphabetically first) out of ~250.
Every rule (parameters, descriptors, annotations, used-params, ...)
silently ran against one file and the tool exited 0 -- disabling the
catalog's authoring safety net since 1caed85 (2025-09-05).

Removing the break re-arms validation across all Kamelets. Two
previously-unchecked Kamelets surfaced declared-but-unused properties:
- aws-sqs-source: queueURL, a vestigial KEDA scaler hint also present in
  the already-excluded aws-s3-event-based-source;
- data-type-action: dataTypeProcessor, a bean referenced via process/ref
  that the used-params check does not yet detect.
Both are added to the existing verifyUsedParams exclusion list to keep
the validator green, consistent with the entries already there.
Improving bean-reference detection so these (and the rest of the list)
can be retired is left to a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@oscerd oscerd requested review from apupier and squakez June 24, 2026 09:21
@oscerd oscerd merged commit fa0de42 into apache:main Jun 24, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants