apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
859 stars 344 forks source link

re-evaluate language parsing #1266

Open lburgazzoli opened 4 years ago

lburgazzoli commented 4 years ago

Integration sources introspection is done using a mix of technique:

  1. inspecting nodes for mark-up languages
  2. regexp for everything else

While 1. may be good enough, that is not certainly the case for 2. as we have a number of complains such as the fact that the parser does not properly handle commented out code. Using regexp make it also quite complex to keep-up with the evolution of Camel's DSL as example, we can't understand the new endpoint DSL.

Because of the limitation of the current approach we should re-evaluate it and switch to something like ANTLR4 to generate a proper model definition.

As side note I wonder if we should keep the result of this introspection as side resource of Integration for troubleshooting.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

squakez commented 1 year ago

@lburgazzoli should we leverage the capabilities offered by Camel JBang?

lburgazzoli commented 1 year ago

maybe not exactly camel-jbang per se but something that is used behind the scenes by camel-jbang to inspect routes.

squakez commented 1 year ago

maybe not exactly camel-jbang per se but something that is used behind the scenes by camel-jbang to inspect routes.

Thanks, but how would you see this in relation to #4024? I mean, if we manage to leverage the project generated by Camel JBang, shouldn't we be fine? or is there anything else we still need to parse by any chance? I may miss this last point.

lburgazzoli commented 1 year ago

The project generator is one side but we also need to inspect the routes for auto discovery of features and to find out suitable kit. So we would need a tool that generate a sort of model the camel-k operator can leverage before triggering a build.