Skip to content

Paginate commit statuses from GitHub - #1514

Open
rafayqayyum wants to merge 1 commit into
Shopify:mainfrom
rafayqayyum:paginate-commit-statuses
Open

rafayqayyum wants to merge 1 commit into
Shopify:mainfrom
rafayqayyum:paginate-commit-statuses

Conversation

@rafayqayyum

Copy link
Copy Markdown

Fixes #993.

Commit#refresh_statuses! still only fetched one page of 100 statuses, the hotfix from #989. GitHub's statuses endpoint returns every status event, not just the latest per context, so a commit with ~50 contexts (pending + success each) already exceeds a page and the rest were dropped.

This follows last_response.rels[:next] through handle_github_redirections, the same approach as paginated_check_runs. One difference: it reads the next link before storing a page's statuses, so a GitHub call made while storing them (e.g. from a hook) can't replace last_response and stop pagination early.

Tests: a two-page test modelled on the check runs one, the existing statuses test now stubs last_response, and the merge request refresh test expects last_response twice since statuses read it too. CHANGELOG entry added under Unreleased.

Copilot AI balanced review requested due to automatic review settings November 8, 2026 17:24

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

Support pagination when retrieving commit statuses

2 participants