We have a bunch of versions we've been meaning to adjust to not use
invalid GitHub Packages characters for a while. Let's audit for them
and plan for deprecating their use in future.
Some bottles are quite large, and the copies can make us run out of
space rather quickly. Let's try to avoid that by using hard links
instead of copies.
The retry behaviour in `publish_commit_bottles.yml` [1] is often
successful after the second try, so it's likely that we're not waiting
long enough in between retries here.
Let's fix that by retrying with exponential backoff instead of adding a
fixed interval of five seconds after each failure.
[1] 3241035b2a/.github/workflows/publish-commit-bottles.yml (L431-L443)
Erroring out in the middle of uploading multiple bottles results in a
state that is tedious to recover from.
Let's try to avoid these situations by performing checks for all the
bottles first before trying to upload any.
This will reduce the number of requests necessary to ascertain the size
of formulas' bottle archives for analysis purposes.
Currently, getting the size of each bottle requires 1 request for the
formula.json and followed by N requests per formula-version, which
for most formulae is 7— more than 47k requests!
After this change, size retrieval can ascertain all bottle sizes for a
formula-version in a single request, at the cost of one additional
request per formula-version if that formula-version has not been
rebuilt since this change was introduced.
To start, size retrieval will incur an additional P requests where
P is the number of packages. Over the next few weeks and months,
the retrieval will go a lot faster as all new and updated packages will
require only one request.
After this `HOMEBREW_BOTTLE_DOMAIN=https://ghcr.io/v2/linuxbrew/core`
will work as expected.
While we're here, do a bit of cleanup of constant usage; we don't want
some of these leaking outside the `GitHubPackages` class.
In doing so `docker://` will continue to work for `ghcr.io` but won't
work for arbitrary other Docker hosts; this isn't something we want to
support yet.