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

Projects are not synced to the devfile clonePath #2741

Closed
rajivnathan opened this issue Mar 20, 2020 · 4 comments · Fixed by #2747
Closed

Projects are not synced to the devfile clonePath #2741

rajivnathan opened this issue Mar 20, 2020 · 4 comments · Fixed by #2747
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug.
Projects

Comments

@rajivnathan
Copy link
Contributor

/kind bug
/area devfile

What versions of software are you using?

Using odo experimental support for devfiles by building from source

Description of the problem

Devfile sync doesn't currently handle the clonePath field that's used by some devfiles. eg. https://github.com/eclipse/che-devfile-registry/blob/5a41b4b0c85893a6ee99059fcceab35b8a71780c/devfiles/go/devfile.yaml#L11

Actual behavior

The source is synced to /projects

Expected behavior

The source should be synced to /projects/src/github.com/golang/example/ which is what Che does.

Any logs, error output, etc?

No errors for the sync, but errors result when trying to use commands because they're expecting the source to be under the clonePath directory.

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels Mar 20, 2020
@johnmcollier
Copy link
Member

/assign

This should be an easy one to fix, we'll adapt how we handle syncing when a project is defined in the devfile:

  • If clonePath is set, we'll sync to /projects/<clonePath>
  • If clonePath is not set, we'll sync to /projects/<projectName>, as before.

@rajivnathan
Copy link
Contributor Author

rajivnathan commented Mar 21, 2020

There also seems to be a sparseCheckoutDir property used by the quarkus devfile. See https://github.com/eclipse/che-devfile-registry/blob/5a41b4b0c85893a6ee99059fcceab35b8a71780c/devfiles/quarkus/devfile.yaml#L11

There are more properties for source, see https://github.com/redhat-developer/devfile/blob/master/docs/devfile.md#source-type

Not sure whether we need to handle them but worth vetting them.

@johnmcollier
Copy link
Member

As discussed on Slack, we won't need sparseCheckoutDir for file syncing, as it just determines which folder in the Git repo to pull down.

We will need it however for template/resource creation, so I've added it as an item in #2582

@elsony elsony added this to For consideration in Sprint 181 via automation Mar 25, 2020
@elsony elsony moved this from For consideration to In progress in Sprint 181 Mar 25, 2020
@kadel
Copy link
Member

kadel commented Mar 26, 2020

This should be an easy one to fix, we'll adapt how we handle syncing when a project is defined in the devfile:

  • If clonePath is set, we'll sync to /projects/<clonePath>
  • If clonePath is not set, we'll sync to /projects/<projectName>, as before.

It looks a bit weird, but I don't think that we can't do much better than this as we currently don't support multiple projects in devfile anyway

so +1

@elsony elsony moved this from In progress to For review in Sprint 181 Mar 26, 2020
Sprint 181 automation moved this from For review to Done Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug.
Projects
No open projects
Sprint 181
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants