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

Project is not imported when using devfile v2 factory flow #19371

Closed
l0rd opened this issue Mar 23, 2021 · 2 comments · Fixed by eclipse-che/che-dashboard#264
Closed

Project is not imported when using devfile v2 factory flow #19371

l0rd opened this issue Mar 23, 2021 · 2 comments · Fixed by eclipse-che/che-dashboard#264
Assignees
Labels
engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current
Milestone

Comments

@l0rd
Copy link
Contributor

l0rd commented Mar 23, 2021

Describe the bug

When I try to start a workspace (using a factory link that points to a devfile v2.0.0) the project source code is not cloned.

Note that the v2 devfile I have used doesn't have an explicit project.

In fact the DevWorkspace resource doesn't have projects:

k get devworkspace spring-petclinic -o json | jq .spec.template
{
  "components": [
    {
      "container": {
        "env": [
          {
            "name": "ENV_VAR",
            "value": "value"
          }
        ],
        "image": "quay.io/eclipse/che-java8-maven:nightly",
        "memoryLimit": "1536M",
        "sourceMapping": "/projects",
        "volumeMounts": [
          {
            "name": "mavenrepo",
            "path": "/root/.m2"
          }
        ]
      },
      "name": "maven"
    },
    {
      "name": "mavenrepo",
      "volume": {
        "size": "1G"
      }
    },
    {
      "name": "theia-ide-workspace1b393472f4684f0b",
      "plugin": {
        "kubernetes": {
          "name": "theia-ide-workspace1b393472f4684f0b",
          "namespace": "l0rd-che"
        }
      }
    }
  ]
}

Che version

Nightly

Steps to reproduce

Deploy Che, on OpenShift, with devworkspace support enabled

$ cat patch.yaml
spec:
  devWorkspace:
    enable: true
$ chectl server:deploy --che-operator-cr-patch-yaml=patch.yaml \
                     -p openshift --no-olm-suggested-namespace \
                     -n workspaces-server

Open a factory link

open ${CHE_URL}/#https://github.com/l0rd/spring-petclinic/tree/devfile2  # <== devfile v2.0.0 

Expected behavior

I would expect the source code from https://github.com/l0rd/spring-petclinic/tree/devfile2 to be cloned in my workspace.

Runtime

OpenShift 4.7.1

Installation method

chectl/0.0.20210322-next.99b0d8c darwin-x64 node-v12.21.0

Environment

OpenShift dev cluster

@l0rd l0rd added the kind/bug Outline of a bug - must adhere to the bug report template. label Mar 23, 2021
@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 Mar 23, 2021
@l0rd l0rd added area/devworkspace-client engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Mar 23, 2021
@l0rd l0rd mentioned this issue Apr 8, 2021
29 tasks
@l0rd l0rd added the new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes label May 7, 2021
@l0rd
Copy link
Contributor Author

l0rd commented May 11, 2021

We had a call this morning about this issue and about what component should "resolve" the project in the devfile:

Che server doesn't have any notion of the devfile v2 model so it's not ideal to update the project section there.

OTOH dashboard is not able to resolve the factory link into a git repository URI, branch and other informations required to generate the project section of the devfile.

So we agreed that:

  • che-server API should return the git repo details along with original devfile content
  • the update of the original devfile object to contain the project details should be done on the dashboard side

@sleshchenko
Copy link
Member

sleshchenko commented May 31, 2021

Che Server already provides information about scm repo, like repo location, branch.
Dashboard can start using it eclipse-che/che-server#5 to inject project if it's not specified.
Example of project devfile v2 with branch specified:

    projects:
      - name: devworkspace-operator
        git:
          checkoutFrom:
            remote: origin
            revision: clone-projects-on-start
          remotes:
            origin: "https://github.com/devfile/devworkspace-operator.git"

@sleshchenko sleshchenko added this to the 7.32 milestone May 31, 2021
@sympatheticmoose sympatheticmoose removed the new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants