You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a pull request is part of a stack, the stack object (e.g. stack.base.ref)
is delivered on webhook payloads but is not retrievable from any read API:
REST (GET /repos/{owner}/{repo}/pulls/{number}) returns stack: null —
even for a PR that is a confirmed member of a stack.
GraphQL has no stack field on the PullRequest type at all (querying it
errors; introspection lists no such field).
The only programmatic source of stack data is the undocumented cli_internal/pulls/stacks endpoint, and it returns membership only
({id, pull_requests}) — not the stack base — so determining "what does this
stack target" requires a second lookup.
The data clearly exists server-side (it's on the webhook), it just isn't exposed
on demand. Please expose it as a supported, documented field on both APIs.
Repro (gh CLI)
Given a PR (#31 below) that is a confirmed member of a stack:
# Confirm it IS in a stack (internal endpoint — membership only, no base):
gh api repos/OWNER/REPO/cli_internal/pulls/stacks
# => [{"id":22,"pull_requests":[29,30,31]}]# REST: stack is null even though #31 is a member
gh api repos/OWNER/REPO/pulls/31 --jq '{number, base: .base.ref, stack}'# => {"number":31,"base":"m-B","stack":null}# GraphQL: the field does not exist
gh api graphql -f query='{ repository(owner:"OWNER", name:"REPO") { pullRequest(number:31) { number stack { base { ref } } } } }'# => Field 'stack' doesn't exist on type 'PullRequest'# GraphQL introspection: no stack field on PullRequest
gh api graphql -f query='{ __type(name:"PullRequest") { fields { name } } }' \
--jq '.data.__type.fields[].name'| grep -i stack
# => (no output)
For contrast, the same PR's webhook payload does include it:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When a pull request is part of a stack, the
stackobject (e.g.stack.base.ref)is delivered on webhook payloads but is not retrievable from any read API:
GET /repos/{owner}/{repo}/pulls/{number}) returnsstack: null—even for a PR that is a confirmed member of a stack.
stackfield on thePullRequesttype at all (querying iterrors; introspection lists no such field).
cli_internal/pulls/stacksendpoint, and it returns membership only(
{id, pull_requests}) — not the stack base — so determining "what does thisstack target" requires a second lookup.
The data clearly exists server-side (it's on the webhook), it just isn't exposed
on demand. Please expose it as a supported, documented field on both APIs.
Repro (gh CLI)
Given a PR (
#31below) that is a confirmed member of a stack:For contrast, the same PR's webhook payload does include it:
Request
Expose the stack object on the read APIs, mirroring the webhook shape:
Expose the stack object on the read APIs, mirroring the webhook shape:
and ideally the member PR numbers.
This lets any consumer determine stack membership and target on demand, instead
of depending solely on (push-only, sometimes-absent) webhook delivery.
Beta Was this translation helpful? Give feedback.
All reactions