Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override example template for these action kamelets #866

Closed
MelissaFlinn opened this issue Mar 28, 2022 · 7 comments · Fixed by #897
Closed

override example template for these action kamelets #866

MelissaFlinn opened this issue Mar 28, 2022 · 7 comments · Fixed by #897

Comments

@MelissaFlinn
Copy link
Contributor

MelissaFlinn commented Mar 28, 2022

By default, the Kamelets template auto generates examples. We discovered that the auto-generated examples for the following Kamelets do not work. (As a workaround, we provided working examples in the Kamelets Reference document.)
avro-deserialize-action-binding.yaml
avro-serialize-action.kamelet.yaml
has-header-filter-action.kamelet.yaml
insert-action.kamelet.yaml
protobuf-deserialize-action.kamelet.yaml
protobuf-deserialize-action.kamelet.yaml

@oscerd
Copy link
Contributor

oscerd commented Mar 29, 2022

This is a description not really complete. What is wrong exactly?

@squakez
Copy link
Contributor

squakez commented Mar 29, 2022

If I understand correctly, the template we use to render Kamelets documentation is not correct for action kind Kamelets.

@oscerd
Copy link
Contributor

oscerd commented Mar 30, 2022

The reported list is just a subset, so only this subset has something wrong, but what is it? Waiting for clarification.

@MelissaFlinn
Copy link
Contributor Author

What is wrong: the auto-generated examples for those Kamelets do not work.

@MelissaFlinn
Copy link
Contributor Author

The examples need additional steps - such as adding a serialize/deserialize step. The way that the template generates examples now, we cannot override the generated ones to provide examples that are correct/useful.

@oscerd
Copy link
Contributor

oscerd commented Apr 1, 2022

Now I have a description.

@claudio4j
Copy link
Contributor

I am investigating this issue. Looking at the avro-deserialize-action and the corresponding binding example file avro-deserialize-action-binding.yaml

It fails with JsonParseException: Needed to read 36 bytes, missed 36 before end-of-input

The kamelet binding should be fixed by having a json message in the timer and additional steps to convert string -> json -> avro.

I had not run all the other auto generated kamelet biding to see if they work.

To fix this, I propose one of the following options:

  1. Have all the kamelet bindings in templates/bindings/camel-k directory in working condition and have docs/modules/ROOT/examples/js/kamelets.js to source these files as examples instead to auto generate them. And have only one kafka or knative channel sink in the example binding file.

  2. Fix only the non working binding example files in templates/bindings/camel-k directory, add a comment marker to it, and change docs/modules/ROOT/examples/js/kamelets.js to source this example file into the generated html doc, instead to auto generated the binding example.

claudio4j added a commit to claudio4j/camel-kamelets that referenced this issue Apr 25, 2022
Fix apache#866

* There are some generated kamelet bindings are invalid, the auto
  generation cannot resolve all the required steps, so there is
  a need to create it manually
* Add a comment marker in kamelet binding examples for the auto
  generation to skip its creation
* The doc generation source the kamelet binding example file when it
  doesn't auto generate the example
* the camel-kamelets directory is hardcoded in kamelets.js as it is
  assumed this generation mechanism already assumes this directory
claudio4j added a commit to claudio4j/camel-kamelets that referenced this issue Apr 26, 2022
Fix apache#866

* There are some generated kamelet bindings are invalid, the auto
  generation cannot resolve all the required steps, so there is
  a need to create it manually
* Add a comment marker in kamelet binding examples for the auto
  generation to skip its creation
* The doc generation source the kamelet binding example file when it
  doesn't auto generate the example
* the camel-kamelets directory is hardcoded in kamelets.js as it is
  assumed this generation mechanism already assumes this directory
claudio4j added a commit to claudio4j/camel-kamelets that referenced this issue Apr 26, 2022
Fix apache#866

* There are some generated kamelet bindings are invalid, the auto
  generation cannot resolve all the required steps, so there is
  a need to create it manually
* Add a comment marker in kamelet binding examples for the auto
  generation to skip its creation
* The doc generation source the kamelet binding example file when it
  doesn't auto generate the example
* the camel-kamelets directory is hardcoded in kamelets.js as it is
  assumed this generation mechanism already assumes this directory
claudio4j added a commit to claudio4j/camel-kamelets that referenced this issue Apr 26, 2022
Fix apache#866

* There are some generated kamelet bindings are invalid, the auto
  generation cannot resolve all the required steps, so there is
  a need to create it manually
* Add a comment marker in kamelet binding examples for the auto
  generation to skip its creation
* The doc generation source the kamelet binding example file when it
  doesn't auto generate the example
* the camel-kamelets directory is hardcoded in kamelets.js as it is
  assumed this generation mechanism already assumes this directory
oscerd pushed a commit that referenced this issue Apr 26, 2022
Fix #866

* There are some generated kamelet bindings are invalid, the auto
  generation cannot resolve all the required steps, so there is
  a need to create it manually
* Add a comment marker in kamelet binding examples for the auto
  generation to skip its creation
* The doc generation source the kamelet binding example file when it
  doesn't auto generate the example
* the camel-kamelets directory is hardcoded in kamelets.js as it is
  assumed this generation mechanism already assumes this directory
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 a pull request may close this issue.

4 participants