Skip to content

PR Approvals Workflow: Fetch Multiple Pages #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

carolynzech
Copy link

The check_approvals workflow in #107 fails because by default Github only returns the first 30 results for GET requests to their API. #107 has more review activity than that, so the approvals are all on the second or third pages, hence why the workflow says zero approvals.

So, this PR updates the script to fetch 100 responses per page, up to 100 pages. These are arbitrary values, but I didn't want to have any infinite loops, and I can't imagine a realistic PR ever going above these numbers (and I put a warning in the script if they do).

I checked that this new workflow runs without error on my fork. I also did some experimentation in my local bash with the branch from #107 and verified that upping the pagination limits like this does indeed return the approvals on the later pages.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@carolynzech carolynzech requested a review from a team as a code owner December 11, 2024 01:44
Copy link

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

LGTM.

@tautschnig tautschnig added this pull request to the merge queue Dec 11, 2024
Merged via the queue into model-checking:main with commit 4698b88 Dec 11, 2024
8 of 9 checks passed
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.

3 participants