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

feat: Add 'Restart From Local Devfile' action #185

Merged

Conversation

RomanNikitenko
Copy link
Contributor

@RomanNikitenko RomanNikitenko commented Mar 3, 2023

What does this PR do?

Add 'Restart From Local Devfile' action

Screenshot 2023-03-06 at 13 06 47

What issues does this PR fix?

eclipse-che/che#18670

How to test this PR?

  • provide some changes to a devfile
  • use Restart From Local devfile action of the Eclipse Che status bar item to restart a workspace
  • check that the changes are applied when the workspace is started

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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

Copy link
Member

@azatsarynnyy azatsarynnyy left a comment

Choose a reason for hiding this comment

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

I tested it by changing the command's ID in the devfile.yaml.
After restarting the DevWorkspace with a new command, the changes were applied to the DW.

@RomanNikitenko
Copy link
Contributor Author

I've added a new commit to improve handling errors at Restart Workspace From Local Devfile action. For example, we should not restart a workspace if there is an error at the updating devfile step.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

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

@RomanNikitenko RomanNikitenko merged commit 5d1e16e into che-incubator:main Mar 8, 2023
@RomanNikitenko RomanNikitenko deleted the restartFromLocalDevfile branch March 8, 2023 14:20
@devstudio-release
Copy link

Build 3.6 :: code_3.x/452: Console, Changes, Git Data

@devstudio-release
Copy link

@@ -4,5 +4,6 @@
"openDocumentationCommand": "Eclipse Che: Open Documentation",
"openDashboardCommand": "Eclipse Che: Open Dashboard",
"stopWorkspaceCommand": "Eclipse Che: Stop Workspace",
"restartWorkspaceCommand": "Eclipse Che: Restart Workspace"
"restartWorkspaceCommand": "Eclipse Che: Restart Workspace",
"restartWorkspaceFromLocalDevfileCommand": "Eclipse Che: Restart Workspace From Local Devfile"
Copy link

Choose a reason for hiding this comment

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

Ideally, the preposition would not be capitalized:

"Eclipse Che: Restart Workspace from Local Devfile"

newContent.devWorkspace.spec!.template!.projects = projects;
await devfileService.updateDevfile(newContent.devWorkspace.spec?.template);
} else {
throw new Error('An error occurred while performing generation a new devfile context');
Copy link

Choose a reason for hiding this comment

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

->

An error occurred while generating new devfile context

}

if (!devfileExists) {
throw new Error(`The devfile was not found by path: ${devfilePath}`);
Copy link

Choose a reason for hiding this comment

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

->

The devfile was not found at:

@RomanNikitenko
Copy link
Contributor Author

@rkratky
thank you, Robert, for the review!
I've applied your suggestions within another PR: #189

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.

5 participants