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

dmitshur opened this issue Nov 4, 2020 · 1 comment


Copy link

@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 "" 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.

Copy link

@gopherbot gopherbot commented Nov 4, 2020

Change 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
Run-TryBot: Dmitri Shuralyov <>
TryBot-Result: Go Bot <>
Reviewed-by: Carlos Amedee <>
Reviewed-by: Alexander Rakoczy <>
Trust: Dmitri Shuralyov <>
@dmitshur dmitshur added this to Planned in Go Release Team Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants