Skip to content

Conversation

@denolfe
Copy link
Member

@denolfe denolfe commented Jan 21, 2026

Overview

Fixes GitHub secondary rate limit errors in the release-commenter action when processing releases with many PRs.

Key Changes

  • Sequential processing for comment creation

    • Replaced parallel Promise.all with sequential processing and 1s delay between each PR
    • Added progress logging: Processing issue/PR 1/20: #123
  • Updated tests for async timing

    • Added Jest fake timers to handle sequential delays in tests

Design Decisions

GitHub's secondary rate limits restrict content creation to 80 requests/minute and penalize burst patterns regardless of total volume. The previous implementation fired all comment/label requests in parallel, triggering the "content creation" throttle even when under primary rate limits.

Sequential processing with a 1s delay trades speed for reliability. For a release with 20 PRs, processing takes ~20s instead of ~2s—an acceptable tradeoff given releases are infrequent and reliability matters more than speed.

GraphQL queries (read operations) remain parallel since they're less likely to trigger secondary limits.

Overall Flow

sequenceDiagram
    participant Action
    participant GitHub API

    Action->>GitHub API: Get releases (parallel)
    Action->>GitHub API: Compare commits (parallel)
    Action->>GitHub API: GraphQL queries for PRs (parallel)
    
    loop For each linked issue/PR
        Action->>GitHub API: Get issue state
        Action->>GitHub API: Create comment (+ unlock/lock if needed)
        Action->>GitHub API: Add labels (if configured)
        Note over Action: Wait 1s before next
    end
Loading

References / Links

Process comment/label creation sequentially with 1s delay to avoid
GitHub's secondary rate limits. Parallel requests were triggering
"content creation" throttling even when under primary rate limits.
@denolfe denolfe merged commit 71b35fa into main Jan 21, 2026
18 checks passed
@denolfe denolfe deleted the ci/post-release-rate-limiting branch January 21, 2026 14:56
@github-actions
Copy link
Contributor

🚀 This is included in version v3.73.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants