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

User defined Che tasks commands should be exported in a tasks.json file #12712

Closed
l0rd opened this issue Feb 20, 2019 · 15 comments
Closed

User defined Che tasks commands should be exported in a tasks.json file #12712

l0rd opened this issue Feb 20, 2019 · 15 comments
Assignees
Labels
kind/enhancement A feature request - must adhere to the feature request template.

Comments

@l0rd
Copy link
Contributor

l0rd commented Feb 20, 2019

Description

Currently, when a user defines a command (in a devfile or from the Che dashboard), he won't be able to view/edit it from the tasks.json where Theia custom tasks should be defined.

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Feb 20, 2019
@vparfonov
Copy link
Contributor

@l0rd @slemeur
We can provide this as basic function in Theia upstream. It will look like in VS Code https://code.visualstudio.com/docs/editor/tasks.
Che Commands from WS config are 'detected task' for Theia API, after user edit command we will store it in tasks.json. Stored command will have high priority.
Is it ok for you?

@sunix
Copy link
Contributor

sunix commented Feb 26, 2019

Problem is that if user edits the tasks.json, he would share the config through the factory or ws config but won't get the changes done in tasks.json. So what is the benefit ?

I can see 2 options:

  • UI to edit che commands ? like we have in the old GWT IDE.
  • have a synchronization mechanism between che commands and tasks.json. But which container/folder to store that file ?

edit: what about 'target' container ? would that have its place in tasks.json ?

@l0rd
Copy link
Contributor Author

l0rd commented Feb 27, 2019

@vparfonov yes that makes sense thanks

@sunix this issue is task n.3 of epic #12709 and syncro is part of task n.5

@RomanNikitenko RomanNikitenko self-assigned this Mar 7, 2019
@RomanNikitenko RomanNikitenko added the status/in-progress This issue has been taken by an engineer and is under active development. label Mar 7, 2019
@RomanNikitenko RomanNikitenko added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Mar 26, 2019
@l0rd l0rd mentioned this issue Apr 2, 2019
@RomanNikitenko RomanNikitenko removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Apr 3, 2019
@RomanNikitenko
Copy link
Member

RomanNikitenko commented Apr 3, 2019

As it was suggested within this issue I added ability to configure Task from UI:

  • 'Configure task' action was provided for each item of 'Run Task' menu
  • 'Configure Tasks' menu action was added

'Configure Tasks' menu displays only detected tasks.
'Run Task' menu displays both: configured and filtered detected tasks. Detected tasks are filtered by label: for example, when we have configured and detected tasks with the same label - only configured task is displayed.
Both menus allow to copy task configuration to tasks.json file and provide ability to edit this one.

So, Che Commands from WS config are 'detected task' for Theia API and are displayed as items of 'Configure Tasks' and 'Run Task' menus. Task configuration is copied to tasks.json and available for editing by clicking on appropriate item. After that che command is displayed as 'configured' in 'Run Task' menu and has high priority at running. At the same time task configuration from WS config is still available from 'Configure Tasks' menu.

I would like to discuss question - do we need to copy all Che Commands from WS config to tasks.json file without user interaction?

@RomanNikitenko RomanNikitenko reopened this Apr 3, 2019
@vparfonov
Copy link
Contributor

I vision is no reason copy all commands during start WS.

@slemeur
Copy link
Contributor

slemeur commented Apr 3, 2019

@RomanNikitenko : Can you attach a recording?

@RomanNikitenko
Copy link
Member

@slemeur
You can see the basic functionality here and some improvements for UI here

@slemeur
Copy link
Contributor

slemeur commented Apr 5, 2019

@RomanNikitenko : I feel it quite confusing. I don't think a user will understand where the tasks are coming from.

From the video few feedbacks, as a user:

  • "provided vs configured" is not understandable - I would not know what is the differences. All tasks are provided and configured in fact.
  • "Configure Tasks" in the command palette is then just filtering the "provided tasks", while in fact, as a user I would like to be able to configure all the tasks.
  • It's very disturbing to see in the list of available tasks that there are 5 tasks, but then when you open the file "tasks.json" there are only 1 tasks defined there.

I think we should have a way to display all the tasks and commands. What about a dedicated view where we aggregate all of them? Similar to how preferences are handled?

@RomanNikitenko
Copy link
Member

@slemeur thank you for your feedback!
I would like to make some comments about that:

"provided vs configured" is not understandable - I would not know what is the differences. All tasks are provided and configured in fact.

OK, I see, but this is default behavior for VS Code https://code.visualstudio.com/docs/editor/tasks

"Configure Tasks" in the command palette is then just filtering the "provided tasks", while in fact, as a user I would like to be able to configure all the tasks.

User has ability to configure all the tasks - 'Run Task' menu displays both: configured and detected tasks. 'Configure Tasks' menu displays only detected tasks(configured tasks are already placed in the tasks.json file and available for editing).

It's very disturbing to see in the list of available tasks that there are 5 tasks, but then when you open the file "tasks.json" there are only 1 tasks defined there.

From other side you have ability to run any task and only overridden tasks are displayed in the tasks.json file.
I think it is not consistent if we display all detected Che tasks in tasks.json file, but do not display another tasks, so we should display all detected tasks in tasks.json file, right?
For example, at the moment when I work with theia I have:
configure

Do we really need to display all detected tasks in tasks.json file?

So, I guess we can not change default behavior of Theia and need some custom view for our goals.
Anyway I believe we can provide the best solution for user when we have a few points of view and productive discussion, so thank you very much, Stevan!

@l0rd
Copy link
Contributor Author

l0rd commented Apr 8, 2019

I suggest to discuss that tomorrow in Cherkasy during our meeting about Che commands. We will then report the outcome of the discussion here.

@sunix
Copy link
Contributor

sunix commented Apr 8, 2019

I think we should not compare to VSCode behaviour because it is another use case: these tasks are coming by default with plugins as I understood.
Our Che commands cannot be considered as commands by default to be configured ... but as Che user tasks. It is consistent that we see all the Che commands in tasks.json and not having to do any additional action for viewing or editing them.

We should see che commands as

  • a way to persist tasks.json in the wsconfig (and maybe in the futur devfile)
  • the ability to run the task on remote containers

But definitely not default commands you can customize.
My 2 cents...

@sunix
Copy link
Contributor

sunix commented Apr 24, 2019

@RomanNikitenko i tried to run a che task i have modified (configured ...), but changes are not applied ... is it expected ?

@RomanNikitenko
Copy link
Member

@sunix We have regression after merge eclipse-theia/theia#4847

@slemeur
Copy link
Contributor

slemeur commented Apr 24, 2019

@RomanNikitenko + @vparfonov : Where are you tracking the bug and getting the fix? This is quite critical

@RomanNikitenko
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

No branches or pull requests

5 participants