Skip to content

Break out GitHub Packages downloads per tag - #23698

Merged
MikeMcQuaid merged 1 commit into
mainfrom
github-packages-downloads-per-tag
Aug 29, 2026
Merged

Break out GitHub Packages downloads per tag#23698
MikeMcQuaid merged 1 commit into
mainfrom
github-packages-downloads-per-tag

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

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.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude with Fable at Extra High effort, with local review and testing.


Copilot AI balanced review requested due to automatic review settings August 29, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Library/Homebrew/utils/analytics.rb Outdated
Comment thread Library/Homebrew/utils/analytics.rb
- `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
MikeMcQuaid force-pushed the github-packages-downloads-per-tag branch from 7f07c04 to 65b4a0e Compare August 29, 2026 13:41
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit 373d17d Aug 29, 2026
55 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the github-packages-downloads-per-tag branch August 29, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants