From 48587a2c21cf92f56b6bb4b4ee6a72280a960e39 Mon Sep 17 00:00:00 2001 From: Heston Hoffman Date: Fri, 21 Aug 2026 15:13:36 -0700 Subject: [PATCH] Paginate API calls in Documentation Team Approval check listReviews was called without pagination, so it only read the first 30 reviews. On PRs with many review rounds, team approvals beyond the first page were invisible and the check published a failing "Documentation Team Approval" status despite a valid approval. Also paginate the team member lookups and raise the page size on requested reviewers, so the same truncation cannot recur as teams grow. Co-Authored-By: Claude Opus 5 --- .github/workflows/codeowner_review_status.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeowner_review_status.yml b/.github/workflows/codeowner_review_status.yml index cb5175d57e0..4651579fda4 100644 --- a/.github/workflows/codeowner_review_status.yml +++ b/.github/workflows/codeowner_review_status.yml @@ -53,11 +53,12 @@ jobs: const DOCUMENTATION_TEAM = 'documentation'; const WEBOPSTEAM = 'webops-platform'; - // Get all reviews - const { data: reviews } = await github.rest.pulls.listReviews({ + // Get all reviews (paginated: PRs can exceed the 30-item default page size) + const reviews = await github.paginate(github.rest.pulls.listReviews, { owner, repo, pull_number: number, + per_page: 100, }); // Track latest review state per user (ignore commented state) @@ -87,6 +88,7 @@ jobs: owner, repo, pull_number: number, + per_page: 100, }); // Check if documentation or webops-platform teams are currently in requested reviewers @@ -95,14 +97,16 @@ jobs: ); // Also check if any documentation or webops-platform team member has reviewed (indicating they were requested) - const { data: docTeamMembers } = await github.rest.teams.listMembersInOrg({ + const docTeamMembers = await github.paginate(github.rest.teams.listMembersInOrg, { org: owner, team_slug: DOCUMENTATION_TEAM, + per_page: 100, }); - - const { data: webopsTeamMembers } = await github.rest.teams.listMembersInOrg({ + + const webopsTeamMembers = await github.paginate(github.rest.teams.listMembersInOrg, { org: owner, team_slug: WEBOPSTEAM, + per_page: 100, }); const teamMembers = [...docTeamMembers, ...webopsTeamMembers];