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

x/build: make precise Git commit hash → Go version mapping readily available #42376

Open
dmitshur opened this issue Nov 4, 2020 · 1 comment
Open

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Nov 4, 2020

There are some places in x/build that try to determine a Go version of a Go commit in order to make some decisions (what builders should be run, etc.). So far we've been relying on heuristics to approximate the answer. There's some information in the name of the branch itself. For example, "release-branch.go1.15" can be parsed so we know that any commit on it is Go 1.15. If we know the latest Go release is Go 1.15.x, then we can guess that
a commit on "master" or "dev.link" branch is likely a development version of Go 1.(15+1).

By now, there is a package internal/goversion in the Go tree that tracks the Go version precisely. It's possible to create a service that processes new Git commits as they're pushed and do the work needed to determine the precise Go version of that Git commit (for example, by reading the git tree), then serve answers quickly.

This is an issue for tracking progress made towards having a service that's able to answer such "commit hash -> precise Go version" queries. (Including things like agreeing we want to do this, describing a design, etc.)

CC @golang/release, @mvdan.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 4, 2020

Change https://golang.org/cl/267677 mentions this issue: maintner/maintnerd/maintapi: adjust heuristic for tip version

gopherbot pushed a commit to golang/build that referenced this issue Nov 6, 2020
The vast majority of the time, when Go 1.X (or Go 1.X.Y) is the latest
supported Go release, non-release branches are used for developing
the next Go 1.(X+1) version and not the same Go 1.X version.

Adjust the imperfect heuristic used to determine the Go version from
the branch name by taking this into account.

Make the output from the TestFindTryWork test easier to read,
as it's expensive to add test coverage for this change elsewhere.

For golang/go#42341.
Fixes golang/go#42377.
Updates golang/go#42376.

Change-Id: I70b21662f2a4c853d14a0928f8bd7361fc6aafd6
Reviewed-on: https://go-review.googlesource.com/c/build/+/267677
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.