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

Task: Changing a command in the devfile of an existing workspace is not taken in account #13994

Closed
5 of 23 tasks
sunix opened this issue Jul 24, 2019 · 11 comments
Closed
5 of 23 tasks
Labels
area/plugins kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@sunix
Copy link
Contributor

sunix commented Jul 24, 2019

Describe the bug

Changing any of the devfile commands of an existing (and started) workspace from the dashboard is not affecting the workspace (even after restart).

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. start a workspace with this devfile containing a command that would run on a plugin side car container. For instance:

     $ chectl workspace:start -f <(chectl devfile:generate --name=test-task-change-devfile --dockerimage=sunix/git-devtools --command="echo hello world")
       ✔ Retrieving Che Server URL...http://che-che.192.168.39.13.nip.io
       ✔ Verify if Che server is running...RUNNING (auth disabled)
       ✔ Create workspace from Devfile /dev/fd/63
     
     Workspace IDE URL:
     http://che-che.192.168.39.13.nip.io/dashboard/#/ide/che/test-task-change-devfile
    apiVersion: 1.0.0
    metadata:
      name: test-task-change-devfile
    components:
      - alias: sunix-git-devtools
        type: dockerimage
        image: sunix/git-devtools
        memoryLimit: 512M
        mountSources: true
        command:
          - tail
        args:
          - '-f'
          - /dev/null
    commands:
      - name: echo hello world
        actions:
          - type: exec
            command: echo hello world
            component: sunix-git-devtools
            workdir: /projects/
  2. open the workspace and execute the task: it works well
    Eclipse Che | test-task-change-devfile - Google Chrome_361

  3. stop the workspace

  4. go to the dashboard and edit the devfile. Change the command to display 'hello che world'
    Selection_362

  5. restart the workspace

  6. rerun the task. It is displaying 'hello world' and not 'hello che world'
    Eclipse Che | test-task-change-devfile - Google Chrome_363

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Installation method

  • chectl
  • che-operator
  • minishift-addon
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify

Additional context

@sunix sunix added kind/bug Outline of a bug - must adhere to the bug report template. area/editor/theia Issues related to the che-theia IDE of Che area/devfile labels Jul 24, 2019
@RomanNikitenko
Copy link
Member

  • We have tasks in a devfie, they are copied to a config file when workspace is started.
  • User can edit the tasks in a config file and the changes are applied for execution in runtime
  • We have conflict if user doesn't change the label for the task - we have one task from devfile and one from config file with the same label.
  • I proposed to add some prefix if we have conflict, and it was another opinion to avoid prefixing
  • At the moment the tasks from tasks.json file have higher priority than tasks from devfile (because user working in the running workspace and if he changes some args for command it's expected to execute this configuration from tasks.json file, not origin task from devfile)

I think the issue can be fixed when we provide synchronization for config file and devfile.
At the moment as workaround user can edit label for the task which he customized.

@sunix
Copy link
Contributor Author

sunix commented Jul 24, 2019

There is no conflict, changes on tasks.json should be applied to the devfile (synch). Don't spend time to resolve the conflicts.
For the moment we expect that devfile changes override tasks.json at every start. I would say that as long as we don't have the synch back, devfile should win over the tasks.json.

@RomanNikitenko
Copy link
Member

Do we have ability to recognize on plugin side - is it workspace start/restart or user is refreshing a page?

@sunix
Copy link
Contributor Author

sunix commented Jul 24, 2019

https://github.com/eclipse/che-theia/blob/master/plugins/factory-plugin/src/factory-plugin.ts#L17

export async function start(context: theia.PluginContext) {

is invoked at every browser refresh.

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

RomanNikitenko commented Jul 24, 2019

https://github.com/eclipse/che-theia/blob/master/plugins/factory-plugin/src/factory-plugin.ts#L17

export async function start(context: theia.PluginContext) {

is invoked at every browser refresh.

Yes, and the same is invoked when workspace has started.
Correct?

So do you mean that devfile changes override tasks.json at every browser refresh?
Or we have ability to recognize on plugin side the difference between browser refresh and start/restart of a workspace

@sunix
Copy link
Contributor Author

sunix commented Jul 24, 2019

I would behave like if synchronisation were implemented.

@vzhukovs
Copy link
Contributor

changes on tasks.json should be applied to the devfile

Even if user adds own custom task? Should it be reflected in devfile?

@sunix
Copy link
Contributor Author

sunix commented Jul 24, 2019

changes on tasks.json should be applied to the devfile

Even if user adds own custom task? Should it be reflected in devfile?

I would say yes if synchronisation is implemented

@azatsarynnyy
Copy link
Member

setting area/plugins as it looks like related to https://github.com/eclipse/che-theia/tree/master/plugins/task-plugin

@tsmaeder
Copy link
Contributor

tsmaeder commented May 6, 2020

This should be addressed by my work on #15540

@che-bot
Copy link
Contributor

che-bot commented Jan 4, 2021

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 Jan 4, 2021
@che-bot che-bot closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

9 participants