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

Che commands should be of type task or launch #12710

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

Che commands should be of type task or launch #12710

l0rd opened this issue Feb 20, 2019 · 11 comments
Assignees
Labels
area/devfile-spec Issues related to Devfile v2 area/editor/theia Issues related to the che-theia IDE of Che kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.

Comments

@l0rd
Copy link
Contributor

l0rd commented Feb 20, 2019

Description

VS Code (and thus Theia) does a clear distinction between a task (linting, building, packaging, testing or deploying) and a launch configuration (run, debug an application).

Currently all Che commands are translated into Theia tasks. As a consequence the UX is bad for run/debug commands. For example, when a user defines a debug command (in a devfile or from the Che dashboard), he won't be able to run it from Theia Debug menu.

This issue is about adding an attribute (or a label or an annotation) to the current Che command model (in a workspace config and in a devfile) so that a user will be able to specify if the command should be translated into a task or a launch config.

N.B. This issue is part of epic #12709 and is not about changing the mechanism that translates Che commands into Theia tasks or launch (there is #12711 for that).

@azatsarynnyy
Copy link
Member

I think the goal attribute suits well for that purpose. Now there're Build, Run, Debug values are already used in Che's stacks.json.

@l0rd
Copy link
Contributor Author

l0rd commented Feb 20, 2019

I agree @azatsarynnyy. Now I have 2 questions:

  • How can we map that into a devfile?
  • Should we restrict the goals to launch/task (or task, run and debug) and provide a error/warning if a user use a goal that we do know how to translate in a theia context?

@slemeur @benoitf what do you think?

@benoitf
Copy link
Contributor

benoitf commented Feb 21, 2019

Hello, maybe instead of restricting we can say that there is a default mapping. Only Run and Debug are translated to a launch configuration, the other are considered as tasks.

For devfile

actions:
      - type: start

will be mapped to Run / Launch configuration

and exec type

- name: build
    actions:
      - type: exec
        tool: mvn-stack

to a task ?

@slemeur
Copy link
Contributor

slemeur commented Feb 21, 2019

It's a good suggestion to use the goal of the command and depending on that.

If I'm not mistaken, the command's goal now correspond to type in the devfile, correct? Are we handling a defined set of type, if yes, I have not find it in the documentation.

I like the suggestion from @benoitf.

@l0rd
Copy link
Contributor Author

l0rd commented Feb 21, 2019

I think we should allow only a defined set of goals.

If the user misspell a goal we should provide a warning. For example it would be an error if we translate goal: Ran or goal: Runn to a Theia task.

The other things that I find confusing is that goal: Run and goal: Debug has the same exact effect. For example a user will probably want to have in its devfile a command with goal: Run and another command with goal: Debug. But in Theia he will see that both commands can be run in Debug mode. That's weird no?

@gorkem
Copy link
Contributor

gorkem commented Feb 23, 2019

vscode has 'group's for tasks. I do not think this is supported on theia but it should be. groups allows vscode to identify a task as build or test. I think we should consider such a classification for commands on devfile as well.

    /**
     * Defines the group to which this task belongs. Also supports to mark
     * a task as the default task in a group.
     */
    group?: "build" | "test" | { kind: "build" | "test"; isDefault: boolean };

@sunix
Copy link
Contributor

sunix commented Feb 26, 2019

what about the goals Task and Launch ? instead of Run/Debug/Build/Test

@l0rd
Copy link
Contributor Author

l0rd commented Feb 27, 2019

@sunix yes that look like the simpler approach, and then we should have groups as @gorkem suggested. @benoitf are you ok with that?

@skabashnyuk
Copy link
Contributor

@l0rd can you provide some examples of how these commands will look like in devfile?

@skabashnyuk skabashnyuk added the status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering. label Mar 4, 2020
@skabashnyuk skabashnyuk added area/devfile-spec Issues related to Devfile v2 and removed area/devfile labels May 28, 2020
@l0rd l0rd added the area/editor/theia Issues related to the che-theia IDE of Che label Jul 30, 2020
@monaka
Copy link
Member

monaka commented Sep 1, 2020

@gorkem I checked it and the current che-theia supports group.

image

It will improve users' experience by supporting group.

@skabashnyuk IMO, it's enough just adding group object to commands.actions like this.

commands:
  - name: build
    actions:
      - workdir: '${CHE_PROJECTS_ROOT}/mruby'
        type: exec
        command: make
        component: workspace
        group: # Object. optional
          kind: build # String. required
          isDefault: false  # Boolean. optional. default = false

In this way, I suppose this can be added as the minor upgrade (like v1.1.0 ).

@che-bot
Copy link
Contributor

che-bot commented Mar 17, 2021

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 Mar 17, 2021
@che-bot che-bot closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues related to Devfile v2 area/editor/theia Issues related to the che-theia IDE of Che kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.
Projects
None yet
Development

No branches or pull requests