Skip to content

fix(mirror): paginate python-build-standalone release discovery - #277

Merged
CalvinAllen merged 1 commit into
mainfrom
fix/mirror/python-release-pagination
Oct 5, 2026
Merged

CalvinAllen merged 1 commit into
mainfrom
fix/mirror/python-release-pagination

Conversation

@CalvinAllen

Copy link
Copy Markdown
Contributor

Summary

Python 3.13.16 (and every other Python release since December 2025) is missing because the daily Mirror Sync has been silently discovering zero Python versions.

PythonStandaloneSource requested releases?per_page=100 from the GitHub API in a single call. Each python-build-standalone release now carries ~900 assets (~2MB of JSON), so that response would be ~190MB and GitHub returns HTTP 504. The tool logged it as a warning, processed 0 jobs, and exited 0, so the workflow stayed green and the manifest generator kept running on stale data. The last 40 runs all show failed to fetch from python-build-standalone: fetching releases: HTTP 504 (one shows HTTP 403, a rate limit), and python.json hasn't changed since Dec 16, 2025.

per_page Result
100 504
50 504
20 200 (38MB, 16s)
10 200 (19MB, 6s)

Changes

  • 📄 Paginate release discovery: fetch in pages of 10 and follow the Link header, still bounded to the newest 100 releases (same coverage as before)
  • 🔑 Authenticate GitHub API calls: send GITHUB_TOKEN (only to api.github.com) when set; mirror-sync.yml now passes the workflow token
  • 🚨 Fail loudly: when an upstream source fails, jobs from healthy sources still mirror, but the tool exits non-zero so the workflow fails instead of passing silently
  • 🧪 Tests: Link header parsing, multi-page fetching/truncation/error handling against an httptest server, token scoping, and the new per-source error collection

Verification

  • go test -race ./... in scripts/mirror-binaries passes; ./rnr check passes
  • A live dry run (--runtime=python --dry-run) finishes in ~70s and discovers 543 jobs, including python/3.13.16/windows-amd64.tar.gz
  • Compared with the current manifest, the next sync should add 20 versions × 5 platforms: 3.10.20–22, 3.11.15–17, 3.12.13–15, 3.13.12–16, 3.14.3–8

Notes

  • ⚠️ Because Generate Manifests from R2 only runs after a successful Mirror Sync, a day where any source fails will now skip manifest generation for that day. That is the intended trade-off: a red run is better than months of silent staleness.
  • 🚀 After merging, manually dispatching Mirror Sync with runtime: python delivers the missing versions without waiting for the 4 AM UTC schedule. Manifest generation follows automatically. The CLI reads manifests from manifests.dtvem.io, so no CLI release is needed.

Resolves #276

Each python-build-standalone release now lists ~900 assets (~2MB of
JSON), so requesting 100 releases in one GitHub API call times out with
HTTP 504. The sync logged this as a warning, found zero python jobs, and
still exited successfully, so no new Python versions have been mirrored
since December 2025.

- Fetch releases in pages of 10, following the Link header, still
  bounded to the newest 100 releases
- Authenticate GitHub API calls with GITHUB_TOKEN when set, to avoid the
  shared unauthenticated rate limit on CI runners
- Keep mirroring jobs from healthy sources when one fails, but exit
  non-zero so a broken source fails the workflow instead of passing
@CalvinAllen
CalvinAllen merged commit ff08ba7 into main Oct 5, 2026
1 check passed
@CalvinAllen
CalvinAllen deleted the fix/mirror/python-release-pagination branch October 5, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

build(python): 3.13.16 windows-amd64

1 participant