Skip to content

feat(network): optional PUMAS_GITHUB_TOKEN for GitHub API release requests - #159

Open
MrScripty wants to merge 1 commit into
mainfrom
feat/github-api-token
Open

MrScripty wants to merge 1 commit into
mainfrom
feat/github-api-token

Conversation

@MrScripty

Copy link
Copy Markdown
Owner

Summary

The packaged-ONNX verifiers in CI kept failing with "GitHub rate-limited the ONNX Runtime release listing". This happened on main at 5175306 and on the v0.8.0 macOS headless build. Pumas listed releases anonymously from shared runner IPs, which hit GitHub's limit of 60 requests per hour.

  • Pumas (network/github.rs): reads an optional PUMAS_GITHUB_TOKEN and sends Authorization: Bearer … only when the client targets the real https://api.github.com origin.
    • A loopback fixture or any other base never receives it.
    • Values with whitespace, control characters or non-UTF-8 bytes are ignored with a warning that doesn't include the value.
    • Debug output is redacted.
    • Unset or empty means anonymous, as before.
  • Child processes: child_environment is an allowlist, so the token never reaches runtimes. A test now names it explicitly.
  • Verifiers: packaged_onnx_support.child_environment passes through only PUMAS_GITHUB_TOKEN. GITHUB_TOKEN, HF_TOKEN and similar are still dropped, and a Python test covers this.
  • CI: both ONNX verifier steps set PUMAS_GITHUB_TOKEN: ${{ github.token }}. That is the job's short-lived token, so no credential is committed.

Verification

  • network::github tests pass (25, including 2 new). The child_environment tests and test_inference_release (with 1 new test) also pass.
  • clippy -D warnings, ruff format and both attribution checks pass.

🤖 Generated with Claude Code

…uests

Anonymous GitHub API requests from shared CI runners hit the 60/hour
limit while listing ONNX Runtime releases, failing the packaged-ONNX
verifiers. Pumas now reads an optional PUMAS_GITHUB_TOKEN and sends it
as a bearer token only to the real GitHub API origin; loopback fixtures
and other hosts never receive it, Debug output redacts it, and the
child-process allowlist keeps it out of runtimes. The ONNX verifiers
pass it through their sanitized environment, and CI supplies the
job's short-lived github.token, so no credential lives in the repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 409ea06f-6287-4675-a95b-4800adb25f85
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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