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

Navigating to ide link provided by workspace API does not open Theia IDE in Che 7 #12376

Closed
ibuziuk opened this issue Jan 10, 2019 · 11 comments
Closed
Labels
kind/bug Outline of a bug - must adhere to the bug report template. status/in-progress This issue has been taken by an engineer and is under active development.
Milestone

Comments

@ibuziuk
Copy link
Member

ibuziuk commented Jan 10, 2019

Once workspace is created a few links are exposed via workspace API e.g.

   "links":{  
      "self":"https://che.openshift.io/api/workspace/workspacet0gu6w16w0ldx1zd",
      "ide":"https://che.openshift.io/ibuziuk@redhat.com/wksp-d0fg",
      "environment/statusChannel":"wss://che.openshift.io/api/websocket",
      "environment/outputChannel":"wss://che.openshift.io/api/websocket"
   }

However, for workspaces created based on che7 stacks, navigating to ide link does not open Theia IDE:

image

NOTE: navigating to workspace via UD e.g. https://che.openshift.io/dashboard/#/ide/ibuziuk@redhat.com/wksp-d0fg works just fine since the url is edirect to workspace-loader app and it decides which IDE to load in this method https://github.com/eclipse/che/blob/master/workspace-loader/src/index.ts#L348

image

Currently, this issue prevents che-starter to support che7 for openshift.io flow since workspace startup fall back on ide link provided by workspace API.

More details can be found in redhat-developer/che-starter#323 (comment)

@ibuziuk ibuziuk added target/che7 kind/bug Outline of a bug - must adhere to the bug report template. labels Jan 10, 2019
@ibuziuk ibuziuk changed the title navigating to ide link provided by workspace API does not open Theia IDE in Che 7 Navigating to ide link provided by workspace API does not open Theia IDE in Che 7 Jan 10, 2019
@skabashnyuk
Copy link
Contributor

Talked with @vparfonov today about this issue. I think it is related to the way how we handle http://host/namespace/workspacename links in https://github.com/eclipse/che/search?q=IDEController&unscoped_q=IDEController

@ibuziuk
Copy link
Member Author

ibuziuk commented Jan 29, 2019

@vparfonov hi, could you please clarify if the issue planned to be fixed in 6.18.0 ?

@vparfonov
Copy link
Contributor

@ibuziuk Hi, yes work on it. Will be done on this week

@vparfonov vparfonov added this to the 6.19.0 milestone Feb 6, 2019
@ibuziuk
Copy link
Member Author

ibuziuk commented Feb 8, 2019

@vparfonov not sure I'm doing everything correct, but I can not find ide link in the GET /workspace for che 7 workspace:

[
  {
    "namespace": "che",
    "links": {},
    "config": {
      "defaultEnv": "default",
      "environments": {
        "default": {
          "recipe": {
            "contentType": "application/x-yaml",
            "type": "kubernetes",
            "content": "kind: List\nitems:\n - \n  apiVersion: v1\n  kind: Pod\n  metadata:\n   name: ws\n  spec:\n   containers:\n    - \n     image: 'eclipse/che-dev:nightly'\n     name: dev\n     resources:\n      limits:\n       memory: 512Mi\n"
          },
          "machines": {
            "ws/dev": {
              "volumes": {
                "projects": {
                  "path": "/projects"
                }
              },
              "installers": [],
              "env": {},
              "servers": {},
              "attributes": {
                "memoryLimitBytes": "536870912"
              }
            }
          }
        }
      },
      "projects": [
        {
          "description": "A hello world Java application.",
          "source": {
            "location": "https://github.com/che-samples/console-java-simple.git",
            "type": "git",
            "parameters": {}
          },
          "links": [],
          "problems": [],
          "mixins": [],
          "name": "console-java-simple",
          "type": "maven",
          "path": "/console-java-simple",
          "attributes": {
            "language": [
              "java"
            ]
          }
        }
      ],
      "commands": [
        {
          "commandLine": "mvn -f ${current.project.path} clean install",
          "name": "console-java-simple:build",
          "type": "mvn",
          "attributes": {
            "goal": "Build",
            "previewUrl": ""
          }
        },
        {
          "commandLine": "mvn -f ${current.project.path} clean install \njava -jar ${current.project.path}/target/*.jar",
          "name": "console-java-simple:run",
          "type": "mvn",
          "attributes": {
            "goal": "Run",
            "previewUrl": ""
          }
        }
      ],
      "name": "wksp-tecj",
      "attributes": {
        "editor": "org.eclipse.che.editor.theia:1.0.0",
        "plugins": "che-machine-exec-plugin:0.0.1"
      },
      "links": []
    },
    "status": "STOPPED",
    "temporary": false,
    "id": "workspacekiflnbnct799hr1x",
    "attributes": {
      "org.eclipse.che.runtimes_id": "runtimesoz72dz3yks5wkvai",
      "stopped": "1549627921147",
      "created": "1549625018493",
      "stoppedAbnormally": "false",
      "stackId": "che7-preview",
      "updated": "1549625201096"
    }
  }
]

