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

Launch for Camel routes should use * and not the yaml file name #556

Open
lhein opened this issue Apr 21, 2024 · 10 comments
Open

Launch for Camel routes should use * and not the yaml file name #556

lhein opened this issue Apr 21, 2024 · 10 comments
Labels
enhancement New feature or request PRIO

Comments

@lhein
Copy link
Contributor

lhein commented Apr 21, 2024

If you want to prototype a route which contains Java files then the current Launch command is not sufficient. The current command is only useful if the user just has a single yaml file that they want to run. I would like to see the launch use the camel run * --dev instead so all the Java files and possible other files are taken into consideration too.

@lhein lhein added this to the VS Code 0.next milestone Apr 21, 2024
@lhein lhein added enhancement New feature or request PRIO labels Apr 21, 2024
@lhein
Copy link
Contributor Author

lhein commented Apr 21, 2024

It doesn't help to store the java class under src/main/java.

@apupier
Copy link
Member

apupier commented Apr 29, 2024

the current implementation allows to be more precise on which files are launched and avoid side-effects.

An alternative is to use a launch configuration or to provide * as additional parameter with the settings to run and debug (soon to be released).

Note that it is not specific to VS Code Kaoto. it applies to all kind of Camel files and the related code is in VS Code Devug Adapter for Camel

@lordrip
Copy link
Member

lordrip commented Apr 29, 2024

Couldn't we have an additional button to say "Run container folder"? This way we could have both scenarios covered

image

@lordrip
Copy link
Member

lordrip commented Apr 29, 2024

Also, I don't know if it's possible, but could those buttons be a dropdown instead, so we would have both run and debug under the same button, ala IntelliJ?

@apupier
Copy link
Member

apupier commented Apr 29, 2024

yes, it is possible to have a dropdown with this quick button menu action on editors.

I think we should keep 2 distincts buttons between run and debug especially if we are providing 2 entries to run single file and run all files.

@lordrip
Copy link
Member

lordrip commented Apr 29, 2024

That could work as well, as long as we have easy access to the option directly in the file, we're good.

Maybe another thing to consider would be if it's possible to run the file in the folder context, meaning that for that execution, the CWD is the containing folder, this is because this way, the application.properties file would be next to the route, at least in the quick prototyping mode, offering a more flexible way to configure routes, as the opposite that would be having a single application.properties file in the workspace's root

@apupier
Copy link
Member

apupier commented Apr 29, 2024

Maybe another thing to consider would be if it's possible to run the file in the folder context, meaning that for that execution, the CWD is the containing folder, this is because this way, the application.properties file would be next to the route, at least in the quick prototyping mode, offering a more flexible way to configure routes, as the opposite that would be having a single application.properties file in the workspace's root.

If I understand well, the idea is to have one folder per integration project and that VS Code is opened on one parent folder having several of this "folder integration project".
If yes, this use case is currently out of scope. The amount of work for supporting completely that is too large compared of the needed work and the resources we have.

Plus if you are already at this stage, the better way to handle it on a real project is to have a multi-module maven project

@lordrip
Copy link
Member

lordrip commented Apr 29, 2024

Oh, no exactly like that, let me rephrase myself.

Considering the following structure:

my-app/
├─ kafka-consumer/
│    ├─ route.camel.yaml
│    ├─ application.properties
├─ kafka-producer/
│    ├─ route.camel.yaml
│    ├─ application.properties
├─ .gitignore
├─ application.properties

Considering VSCode opening my-app/kafka-consumer/route.camel.yaml, my proposal would be to use the kafka-consumer folder as CWD, this way, the application.properties next to that route would be picked, rather than using the root application.properties.

@apupier
Copy link
Member

apupier commented Apr 29, 2024

Oh, no exactly like that, let me rephrase myself.

Considering the following structure:

my-app/
├─ kafka-consumer/
│    ├─ route.camel.yaml
│    ├─ application.properties
├─ kafka-producer/
│    ├─ route.camel.yaml
│    ├─ application.properties
├─ .gitignore
├─ application.properties

Considering VSCode opening my-app/kafka-consumer/route.camel.yaml, my proposal would be to use the kafka-consumer folder as CWD, this way, the application.properties next to that route would be picked, rather than using the root application.properties.

this is unfortunately the structure I meant.

@apupier
Copy link
Member

apupier commented May 14, 2024

Alternative which is covering more cases and avoids to potentially throw users in not working cases by default:
https://issues.redhat.com/browse/FUSETOOLS2-2368 Provide submenu quick action button to run with all elements
https://issues.redhat.com/browse/FUSETOOLS2-2369 Provide submenu quick action button to run with all elements from containing folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PRIO
Projects
Status: Todo
Development

No branches or pull requests

3 participants