Skip to content

Fix GitHub API rate limit failures in repository topics check - #2381

Merged
lassoan merged 1 commit into
Slicer:mainfrom
lassoan:fix-topics-check-rate-limit
Aug 15, 2026
Merged

lassoan merged 1 commit into
Slicer:mainfrom
lassoan:fix-topics-check-rate-limit

Conversation

@lassoan

@lassoan lassoan commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

The repository topics check called the GitHub API without authentication. Anonymous requests are limited to 60/hour per IP address, which is shared with other tenants on GitHub-hosted runners and therefore often already exhausted, making the check fail randomly with HTTP 403.

Pass GITHUB_TOKEN to the validation step and use it in the topics check (same pattern as pin_description_files_scmrevision.py) so requests count against the workflow token's 5000/hour limit instead.

Also raise ExtensionCheckError instead of ValueError on API errors: ValueError is not caught by the check runner loop, so a single failed API request crashed the whole validation run with a traceback instead of being reported as a failed check in the validation report.

The repository topics check called the GitHub API without
authentication. Anonymous requests are limited to 60/hour per IP
address, which is shared with other tenants on GitHub-hosted runners
and therefore often already exhausted, making the check fail randomly
with HTTP 403.

Pass GITHUB_TOKEN to the validation step and use it in the topics
check (same pattern as pin_description_files_scmrevision.py) so
requests count against the workflow token's 5000/hour limit instead.

Also raise ExtensionCheckError instead of ValueError on API errors:
ValueError is not caught by the check runner loop, so a single failed
API request crashed the whole validation run with a traceback instead
of being reported as a failed check in the validation report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lassoan lassoan self-assigned this Aug 15, 2026
@lassoan
lassoan requested a lite review from Copilot August 15, 2026 12:58
@lassoan
lassoan merged commit 6bfce30 into Slicer:main Aug 15, 2026
5 checks passed
@lassoan
lassoan deleted the fix-topics-check-rate-limit branch August 15, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the extension validation “repository topics” check by authenticating GitHub API calls with GITHUB_TOKEN to avoid anonymous rate-limit flakiness on shared runners, and by ensuring API failures are surfaced as check failures rather than crashing the validation run.

Changes:

  • Pass GITHUB_TOKEN into the validation step in the GitHub Actions workflow.
  • Use GITHUB_TOKEN for GitHub Topics API requests and raise ExtensionCheckError on non-200 responses.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/check_description_files.py Adds optional authenticated GitHub Topics API access and converts HTTP errors into ExtensionCheckError.
.github/workflows/extension-validation.yml Exposes GITHUB_TOKEN to the validation step so API calls use the higher authenticated rate limit.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +262 to 265
token = os.environ.get("GITHUB_TOKEN", None)
if token:
headers["Authorization"] = f"token {token}"
response = requests.get(url, headers=headers)
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.

2 participants