Skip to content

Use GitHub's renamed page_data/stacks endpoint - #3

Merged
dejorrit merged 1 commit into
mainfrom
fix-stack-endpoint
Sep 17, 2026
Merged

dejorrit merged 1 commit into
mainfrom
fix-stack-endpoint

Conversation

@dejorrit

Copy link
Copy Markdown
Owner

GitHub renamed the route behind the stack badge popup from /pull/{n}/page_data/stack to /pull/{n}/page_data/stacks. The old path now returns 404 for every PR. Stacks were still grouped, but only because each one fell back to loading the full PR page and reading the embedded JSON. This PR switches to the new path, so it's one small JSON request per stack again.

Evidence

  • GitHub's current frontend bundle builds the URL as /${owner}/pull/${n}/page_data/${routes.stack}, and the route table maps stack:"stacks".
  • On checkout: resolve remote stack by branch name github/gh-stack#477, with the extension's headers:
    • page_data/stack returns 404;
    • page_data/stacks returns 200 with the same { stack: { id, number, size, baseBranch, pulls[...] } } shape. A PR that isn't stacked returns stack: null.
  • The live response runs through core.normalizeStack unchanged: stack 590391, size 3, PRs 477/475/469.

Testing

  • node --test passes 10/10.
  • Checked anonymously on a public repo only. Reload the extension on a signed-in private repo list to confirm the stacks request returns 200 and the PR page requests are gone.

🤖 Generated with Claude Code

GitHub renamed the stack page_data route from stack to stacks, so the old
path returns 404 and every stack fell back to loading the full PR page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dejorrit
dejorrit marked this pull request as ready for review September 17, 2026 07:51
@dejorrit
dejorrit merged commit 56d217f into main Sep 17, 2026
@dejorrit
dejorrit deleted the fix-stack-endpoint branch September 18, 2026 18:53
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.

1 participant