bazelbuild / bazelbuild/bazelisk
Support BASE_URL (or similar) for rolling/green releases
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
This is an additional feature request on top of https://github.com/bazelbuild/bazelisk/issues/72; we want all of the binary downloads to pull through our transparent mirror. Currently, we're doing that via .bazeliskrc:
```
BAZELISK_BASE_URL=https://our.mirror/github.com/bazelbuild/bazel/releases/download
```
But I noticed that rolling and last_green don't use the `BASE_URL`, so they download directly (which makes sense, given that it would be tricky to use `BASE_URL` in a way that worked for multiple download types, since they come from different hosts with different path schemes)
Would it be possible to extend the functionality to support this? Not sure the best way, but one way I can think of would be to add a key to `BAZELISK_FORMAT_URL` that contains the URL that bazelisk would have used anyway, like maybe:
- `%H` means the hostname (that would have been used if FORMAT_URL wasn't set)
- `%P` means the path (same)
So then if I set `BAZELISK_FORMAT_URL` to `https://our.mirror/%H/%P` (and the DownloadRolling / DownloadAtCommit supported it) then I think that would do what I wanted?
Contributor guide
Research direction
Start by tracing DownloadRolling and DownloadAtCommit, then compare their URL construction with the existing BASE_URL and FORMAT_URL handling. Done means rolling and last_green downloads can use a transparent mirror while preserving the current URLs and download behavior when no custom format is configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100