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

Can not invoke Task if source is che #14254

Closed
gorkem opened this issue Aug 15, 2019 · 7 comments
Closed

Can not invoke Task if source is che #14254

gorkem opened this issue Aug 15, 2019 · 7 comments
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/next

Comments

@gorkem
Copy link
Contributor

gorkem commented Aug 15, 2019

If I have a task defined on tasks.json with source defined as che, it can not be started from Command palette. I can see a message printed on JS Console as ERROR Can't get task launch configuration for label: echo me

If I remove the source property from the following example task I can start the task without issues.

 {
            "label": "echo me",
            "source": "che",
            "type": "process",
            "command": "echo test",
            "target": {
                "machineName": "theia-idemh5"
            }
   }
@gorkem gorkem added kind/bug Outline of a bug - must adhere to the bug report template. team/ide labels Aug 15, 2019
@gorkem gorkem changed the title Can not invoke Task of source is che Can not invoke Task if source is che Aug 15, 2019
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 15, 2019
@tsmaeder tsmaeder added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Aug 16, 2019
@tsmaeder
Copy link
Contributor

P2, because easy workaround.

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 16, 2019
@RomanNikitenko
Copy link
Member

RomanNikitenko commented Aug 16, 2019

Should be fixed by eclipse-che/che-theia#295 for tasks from devfile, but I''ll check for the configuration from the description of the issue.

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Aug 16, 2019

  • Theia runs tasks using the runner registered for the specified Task type or a default Task Runner if runner is not found for the task type.
    We register own runner to have ability to run tasks with type che. Our runner can run a task in a defined container.
  • source - according to the doc - for a configured task it is the name of the root folder, while for a detected task, it is the name of the provider.

So for the task which we want to run using our runner in the specific container we should use "type": "che" and don't define source - the configuration is placed in config file, so source - is the name of the root folder and theia add source when reads the configuration from tasks.json file.

I added sleep 2 to the command as workaround for the issue. Please replace machineName for the correct value to test it. I saw in another issue your idea about mapping component to a container - thank you very much - I'll try it.

        {
            "label": "echo me",
            "type": "che",
            "command": "sleep 2 && echo test",
            "target": {
                "machineName": "theia-ide77o"
            }
        }

@gorkem
Copy link
Contributor Author

gorkem commented Aug 16, 2019

@RomanNikitenko Is there a way we can omit source property when we carry a che provided task to task.json when we do a Configure Task command?

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Aug 16, 2019

For 7.0.0 we consider che tasks as configured, not as detected:

  • we convert che commands from devfile to theia tasks format and copy them to tasks.json file of current workspace folder.

So user doesn't need to use Configure task action for che tasks. User can find all che tasks in
tasks.json file, edit them or add a new task.

tasks.json file can be open:

  • manually
  • by clicking cog icon (configure task action) from the Terminal > Run Task menu option
  • from the Terminal > Configure Tasks menu

For detected task it opens tasks.json file and copies the configuration, but for configured one - just opens tasks.json file (config file already contains the configuration).

For master branch we have the corresponding PR. After merge the PR the behavior is the same as I described for 7.0.0.

@rhopp rhopp removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 19, 2019
@azatsarynnyy
Copy link
Member

azatsarynnyy commented Aug 29, 2019

@RomanNikitenko could you please check if it's already fixed and whether we can close that issue

@RomanNikitenko
Copy link
Member

Since the PR eclipse-che/che-theia#295 was merged we consider che tasks as configured, not as detected.
User doesn't need to use Configure task action for che tasks: we convert che commands from devfile to theia tasks format and copy them to tasks.json file.

So I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/next
Projects
None yet
Development

No branches or pull requests

7 participants