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

proposal: x/website/internal/dl: add including unstable without archived releases (?mode=json&include=stable,unstable) #40649

Open
leighmcculloch opened this issue Aug 8, 2020 · 5 comments

Comments

@leighmcculloch
Copy link
Contributor

What version?

golang/website@51b22ef

Does this issue reproduce with the latest release?

Yes

What did you do?

Query https://golang.org/dl/?mode=json for stable releases and beta releases.

What did you expect to see?

A way to query the endpoint and get back the latest stable releases, i.e. go1.14.7 and go1.13.5, as well as the latest unstable/beta/release-candidate, i.e. go1.15rc2.

What did you see instead?

I see only a way to query the last two stable releases:

https://golang.org/dl/?mode=json

Or to query all releases that includes stable releases, unstable releases, and archived releases, of which there are many:

https://golang.org/dl/?mode=json&include=all

@gopherbot gopherbot added this to the Unreleased milestone Aug 8, 2020
@leighmcculloch
Copy link
Contributor Author

leighmcculloch commented Aug 8, 2020

Proposal

I think it would be useful for tools or development environments that automatically install the latest stable versions of Go to be able to easily query for the latest unstable releases. Using unstable releases is encouraged so that issues are found early and this is one way we could make that easier.

We could change the include option to take other values such as stable, unstable, and archived. The query value could support a comma-separated list of valid values so it would be possible to specify stable,unstable.

https://golang.org/dl/?mode=json&include=stable (default)
https://golang.org/dl/?mode=json&include=stable,unstable
https://golang.org/dl/?mode=json&include=all

This would be trivial to implement because the logic here is straightforward and malleable:

https://github.com/golang/website/blob/0108f0928b89f2c1b821381349f473db3f4cbfc4/internal/dl/server.go#L101-L107

@gopherbot
Copy link

Change https://golang.org/cl/247524 mentions this issue: internal/dl: add includes values stable, unstable, archive

@andybons andybons changed the title x/website/internal/dl: add including unstable without archived releases (?mode=json&include=stable,unstable) proposal: x/website/internal/dl: add including unstable without archived releases (?mode=json&include=stable,unstable) Aug 10, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Sep 22, 2020

It's true that the implementation for this is fairly small and easy. However, once we add support for this, it will become hard (nearly impossible) to remove and we'll need to maintain it indefinitely. So before making changes, I want to better understand what isn't possible (or is difficult or inefficient) now.

It seems to me that clients can request ?mode=json&include=all and perform any kind of filtering logic on their end. This is flexible and simple.

Can you please elaborate on why you think this change should be made? Is it about being able to reduce the size of the response needed to be delivered in some situations? Are there other factors?

I think it would be useful for tools or development environments that automatically install the latest stable versions of Go to be able to easily query for the latest unstable releases.

In what way is it not easy right now?

Also see #36898, #38773, and #37581 which may be related.

@leighmcculloch
Copy link
Contributor Author

leighmcculloch commented Sep 23, 2020

In what way is it not easy right now?

It's not about reducing the size of the response, but folks who are automating the installation of Go in different environment may be, like me, doing this in scripts like bash scripts, etc. Right now because the default response is just the last two stable releases it is really simple to pipe that output to some other shell commands to install the stable releases.

I did not find it simple to filter a large set of JSON in bash. I'd have no problem doing this in Go, or other languages, so maybe I am just using the wrong tool for the job.

When release candidates and betas come out ideally it is as simple for people to install them as easily as stable releases by adding a parameter to the URL. It's definitely possible to parse all archived old releases to get at the release candidates/betas, but I think there's value in surfacing at least betas outside of the archived list so that it is easier for people to install all stable+RCs/betas since running the betas and RCs is encouraged. If it is encouraged it's worth lowering the barrier?

Another option would be to include the release candidates/betas in the default output but that'd be a breaking change and I'm not sure if that'd be appropriate.

@hyangah
Copy link
Contributor

hyangah commented Dec 15, 2021

We want this for vscode-go's Go release checking. In our case, the size of the response is important because vscode-go is watching this endpoint periodically. Currently, include=all output size is almost 1M and will keep growing. @dmitshur and @leighmcculloch, do you mind if we reopen this issue to reconsider the feature and sort out the details (e.g. include=stable,unstable)?

@ianlancetaylor ianlancetaylor added this to Incoming in Proposals (old) Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

Successfully merging a pull request may close this issue.

4 participants