Break out GitHub Packages downloads per tag - #23698
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-tag GitHub Packages download reporting and compares totals with 30-day install analytics.
Changes:
- Downloads tag pages concurrently with compression.
- Displays sorted per-tag counts and analytics percentage difference.
- Adds coverage for parsing and table output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Library/Homebrew/utils/analytics.rb |
Implements parallel per-tag reporting and custom table headers. |
Library/Homebrew/test/utils/analytics_spec.rb |
Tests per-tag counts, totals, and analytics comparison. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
krehel
approved these changes
Aug 29, 2026
- `brew info --github-packages-downloads` printed a single 30 day total. Show a table per GitHub Packages tag with a grand total instead, in the same `table_output` format as the other analytics tables, and add the signed percentage difference from the 30 day analytics `install` events so under-reporting is visible at a glance: ``` ==> github-packages-downloads (30 days) Index | Tag | Count | Percent -----:|----------|-------:|--------: 1 | 1.25.0-2 | 99,129 | 99.26% 2 | 1.25.0 | 427 | 0.43% 3 | 1.25.0-1 | 263 | 0.26% 4 | 1.24.5 | 32 | 0.03% 5 | 1.25.0_1 | 15 | 0.02% Total | | 99,866 | 100.00% Difference from 16,181 analytics install events (30 days): +517.18% ``` - A per-platform (bottle tag, OS or architecture) breakdown is not possible from GitHub Packages. GitHub counts downloads per version, i.e. per manifest. Homebrew fetches the multi-arch index by version tag (`manifests/1.25.0-2`) and then the bottle blob by digest: blobs are not versions so they are never counted, and the per-platform child manifests only see a handful of lifetime downloads from tools like `docker` or `oras` (10-135 each versus ~100k per month on the tagged index above). Per-platform install data only exists in the Influx analytics `os` and `arch` tags. - Fetch all tag pages with one `curl --parallel --compressed` call into a temporary directory instead of one uncompressed `curl` process per tag. Five pages take ~0.12s instead of ~2.2s (33KB versus 210KB each, over a single HTTP/2 connection); the regex parsing was never the cost. - Refuse to print a partial table: if any discovered tag's page fails to fetch or parse, warn with the missing tags instead of presenting the remaining subset as a 100% total and using it for the analytics difference.
MikeMcQuaid
force-pushed
the
github-packages-downloads-per-tag
branch
from
August 29, 2026 13:41
7f07c04 to
65b4a0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew info --github-packages-downloadsprinted a single 30 day total. Show a table per GitHub Packages tag with a grand total instead, in the sametable_outputformat as the other analytics tables, and add the signed percentage difference from the 30 day analyticsinstallevents so under-reporting is visible at a glance:A per-platform (bottle tag, OS or architecture) breakdown is not possible from GitHub Packages. GitHub counts downloads per version, i.e. per manifest. Homebrew fetches the multi-arch index by version tag (
manifests/1.25.0-2) and then the bottle blob by digest: blobs are not versions so they are never counted, and the per-platform child manifests only see a handful of lifetime downloads from tools likedockerororas(10-135 each versus ~100k per month on the tagged index above). Per-platform install data only exists in the Influx analyticsosandarchtags.curl --parallel --compressedcall into a temporary directory instead of one uncompressedcurlprocess per tag. Five pages take ~0.12s instead of ~2.2s (33KB versus 210KB each, over a single HTTP/2 connection); the regex parsing was never the cost.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude with Fable at Extra High effort, with local review and testing.