Skip to content

Refactor paginated_check_runs to use lazy pagination#1436

Merged
katestud merged 1 commit intomainfrom
katestud/address-unbounded-paginated-check-runs
Nov 24, 2025
Merged

Refactor paginated_check_runs to use lazy pagination#1436
katestud merged 1 commit intomainfrom
katestud/address-unbounded-paginated-check-runs

Conversation

@katestud
Copy link
Contributor

@katestud katestud commented Nov 21, 2025

Context

The RefreshCheckRunsJob refreshes all checks associated with a particular commit via refresh_check_runs!. That method relies on paginated_check_runs, which currently loads all paginated results into memory before processing them. This can result in memory bloat for commits with a large number of check runs (e.g., hundreds of check runs across multiple pages).

Changes

This PR updates paginated_check_runs to process each page lazily by yielding batches to the caller as they're fetched, rather than accumulating all results in memory first.

Testing

This also adds test coverage for the pagination case, as existing test coverage only handled single-page responses.

@katestud katestud force-pushed the katestud/address-unbounded-paginated-check-runs branch from b0a1a7a to 36a0841 Compare November 21, 2025 19:42
@katestud katestud force-pushed the katestud/address-unbounded-paginated-check-runs branch from 36a0841 to 2996d7b Compare November 21, 2025 20:14
@katestud katestud marked this pull request as ready for review November 21, 2025 20:22
@katestud katestud merged commit ec9d473 into main Nov 24, 2025
15 checks passed
@katestud katestud deleted the katestud/address-unbounded-paginated-check-runs branch November 24, 2025 15:23
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

Comments