Skip to content

Sent GITHUB_TOKEN with the request for the GitHub IP ranges - #330

Merged
CodyCBakerPhD merged 2 commits into
mainfrom
claude/inspiring-archimedes-v1kji1
Nov 2, 2026
Merged

CodyCBakerPhD merged 2 commits into
mainfrom
claude/inspiring-archimedes-v1kji1

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Collaborator

Summary

The 2026-10-30 daily remote tests failed with:

The published IP ranges of GitHub are unavailable for the rest of this run, ... HTTPError: 403 Client Error: rate limit exceeded for url: https://api.github.com/meta

The GitHub API allows 60 unauthenticated requests an hour per IP address. Hosted runners share their addresses, so the allowance is often spent before our job asks. The two Azure tests from #329 passed in that run. Only the GitHub listing failed, in test_every_published_listing_is_available_remote and test_resolver_resolves_public_ip_remote.

Changes

  • _request_published_listing now sends Authorization: Bearer <token> when GITHUB_TOKEN is set and not blank.
    • It only does so when the request's host is exactly api.github.com. The token never goes to AWS, GCP, Microsoft or the VPN listing.
    • Without the variable, requests are unchanged.
  • .github/workflows/remote_testing.yml sets GITHUB_TOKEN: ${{ github.token }}. That is the job's built-in token, which raises the limit to 1,000 requests an hour per repository. No new secret and no extra permissions are needed.
  • README: one sentence on the optional GITHUB_TOKEN.

Production on Typhon is unlikely to hit this. Typhon fetches about once per run from its own address, and since #329 a saved copy stands in if the GitHub listing is ever refused.

Tests

  • The fake requests.get in tests/test_service_networks.py now records the headers of each request.
  • New test_github_token_is_sent_to_the_github_api_only covers the variable unset, blank, and set. It checks the header reaches api.github.com/meta only when set, and that every other request is sent with no headers.
  • pytest tests -m "not remote": 471 passed. pre-commit run --all-files: clean.
  • The remote job on this PR runs with the token, so it exercises the authenticated request.

Version 1.16.0 → 1.16.1.


Generated by Claude Code

Unauthenticated requests to the GitHub API are limited to 60 an hour per IP
address, and the addresses hosted CI runners share are often past that, which
failed the daily remote tests on a 403 from api.github.com/meta. A token set
in GITHUB_TOKEN is now sent with that request, and with no other, and the
remote testing workflow passes the job's own token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQzEBLF8MTBEndj4xpCvRL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQzEBLF8MTBEndj4xpCvRL
@CodyCBakerPhD CodyCBakerPhD self-assigned this Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (deea63a) to head (1e85e8b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #330   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           45        45           
  Lines         2183      2191    +8     
=========================================
+ Hits          2183      2191    +8     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/s3_log_extraction/ip_utils/_ip_utils.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CodyCBakerPhD
CodyCBakerPhD marked this pull request as ready for review November 2, 2026 07:23
@CodyCBakerPhD
CodyCBakerPhD merged commit 1f7e038 into main Nov 2, 2026
8 checks passed
@CodyCBakerPhD
CodyCBakerPhD deleted the claude/inspiring-archimedes-v1kji1 branch November 2, 2026 07:24
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.

2 participants