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

Allowing users to update the workspace if they edit the project devfile in VS Code #18670

Closed
l0rd opened this issue Dec 18, 2020 · 14 comments
Closed
Assignees
Labels
area/editor/vscode Issues related to the Code OSS editor of Che engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording
Milestone

Comments

@l0rd
Copy link
Contributor

l0rd commented Dec 18, 2020

Is your enhancement related to a problem? Please describe.

When editing a project devfile in VS Code, the workspace doesn’t get updated automatically.

Describe the solution you'd like

VS Code should watch for changes (including creation or deletion) of devfile.yaml and .devfile.yaml and when it happens propose to the user:

You have made some changes to this repository's devfile.
Do you want to apply them and restart your development environment?

                      || Restart || Continue Editing || Don't Ask again ||

Note: to update the DevWorkspace VS Code should use the devworkspace-generator library

@l0rd l0rd added kind/enhancement A feature request - must adhere to the feature request template. kind/epic A long-lived, PM-driven feature request. Must include a checklist of items that must be completed. labels Dec 18, 2020
@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 Dec 18, 2020
@l0rd l0rd added engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. area/editor/theia Issues related to the che-theia IDE of Che and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Dec 20, 2020
@azatsarynnyy azatsarynnyy mentioned this issue Mar 18, 2021
12 tasks
@azatsarynnyy azatsarynnyy self-assigned this Mar 24, 2021
@l0rd l0rd added the roadmap/3-months Epics that are planned to complete in the short term (within 3 months) label Mar 26, 2021
@sympatheticmoose sympatheticmoose added the new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes label Mar 29, 2021
@l0rd l0rd changed the title Che-Theia should detect and apply local devfile changes Synchronize changes between local devfile and workspace configuration in Che-Theia editor Mar 29, 2021
@l0rd l0rd added roadmap/6-months Epics that are planned to complete in the medium term (within 6 months) and removed roadmap/3-months Epics that are planned to complete in the short term (within 3 months) labels Mar 29, 2021
@azatsarynnyy azatsarynnyy mentioned this issue Apr 9, 2021
8 tasks
@azatsarynnyy azatsarynnyy mentioned this issue May 20, 2021
14 tasks
@azatsarynnyy azatsarynnyy mentioned this issue Jun 10, 2021
10 tasks
@l0rd l0rd mentioned this issue Jan 25, 2023
32 tasks
@l0rd l0rd added sprint/current and removed roadmap/6-months Epics that are planned to complete in the medium term (within 6 months) labels Jan 27, 2023
@vitaliy-guliy
Copy link
Contributor

I'm thinking about having some kind of rollback in case the user mistype something.
Being able to edit the devfile via dashboard is good option, but what would be much better - is to store current DevWorkspace object somewhere before applying changes.

@RomanNikitenko
Copy link
Member

I'm thinking about having some kind of rollback in case the user mistype something. Being able to edit the devfile via dashboard is good option, but what would be much better - is to store current DevWorkspace object somewhere before applying changes.

I think we should implement it as simple as possible first, then we can improve the behaviour step by step.

@azatsarynnyy
Copy link
Member

As we now have the VS Code command for restarting a DevWorkspace, the next step we can add to this UX is checking if the user's Devfile was modified.

If it was, the user could be prompted to restart the DevWorkspce in one of the two modes:

  • regular restart (ignoring the Devfile changes)
  • restart with applying the Devfile changes (replacing the DevWorkspace template)

WDYT?

@l0rd
Copy link
Contributor Author

l0rd commented Feb 10, 2023

@azatsarynnyy 👍

For confirmation: this is not about adding a file watcher mechanism and it's not about prompting the user when he edits the file right?

And maybe, to avoid making "restart" too smart, we could initially add a separate "restart from local devfile" action.

@azatsarynnyy
Copy link
Member

For confirmation: this is not about adding a file watcher mechanism and it's not about prompting the user when he edits the file right?

That's correct.

And maybe, to avoid making "restart" too smart, we could initially add a separate "restart from local devfile" action.

+1

@RomanNikitenko
Copy link
Member

I use DevWorkspace Generator library to generate new content based on the devfile changes.
At the moment it's possible to pass editor description as a content or as a path on file system to generate DevfileContext.
I created a PR to add an ability to pass a URL of yaml file as editor description (see here).

It helps to generate a new DevfileContext when contributions has uri field with the reference to editor description:

image

But it's still unclear for me how to get editor description on a VS Code extension side when contributions comes without uri:

image

@RomanNikitenko
Copy link
Member

RomanNikitenko commented Mar 8, 2023

I've added an ability to apply devfile changes and restart a workspace by using Restart Wrokspace From Local Devfile action. The corresponding PR was merged today.

@l0rd @azatsarynnyy
Do we still consider to add a file watcher, track devfile and display the notification as it's described in the issue?
I don't mind - just to confirm it.

I'm concerned a little how to avoid annoying behaviour.
Let's consider as an example:

  • user is editing a devfile
  • user stopped to edit for 2 seconds(actually - what time we should use here?), but he/she is going to continue edit it
  • the notification is displayed
  • user select Continue editing and starts to edit again
  • the pause for few seconds leads to displaying the notification again

Yes, I know that there is Don't Ask Again option, but then maybe it makes sense to display another notification, like It's possible to apply your changes using Restart Workspace From Local Devfile action from command palette. Maybe user selects Continue editing because he/she doesn't know another way to restart a workspace except click on the Restart option on the notification directly...

@azatsarynnyy
Copy link
Member

@RomanNikitenko see the comment above: #18670 (comment)

I believe the work is done and we can close this issue.

@l0rd l0rd closed this as completed Mar 8, 2023
@azatsarynnyy azatsarynnyy added this to the 7.62 milestone Mar 8, 2023
@l0rd l0rd changed the title Propose to users to update the workspace if they edit the project devfile from VS Code Allowing users to update the workspace if they edit the project devfile in VS Code Mar 9, 2023
@l0rd l0rd added new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording labels Mar 9, 2023
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 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording
Projects
None yet
Development

No branches or pull requests

10 participants