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

Devfile Commands support #46

Merged
merged 5 commits into from
Jun 2, 2022
Merged

Devfile Commands support #46

merged 5 commits into from
Jun 2, 2022

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented May 13, 2022

Signed-off-by: Artem Zatsarynnyi [email protected]

The PR adds the Che-Commands extension. It detects the Commands defined in a Devfile and represents them as VS Code Tasks. The environment variables substitution is supported for the exec.workingDir property.

The PR closes eclipse-che/che#21030

How to test

  1. Spin up a DevWorkspace using the following link:
    https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/#https://github.com/azatsarynnyy/java-spring-petclinic/tree/devfilev2
  2. In the command palette type a task shortcut and choose a che task type.
  3. Run prepare-database command. It's running in the mariadb component. See the output.
  4. Run maven-build command. It's running in the tools component. See the output.

che-code-task

@github-actions

This comment was marked as outdated.

9 similar comments
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

2 similar comments
@github-actions

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-46-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-46-dev-amd64

@azatsarynnyy azatsarynnyy changed the title [WIP] Running the Devfile Commands support Running the Devfile Commands support Jun 1, 2022
@azatsarynnyy azatsarynnyy marked this pull request as ready for review June 1, 2022 19:10
@azatsarynnyy azatsarynnyy changed the title Running the Devfile Commands support Devfile Commands support Jun 1, 2022
@benoitf
Copy link
Contributor

benoitf commented Jun 2, 2022

Code looks good but I'm not able to test on the dogfooding instance (not related to this PR)


command = command + ` --component ${component}`;
const execution = new vscode.ShellExecution(command, { cwd: expandEnvVariables(workdir) });
const task = new vscode.Task(kind, vscode.TaskScope.Workspace, name, 'eclipse-che.commands', execution);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably it makes sense to use a short type for che commands
but up to you
Screenshot 2022-06-02 at 17 56 02

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
Actually, it's not a task type, but a task source. I don't know what this string affects except this list. The documentation just says Is presented in the user interface.
Usually, an extension's publisher and name are used there, exactly how it's defined in the extension's package.json.
I've shortened it to che. Just pushed. Let's see how it looks and works, once the PR image is ready.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, it looks much better:
image

@RomanNikitenko
Copy link
Contributor

RomanNikitenko commented Jun 2, 2022

Is it expected to have an ability to edit che task configurations at the current step of an implementation?

I'm asking because I tried to do it and found that it's impossible to execute a configured che task.
So, I applied Configure Task action and changed just a value for the command field.
I get There is no task provider registered for task of type che notification at running the task.

Screen.Recording.2022-06-02.at.18.23.49.mov

Screenshot 2022-06-02 at 18 40 00

@azatsarynnyy
Copy link
Member Author

Is it expected to have an ability to edit che task configurations at the current step of an implementation?

No. Currently, just running a task detected in the user's Devfile.

@github-actions
Copy link

github-actions bot commented Jun 2, 2022

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-46-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-46-dev-amd64

@azatsarynnyy
Copy link
Member Author

Thank you @RomanNikitenko for your review and testing.

@azatsarynnyy azatsarynnyy merged commit 6380441 into che-incubator:main Jun 2, 2022
@azatsarynnyy azatsarynnyy deleted the devfile-cmd branch June 2, 2022 18:45
@che-bot che-bot added this to the 7.48 milestone Jun 2, 2022
@azatsarynnyy azatsarynnyy modified the milestones: 7.48, 7.49 Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Devfile commands in Che-Code
5 participants