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

Upgrade Go version to support realworld sample #13803

Closed
sparkoo opened this issue Jul 9, 2019 · 16 comments
Closed

Upgrade Go version to support realworld sample #13803

sparkoo opened this issue Jul 9, 2019 · 16 comments
Assignees
Labels
area/devfile-registry kind/enhancement A feature request - must adhere to the feature request template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.
Milestone

Comments

@sparkoo
Copy link
Member

sparkoo commented Jul 9, 2019

Description

According to #13529, we would like to have https://github.com/xesina/golang-echo-realworld-example-app as a Go sample project. There is an issue with Go versions as the project uses modules, thus needs Go v1.11+. However, our Che Go plugin uses v1.10.7.

Currently I can think of several options for us:

We should decide what way to go and whether we want this in 7.0.0 GA

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 9, 2019

So what is the issue that is happening? What does not work?

@benoitf
Copy link
Contributor

benoitf commented Jul 9, 2019

@tsmaeder I think it's pretty well explained. it's using go modules that are not available in go 1.10 but 1.11 and afterwards
https://blog.golang.org/using-go-modules

@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 9, 2019

Yes, but what are the consequences? Does code assist not work? Do we have unexpected errors in the editor?

@sparkoo
Copy link
Member Author

sparkoo commented Jul 9, 2019

I'm not sure exactly. I guess project won't compile at all (https://travis-ci.org/xesina/golang-echo-realworld-example-app/builds/531131833?utm_source=github_status&utm_medium=notification).
AFAIK no work-in-progress devfile exists and I haven't tried it yet. I'm taking this over @metlos so this is just what I've already found out as a current state.

@l0rd
Copy link
Contributor

l0rd commented Jul 9, 2019

Assuming that the project is not building at all.

For GA: we are happy with the simple sample that we already have
For 7.1.0: upgrading to latest go version

@l0rd l0rd added this to the 7.1.0 milestone Jul 9, 2019
@l0rd l0rd added area/devfile-registry severity/P2 Has a minor but important impact to the usage or development of the system. kind/enhancement A feature request - must adhere to the feature request template. labels Jul 9, 2019
@l0rd l0rd changed the title Go realworld sample project needs Go v1.11+ Upgrade Go version to support realworld sample Jul 9, 2019
@sparkoo
Copy link
Member Author

sparkoo commented Jul 11, 2019

I was looking at this and I'm able to build and run the project with Go 1.10.7 with tasks. However, editor is not working correctly. No code assist, no 'go to definition', ... I guess that's because go plugin can't find the dependencies for the project as they are inside go-cli container:
go_sample_error
When I set GOPATH to just CHE_PROJECTS_ROOT, the build task downloads dependencies there and theia will find it, but then it's failing when it tries to create /go folder when compiling. I believe this is because of plugin's GOPATH has /go first https://github.com/eclipse/che-plugin-registry/blob/master/v3/plugins/ms-vscode/go/0.11.0/meta.yaml#L20
Here's my current devfile:

---
apiVersion: 1.0.0
metadata:
  name: golang-realworld
projects:
-
  name: golang-realworld
  source: 
    type: git
    location: https://github.com/xesina/golang-echo-realworld-example-app
  clonePath: src/github.com/xesina/
components:
-
  type: chePlugin
  id: ms-vscode/go/latest
  alias: go-plugin
  memoryLimit: 512Mi
-
  type: dockerimage
  # this version is used in the plugin
  image: golang:1.10.7-stretch
  alias: go-cli
  command: ['sleep']
  args: ['infinity']
  env:
    - name: GOPATH
      # replicate the GOPATH from the plugin
      value: /go:$(CHE_PROJECTS_ROOT)
    - name: GOCACHE
      # replicate the GOCACHE from the plugin, even though the cache is not shared
      # between the two
      value: /tmp/.cache
    - name: PS1
      value: $(echo ${0})\\$
  memoryLimit: 512Mi
  mountSources: true
commands:
- name: build
  actions:
  - type: exec
    component: go-cli
    command: go get -d -v && go build -x -v
    workdir: ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app
- name: run
  actions:
  - type: exec
    component: go-cli
    command: go get -d -v && go run main.go
    workdir: ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app
- name: test
  actions:
  - type: exec
    component: go-cli
    command: go test
    workdir: ${CHE_PROJECTS_ROOT}/src/github.com/xesina/golang-echo-realworld-example-app

(hope it does make sense)

@sparkoo
Copy link
Member Author

sparkoo commented Jul 11, 2019

cc @l0rd @skabashnyuk @tsmaeder

@tsmaeder
Copy link
Contributor

@sparkoo could you file an issue describing the issue with the sample that we will ship with 7.0.0? In my mind, we can just fix it by setting the proper gopath values in the devfile.

@sparkoo
Copy link
Member Author

sparkoo commented Jul 12, 2019

@tsmaeder yep, #13823

@slemeur slemeur modified the milestones: 7.1.0, 7.3.0 Aug 2, 2019
@slemeur
Copy link
Contributor

slemeur commented Aug 2, 2019

Downgrading to 7.3 as #13823 has been adressed

@tsmaeder tsmaeder mentioned this issue Aug 14, 2019
24 tasks
@tsmaeder tsmaeder mentioned this issue Sep 10, 2019
41 tasks
@tsmaeder
Copy link
Contributor

So let's update to the newest go versions. We need to:

  1. Verify that go-modules are compatible with older code (other module systems)
  2. Do a test pass ensuring language features still work
  3. Ensure all go-related devfiles and examples still work.

@tolusha
Copy link
Contributor

tolusha commented Dec 3, 2019

This PR [1] is closed. We have to consider using a sample which contains front-end part as well as back-end. For instance go-guestbook [2]. It requires using side-car container with installed go v1.13

Observable issues:
#13080

[1] eclipse-che/che-devfile-registry#96
[2] https://github.com/GoogleCloudPlatform/cloud-code-samples/tree/master/golang/go-guestbook

@che-bot
Copy link
Contributor

che-bot commented Jun 3, 2020

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 Jun 3, 2020
@ericwill
Copy link
Contributor

ericwill commented Jun 3, 2020

This one is still relevant but low priority.

@ericwill ericwill modified the milestones: 7.3.0, Backlog - Plugins Jun 3, 2020
@ericwill ericwill added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 3, 2020
@ericwill ericwill mentioned this issue Jul 15, 2020
38 tasks
@ericwill ericwill modified the milestones: Backlog - Plugins, 7.17 Jul 15, 2020
@benoitf
Copy link
Contributor

benoitf commented Jul 21, 2020

using multiple workspace root I had no issue (here is experiment of last month) : https://gist.github.com/benoitf/57ffa7e39e2e16a6a2f6756a44693e43

@ericwill
Copy link
Contributor

PR merged. Devfile tests will need to be updated to include the new task names cc @rhopp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-registry kind/enhancement A feature request - must adhere to the feature request template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

8 participants