Skip to content

Add a daily download stats workflow for escalated.dev - #2

Merged
mpge merged 1 commit into
mainfrom
download-stats-worker
Dec 5, 2026
Merged

mpge merged 1 commit into
mainfrom
download-stats-worker

Conversation

@mpge

@mpge mpge commented Dec 5, 2026

Copy link
Copy Markdown
Member

Moves the ecosystem download counting for escalated.dev out of the web server and into a scheduled workflow here.

  • download-stats/sources.json is the single list of counted packages (15 today).
  • download-stats/refresh.mjs counts lifetime downloads from Packagist, npm (365-day windows, completed windows cached), PyPI via the ClickHouse public dataset, RubyGems, and uploaded GitHub release ZIPs. No dependencies.
  • The workflow runs daily at 05:17 UTC and on merge, and commits downloads.json to a separate download-stats branch so main history stays clean. escalated.dev syncs it from https://raw.githubusercontent.com/escalated-dev/.github/download-stats/downloads.json.
  • A failed or rate-limited source keeps its last good count, marked stale. The total is recomputed from the rows and stays null until all sources have valid counts.

Pull requests run the 14 unit tests plus a dry run against the live APIs (the result is uploaded as the downloads artifact); nothing is published from a PR.

Counts lifetime downloads for the official packages in
download-stats/sources.json across Packagist, npm, PyPI (ClickHouse public
dataset), RubyGems and GitHub release ZIPs, and publishes
downloads.json on the download-stats branch for escalated.dev to sync.

A source that fails or is rate limited keeps its last good count. The
total is recomputed from the rows each run and stays null until every
source has a valid count. Pull requests run the tests and a dry run
against the live APIs without publishing.
@mpge
mpge merged commit e61ebc4 into main Dec 5, 2026
2 checks passed
@mpge
mpge deleted the download-stats-worker branch December 5, 2026 04:30
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.

1 participant