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

initialize go module file #144

Closed
wants to merge 1 commit into from
Closed

Conversation

lavalamp
Copy link
Member

@lavalamp lavalamp commented Apr 4, 2019

No description provided.

@k8s-ci-robot k8s-ci-robot requested review from sttts and wojtek-t April 4, 2019 22:18
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lavalamp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2019
@lavalamp
Copy link
Member Author

lavalamp commented Apr 4, 2019

Half of #143.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2019
@lavalamp
Copy link
Member Author

lavalamp commented Apr 4, 2019

Ran go mod tidy & updated.

@lavalamp lavalamp mentioned this pull request Apr 4, 2019
@liggitt
Copy link
Member

liggitt commented Apr 5, 2019

should this bump Travis.yml to go1.12 and run with GO111MODULE=on to make sure CI is actually testing with the versions listed here?

xref https://github.com/kubernetes/client-go/pull/582/files

@andreykaipov
Copy link
Contributor

andreykaipov commented Apr 6, 2019

Oh I was recently trying to get gengo to use Go modules too! 😄

To get the tests to pass (specifically TestImportBuildPackage from parser/local_parse_test.go), we have to add an empty go.mod to vendor/fake/dep:

module _

go 1.12

And reference it from the root go.mod:

module k8s.io/gengo

go 1.12

require (
        fake/dep v0.0.0
        ...
)

replace fake/dep v0.0.0 => ./vendor/fake/dep

In addition, because of an assumption the library took for importing packages (see parser/parse.go#551), we have to use $(go list k8s.io/gengo/...) instead of k8s.io/gengo/... directly for the second stage of the CI when verifying the examples (see .travis.yml#L16).

The long-term solution would be to migrate from go/build to golang.org/x/tools/go/packages as recommended by the Go 1.11 release notes https://golang.org/doc/go1.11#gopackages. The way I understand it is by invoking go list ourselves, we're essentially doing what go/packages would do for us.

edit: Oh! Also the Makefiles for each example will now have to reference the boilerplate header directly since the default location for that is in the GOPATH (args/args.go#L45).

If you'd like @lavalamp I can submit a PR into your branch with the changes described above 😄

@lavalamp
Copy link
Member Author

lavalamp commented Apr 8, 2019

@andreykaipov Sure, that'd be great!

@estroz
Copy link

estroz commented May 20, 2019

@andreykaipov are you working on replacing go/build with golang.org/x/tools/go/packages? If not I can take a stab at it.

@andreykaipov
Copy link
Contributor

Hi @estroz - I'm not working on it. At the time of my comment I tried to do it but couldn't really wrap my head around it. 😅

The only PR I have is the one above into this branch to get the CI working with Go modules, but that might have to change if go/build is replaced.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 19, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 18, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants