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

Support the Devfile Composite Commands in VS Code #21859

Open
azatsarynnyy opened this issue Dec 2, 2022 · 8 comments
Open

Support the Devfile Composite Commands in VS Code #21859

azatsarynnyy opened this issue Dec 2, 2022 · 8 comments
Assignees
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.

Comments

@azatsarynnyy
Copy link
Member

Is your enhancement related to a problem? Please describe

Devfile has a notion of Composite Commands. It allows connecting multiple Commands together by defining a single Composite Command. E.g.:

commands:
  - id: package
    exec:
      component: tools
      commandLine: 'mvn package'
      group:
        kind: build
  - id: install
    exec:
      component: tools
      commandLine: 'mvn install'
      group:
        kind: build
        isDefault: true
  - id: installAndPackage
    composite:
      commands:
        - install
        - package
      parallel: false

Currently, VS Code editor in Che doesn't support the Devfile Composite Commands. So, the user isn't able to use them in any way.

Describe the solution you'd like

VS Code has a notion of the Compound Tasks which we can rely on when translating the Devfile's Composite Commands.
The example above can be translated to something like:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "package",
      "command": "mvn",
      "args": ["package"]
    },
    {
      "label": "Install",
      "command": "mvn",
      "args": ["install"]
    },
    {
      "label": "installAndPackage",
      "dependsOn": ["package", "Install"]
    }
  ]
}

Describe alternatives you've considered

No response

Additional context

No response

@azatsarynnyy azatsarynnyy added kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. team/editors area/editor/vscode Issues related to the Code OSS editor of Che labels Dec 2, 2022
@azatsarynnyy
Copy link
Member Author

The main challenge here is that the VS Code Extension Task API doesn't allow the extensions to provide the Compound Tasks. We need to find a different way how we can provide the Compound Tasks to VS Code.

One of the options is creating the tasks.json directly from our extension. A big drawback of such an approach is that it requires additional functionality to keep both definitions in sync: Devfile Composite Command and VS Code Compound Task. That would add much more complexity to the system which is undesirable, of course.

This was referenced Mar 8, 2023
@RomanNikitenko
Copy link
Member

RomanNikitenko commented Mar 20, 2023

I investigated a little the problem:

  • we provide devfile commands as VS Code tasks using TaskProvider entity
  • I debugged source code and found that dependsOn property is ignored on the VS Code side for tasks which come from TaskProvider - so Artem is right that VS Code Task API doesn't support compound tasks
  • as a solution - we could provide devfile commands as User level VS Code tasks
  • moving devfile tasks on the User level could bring not only support of compound devfile tasks, but also an ability to edit them directly from IDE
  • the problem is: only shell and process VS Code tasks are supported on the User level. At the same time we use CustomExecution (to use machine-exec).
  • anyway it would be nice to have an ability to edit devfile tasks directly from IDE. At the moment Che-Code allows to apply configure action for the devfile tasks, so it's possible to edit a task (by editing tasks.json file), but the task fails when user runs it:
edit_devfile_task.mp4

I guess that we don't consider providing devfile commands as configured VS Code tasks (tasks.json usage), so at the moment I don't see a good way to support compound devfile commands.
About an ability to edit devifle commands directly from IDE - we could consider editing them directly in the devfile and watching changes to apply them.

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Mar 20, 2023

We discussed this problem within our meeting today and @l0rd suggested the following idea:

  • there is converting devfile commands to VS Code tasks step
  • we could filter devfile composite commands at that ^^ step and form a command field for the corresponding VS Code task.

@che-bot
Copy link
Contributor

che-bot commented Sep 16, 2023

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 Sep 16, 2023
@ahussey-redhat
Copy link

/remove-lifecycle stale

@ahussey-redhat
Copy link

Is there anything you need from me?

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 16, 2023
@che-bot
Copy link
Contributor

che-bot commented Mar 14, 2024

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 14, 2024
@ahussey-redhat
Copy link

/remove-lifecycle stale

@l0rd l0rd removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 14, 2024
@ibuziuk ibuziuk self-assigned this May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.
Development

No branches or pull requests

7 participants