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

Commands/tasks/launch and workspace configuration synchronization #12709

Open
5 of 15 tasks
l0rd opened this issue Feb 20, 2019 · 12 comments
Open
5 of 15 tasks

Commands/tasks/launch and workspace configuration synchronization #12709

l0rd opened this issue Feb 20, 2019 · 12 comments
Labels
area/plugins kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@l0rd
Copy link
Contributor

l0rd commented Feb 20, 2019

Goal

The goal of this epic is to improve the experience related to configuring tasks, commands and launch configs to keep them in sync with the workspace configuration and all the different menus from the IDE.

As a user, I should be able to configure tasks, commands, launch configs and get them kept in sync so that my experience is consistent between the different IDE actions that are available.

Problems

Today, a workspace and its tasks, commands, launch configs, could be configured from different sources, but editing one or the other doesn't keep everything in sync. There are different sources:

  • the devfile
  • the tasks.json in a .theia folder
  • the launch.json in the .theia folder
  • the IDE from the different menu options

Those are not yet kept synchronized which cause inconsistency. Examples:

  • If a user is adding a task from the IDE, the menu will guide him into adding a task to the tasks.json file, but then the task is not referenced in the devfile.
  • Similarly, if the devfile is getting updated, the workspace will need to be restarted to get the changes applied.

Sub-tasks

@l0rd l0rd added the kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed. label Feb 20, 2019
@l0rd l0rd changed the title Improve Che commands and Theia tasks integration Che commands should be first class citizens in Theia Feb 20, 2019
@slemeur slemeur changed the title Che commands should be first class citizens in Theia Che commands should be first class citizens Oct 16, 2019
@slemeur slemeur changed the title Che commands should be first class citizens Commands/tasks/launch and workspace configuration synchronization Oct 16, 2019
@benoitf benoitf added area/editor/theia Issues related to the che-theia IDE of Che team/editors area/plugins and removed team/editors area/editor/theia Issues related to the che-theia IDE of Che labels Jan 8, 2020
@tsmaeder
Copy link
Contributor

tsmaeder commented Jan 9, 2020

This is even more complicated when you think about multiple workspace roots, something we will need in the future.
I don't think syncing is a good approach for two reasons: first, it leads to complicated, error-prone code and second, it does not work well with multi-root workspaces (commands in the devfile are inherently global: which workspace root do you sync them to? What if you remove that project, etc.).
I would advocate for an approach where the devfile is just one more repository for tasks (like tasks.json). The editing experience would be the same as for tasks.json.
In general, I think we need to think about what user-level features we want to enable (that's not clear to me).
Here's a couple of things I think would be useful:

  • Do a "configure command" action and have the result live in the devfile
  • Edit devfile commands in the IDE as IDE tasks.
  • Run devfile commands via the task execution

VS Code currently supports adding tasks and launch configuration sections in in the workspace configuration file. However, the UI is not completely up to handling that: for example, when you do a "configure task" the task configuration always ends up in one of the workspace roots.

One requirement we're seeing is to run tasks contributed by extensions (Quarkus) to different containers. By default, they should probably run in the container where the extension runs that contributed them, but there are cases where that is the wrong one. There should be "run task in container" and "configure container for task" (which would create a configured task in the devfile).

@davidwindell
Copy link
Contributor

It would be ideal if tasks could be defined on a project level and stored in a projects .theia or .vscode folder (tasks.json). As I described above, tasks often change throughout the lifecycle of a project so in a project repo would be the best place for them.

@l0rd
Copy link
Contributor Author

l0rd commented Jan 15, 2020

@tsmaeder you have good points.

I agree that we should avoid synching if possible. One problem we have is that currently the .theia folder doesn't get versioned because it's outside of the project folder (I think that's what @davidwindell is mentioning too). Having a sync mechanism with the devfile (that is versioned) would solve this problem and that's one of the reasons we proposed that. But if .theia could be moved in project folder that may work as well.

@tsmaeder
Copy link
Contributor

It would be ideal if tasks could be defined on a project level and stored in a projects .theia or .vscode folder (tasks.json).

If we move to a setup where we have on workspace root/project, that will be automatically be the case. However, the tasks in the devfile are still global, not specific to a project.

@RomanNikitenko
Copy link
Member

We could have some field like scope or source for che command in a devfile to know which workspace folder should be used to store a task: #15540

@davidwindell
Copy link
Contributor

That's a great idea, would have to think about how a sync would work when a project git pull changes the tasks.

@sunix
Copy link
Contributor

sunix commented Mar 20, 2020

100% agree with @tsmaeder

  • we should not have any tasks.json any where to store Che commands, It is too confusing for the end users.
  • @davidwindell devfile.yaml stored in the project should work. We could have commands (or automated triggers) to synch that with the devfile (workspace config). Another alternative could be to have custom devfile registries that would be built from git. Let me know if this wont work for you. I would be interested to see your usecase.

@sunix
Copy link
Contributor

sunix commented Mar 26, 2020

Conclusion during Che community call discussion:

  1. We remove tasks.json from workspace roots. Che commands are to be edited in the devfile (workspace config). We then need to agree what is the best UX to edit the devfile (workspace-config) in che-theia.
  2. Project could keep tasks.json file. But that would not be related to Che. Should be a feature in Theia. Che would ask the user in which container to execute it when the task is triggered.

@che-bot
Copy link
Contributor

che-bot commented Oct 1, 2020

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 1, 2020
@tsmaeder tsmaeder added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 1, 2020
@tsmaeder
Copy link
Contributor

tsmaeder commented Oct 1, 2020

Unfortunately, we still need to replicate the tasks for now, but this is still kinda bogus

@sunix
Copy link
Contributor

sunix commented Nov 20, 2020

i think the missing pieces "che-sync" shouldn't be done in a Theia plugin but process independent of the editor.
Same for project cloning.

@azatsarynnyy
Copy link
Member

Same for project cloning.

fyi: regarding cloning #15973

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

9 participants