@benoitf
Copy link
Contributor

benoitf commented Feb 8, 2019

@ibuziuk and on a RUNNING workspace ?

@ibuziuk
Copy link
Member Author

ibuziuk commented Feb 8, 2019

@benoitf could you please clarify why should it matter? I would expect that links would be available regardless of the workspace state (otherwise it will not work for openshift.io flow)

@ibuziuk
Copy link
Member Author

ibuziuk commented Feb 8, 2019

links for running che 7 workspace seems to be also missing:

[
  {
    "namespace": "che",
    "links": {},
    "config": {
      "defaultEnv": "default",
      "environments": {
        "default": {
          "recipe": {
            "contentType": "application/x-yaml",
            "type": "kubernetes",
            "content": "kind: List\nitems:\n - \n  apiVersion: v1\n  kind: Pod\n  metadata:\n   name: ws\n  spec:\n   containers:\n    - \n     image: 'eclipse/che-dev:nightly'\n     name: dev\n     resources:\n      limits:\n       memory: 512Mi\n"
          },
          "machines": {
            "ws/dev": {
              "volumes": {
                "projects": {
                  "path": "/projects"
                }
              },
              "installers": [],
              "env": {},
              "servers": {},
              "attributes": {
                "memoryLimitBytes": "536870912"
              }
            }
          }
        }
      },
      "projects": [
        {
          "description": "A hello world Java application.",
          "source": {
            "location": "https://github.com/che-samples/console-java-simple.git",
            "type": "git",
            "parameters": {}
          },
          "links": [],
          "problems": [],
          "mixins": [],
          "name": "console-java-simple",
          "type": "maven",
          "path": "/console-java-simple",
          "attributes": {
            "language": [
              "java"
            ]
          }
        }
      ],
      "commands": [
        {
          "commandLine": "mvn -f ${current.project.path} clean install",
          "name": "console-java-simple:build",
          "type": "mvn",
          "attributes": {
            "goal": "Build",
            "previewUrl": ""
          }
        },
        {
          "commandLine": "mvn -f ${current.project.path} clean install \njava -jar ${current.project.path}/target/*.jar",
          "name": "console-java-simple:run",
          "type": "mvn",
          "attributes": {
            "goal": "Run",
            "previewUrl": ""
          }
        }
      ],
      "name": "wksp-tecj",
      "attributes": {
        "editor": "org.eclipse.che.editor.theia:1.0.0",
        "plugins": "che-machine-exec-plugin:0.0.1"
      },
      "links": []
    },
    "status": "RUNNING",
    "temporary": false,
    "id": "workspacekiflnbnct799hr1x",
    "attributes": {
      "org.eclipse.che.runtimes_id": "runtimesoz72dz3yks5wkvai",
      "updated": "1549642673199",
      "created": "1549625018493",
      "stackId": "che7-preview"
    }
  }
]

@benoitf
Copy link
Contributor

benoitf commented Feb 8, 2019

@ibuziuk you should use /workspace/<workspace-id> (/workspace is not giving these details)

@benoitf
Copy link
Contributor

benoitf commented Feb 8, 2019

@ibuziuk and some links are only available when a workspace is running (didn't check for ide)

@ibuziuk
Copy link
Member Author

ibuziuk commented Feb 8, 2019

you should use /workspace/<workspace-id> (/workspace is not giving these details)

@benoitf hmm.. interesting was it always like that or. smth. have changed in API recently ?

@ibuziuk
Copy link
Member Author

ibuziuk commented Feb 8, 2019

ok seems that ide link presents in the response even for stopped workspace and navigating to it start che 7 workspace. All looks good - thanks @vparfonov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. status/in-progress This issue has been taken by an engineer and is under active development.
Projects
None yet
Development

No branches or pull requests

4 participants