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

Add golang-version datasource #6798

Closed
rarkins opened this issue Jul 21, 2020 · 9 comments · Fixed by #13291
Closed

Add golang-version datasource #6798

rarkins opened this issue Jul 21, 2020 · 9 comments · Fixed by #13291
Assignees
Labels
manager:gomod Go Modules priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jul 21, 2020

What would you like Renovate to be able to do?

Support a datasource that returns all available versions of golang.

Did you already have any implementation ideas?

I haven't found a list of releases on golang.org that seems semantic enough to "scrape". e.g. this is an example from the release history:

image

We could instead use https://github.com/golang/go/tags although there's a risk that tags will appear there before they are actually available for download.

Alternatively, we could use the official golang image tags on Docker Hub even though they probably get built last, as this would be the safest. So we'd query for golang on Docker Hub and then filter for any matching go1.X or go1.X.Y (i.e. no suffix) and then strip the go prefix.

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:gomod Go Modules labels Jul 21, 2020
@rarkins
Copy link
Collaborator Author

rarkins commented Jul 21, 2020

@viceice I think it would be good to have an explicit golang-version datasource even if it's a wrapper for a Docker Hub lookup - what do you think? This would then allow us to update the version of go within go.mod.

@viceice
Copy link
Member

viceice commented Jul 21, 2020

We use the docker tags as source for our golang docker images
https://github.com/renovatebot/docker-go/blob/master/Dockerfile#L1

@olegkrivtsov
Copy link
Contributor

I'd like to take this one.

@olegkrivtsov
Copy link
Contributor

My plan for implementing this is the following:

  1. Add a new datasource to lib/datasource/golang-version. Maybe use the ruby-version datasource as a base (it seems that datasource is very similar to what needs to be implemented).
  2. Use https://go.dev/dl/ as the URL to scrape. As far as I can see, this HTML page can be parsed/scraped with regexes and golang versions can be extracted.

I've also checked Docker Hub https://hub.docker.com/_/golang?tab=tags, but this page is rather similar to go.dev, so I would try to parse go.dev if you feel OK about that.

@viceice
Copy link
Member

viceice commented Dec 20, 2021

Can you check if they also publish some JSON or yaml files? So we don't need those Regex stuff.

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 20, 2021

We also want to make sure that we don't propose upgrades to people before the downloads are ready. @viceice This is maybe a chicken and egg problem if we want to use this datasource ourselves for building go images but also if we were to send people PRs which rely on our images being ready already.

@viceice
Copy link
Member

viceice commented Dec 20, 2021

yes, currently we use the golang docker images, so we're pretty sure all builds are ready.

here's the source for the release list: https://github.com/golang/website/blob/master/internal/history/release.go

@olegkrivtsov
Copy link
Contributor

olegkrivtsov commented Dec 21, 2021

Thanks @viceice, so my plan would be to use the URL https://github.com/golang/website/blob/master/internal/history/release.go you provided to extract versions.

I tried to find a json or yaml file with go versions, but no luck.

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 31.64.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gomod Go Modules priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants