Skip to content

build: breaking change in go-github #19208

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

Closed
kevinburke opened this issue Feb 20, 2017 · 14 comments
Closed

build: breaking change in go-github #19208

kevinburke opened this issue Feb 20, 2017 · 14 comments

Comments

@kevinburke
Copy link
Contributor

The go-github repository took the opportunity to add context.Context parameters to all API calls that go over the network. Several of the packages in x/build depend on go-github:

  • x/build/devapp
  • x/build/godash
  • x/build/cmd/godash
  • x/build/maintner
  • x/build/cmd/issuelock

CL 37293 adds Context support.

I'm not sure this is enough, however, since the new go-github can only run on 1.7 or higher, and I'm pretty sure this rules out using Google App Engine. People might also run into problems compiling the library if they have an older version of go-github (or a newer version, with an older version of x/build). We could vendor the old version in the x/build repository to maintain maximum compatibility.

@dmitshur
Copy link
Member

What's the version support policy for x/build? According to #17626:

What's the general policy for how many versions back we maintain support on a given subrepo?

In general, the two most recent.

But I'm not sure if that applies directly to x/build since it's a little meta.

If x/build needs to run on 1.6 and older, then vendoring version 2 of go-github (parent commit of google/go-github@796decd) would be necessary.

@kevinburke
Copy link
Contributor Author

kevinburke commented Feb 21, 2017

I'm not sure there is one, but:

  • The stuff in x/build/cmd is probably "the two most recent Go versions," so fine to use context there.

  • dev.golang.org still runs on App Engine, which as of today, still runs on Go 1.6.2. https://cloud.google.com/appengine/docs/go/release-notes. I've been working on fixing dev.golang.org to work outside of App Engine but there are still some CL's outstanding, and I don't have access to the dev.golang.org server to be able to update it.

@bradfitz
Copy link
Contributor

We can move https://dev.golang.org to https://cloud.google.com/appengine/docs/flexible/ which allows any arbitrary code, including any version of Go we want.

kevinburke added a commit to kevinburke/build that referenced this issue Feb 21, 2017
The latest master for go-github (google/go-github@23d6cb9c) adds
Context parameters as the first argument to every function call.
Update code that calls go-github to have contexts, where appropriate,
and adds timeouts to some long-running commands that didn't
previously have them.

Fixes golang/go#19208.

Change-Id: I25203de5d10ada1dcd3a97eb5434a85bb328ce7e
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/37293 mentions this issue.

@kevinburke
Copy link
Contributor Author

Can we reopen this? I believe we can't deploy dev.golang.org, since App Engine is still stuck on Go 1.6.

I'm working on a CL to update the devapp codebase to work with Appengine Flex, which apparently runs Go 1.8, and should hopefully fix the issue.

@kevinburke
Copy link
Contributor Author

cc @quentinmit

@kevinburke
Copy link
Contributor Author

Though, sigh, it sounds like "flex" is more like EC2's spot instances and less like a continuously running server.

From https://cloud.google.com/appengine/docs/flexible/go/flexible-for-standard-users:

The flexible environment is intended to be complementary to the standard environment. If you have an existing application running in the standard environment, it’s not usually necessary to migrate the entire application to the flexible environment. Instead, identify the parts of your application that require more CPU, more RAM, a specialized third-party library or program, or that need to perform actions that aren’t possible in the standard environment. Once you’ve identified these parts of your application, create small App Engine services that use the flexible environment to handle just those parts. Your existing service running in the standard environment can call the other services using HTTP, Task Queues, or Cloud Pub/Sub.

Are there any App Engine developers that contribute to the Go codebase? What are the plans for Go 1.8 on App Engine?

Alternatively we could work harder to deploy dev.golang.org on Kubernetes or similar. CL https://go-review.googlesource.com/c/36319/ attempts to load the devapp's static assets outside of an App Engine context.

kevinburke added a commit to kevinburke/build that referenced this issue Mar 14, 2017
I can't get this to work, though, and builds are timing out and it's
frustrating and it's late.

Updates golang/go#19208.

Change-Id: Id3c0440a9529bf4d07a332dd301a930dc993d7f0
@bradfitz
Copy link
Contributor

App Engine Classic will update to Go 1.8 soon enough. But we should migrate to Flex sooner.

@quentinmit
Copy link
Contributor

It was a tiny patch to go-github to get it to build on 1.6, so I just did that. Devapp is updated and redeployed.

@dmitshur
Copy link
Member

It was a tiny patch to go-github to get it to build on 1.6, so I just did that.

@quentinmit, is that patch public, if so, can you point me to it please?

I ask because we have a PR in go-github that attempts to add compatibility for app engine, but currently isn't successful. I'm not familiar with app engine so I can't help it further. If your fix is a general one, it'd be nice to get it upstream. (If the fix isn't general, then that's fine.)

@kevinburke
Copy link
Contributor Author

@shurcooL, I'm guessing it was "replace all instances of "context" with "golang.org/x/net/context", and ignore/remove the req.WithContext calls.

@dmitshur
Copy link
Member

That's my guess too, but given he said "a tiny patch", I was hoping it might be something else that I overlooked.

kevinburke added a commit to kevinburke/build that referenced this issue Mar 15, 2017
I can't get this to work, though, and builds are timing out and it's
frustrating and it's late.

Updates golang/go#19208.

Change-Id: Id3c0440a9529bf4d07a332dd301a930dc993d7f0
@quentinmit
Copy link
Contributor

@shurcooL Yes, @kevinburke is correct. I sed'd the import path to golang.org/x/net/context (which still works just fine on Go 1.8), and used build tags to hide the handful of req.WithContext and req.Context calls. I can send you a PR if you want for that?

@dmitshur
Copy link
Member

@quentinmit Thanks for confirming.

I can send you a PR if you want for that?

We already have PR google/go-github#582 that does something like that, so there's no need. I just wanted to see if there was a different approach. Thanks!

@golang golang locked and limited conversation to collaborators Mar 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants