Fix Open PR board GraphQL 502 refresh by aaronpowell · Pull Request #5201 · github/awesome-copilot · GitHub
Skip to content

Fix Open PR board GraphQL 502 refresh - #5201

Open
aaronpowell wants to merge 1 commit into
mainfrom
aaronpowell-fix-open-prs-graphql-reload
Open

aaronpowell wants to merge 1 commit into
mainfrom
aaronpowell-fix-open-prs-graphql-reload

Conversation

@aaronpowell

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the Open PR board refresh path that was hitting GitHub's GraphQL endpoint too aggressively when listing open PRs. The board now uses paginated REST for the bulk PR list and keeps per-PR enrichment bounded, so a large repository no longer fails with a GraphQL 502 during reload.

What changed

  • Switched the bulk PR listing in .github/extensions/open-pr-board/lib/github.mjs from gh pr list to paginated REST (gh api repos/{repo}/pulls?state=open&per_page=100).
  • Kept per-PR enrichment limited to a small concurrency window and made the enrichment tolerant of failures so the board still loads usable data.
  • Updated the regression test in eng/open-pr-board.test.mjs to cover the new REST-based listing path and preserve the existing check behavior.
  • Updated .github/extensions/open-pr-board/README.md to document the new fetch strategy.

Validation

  • node --test eng/open-pr-board.test.mjs

This passed successfully (23 tests, 0 failures).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings October 21, 2026 01:44
@aaronpowell
aaronpowell requested a review from a team as a code owner October 21, 2026 01:44
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Contributor Reputation Check: MEDIUM risk

Check Risk
Profile MEDIUM
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk ready-for-review Submission passed intake validation and is ready for maintainer review and removed awaiting-automation labels Oct 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Refreshes can misrepresent unavailable metadata and discard saved state for still-open PRs.

2 open issues
What changed in this PR

Improves Open PR board refresh reliability on large repositories by moving bulk PR discovery off GraphQL.

Changes:

  • Uses paginated REST listing with bounded, failure-tolerant per-PR enrichment.
  • Updates regression coverage and fetch-strategy documentation.
File Description
eng/​open-pr-board.test.mjs Covers REST pagination, metadata mapping, and enrichment failures.
.github/​extensions/​open-pr-board/​README.md Documents the revised fetch strategy.
.github/​extensions/​open-pr-board/​lib/​github.mjs Replaces bulk GraphQL listing with REST and expands enrichment.

Review effort: Max

const out = await runner(["pr", "list", "-R", repo, "--state", "open", "--limit", "200", "--json", LIST_FIELDS]);
const pullRequests = JSON.parse(out);
await mapWithConcurrency(pullRequests, CHECK_FETCH_CONCURRENCY, async (pr) => {
const out = await runner(["api", "--paginate", "--slurp", `repos/${repo}/pulls?state=open&per_page=100`]);

This branch was successfully deployed

1 active deployment
github-pages — c800dc2c Deployed Oct 21, 2026 by aaronpowell via deploy #988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk:high needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk ready-for-review Submission passed intake validation and is ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants