Replies: 1 comment
-
|
This behavior is expected because PRs are created first and then later added to a stack. In our model, a PR can't be added to a stack until it has first been created. So the We are working on a new The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
A pull request is created first and added to a stack afterward (the stack is
formed from existing PR numbers). For a time window, the PR therefore exists
outside any stack. Two consumer-visible consequences follow from that ordering:
stackobject is missing from early PR webhooks (notablypull_request.opened), and its presence on later events is nondeterministic.sometimes not triggered, especially for PRs in the middle of a stack.
Both trace back to the same root cause: at the moment the PR is created and its
initial events/trigger-evaluations happen, it is not yet part of a stack.
Consequence 1 — webhooks miss
stackBecause
opened(and other early lifecycle events) fire before the stack isformed, those payloads carry no
stackobject. Whether later events for thesame PR include it depends on webhook delivery timing relative to when the stack
was created, so it's not reliable even after the fact:
stackobject atall.
A consumer that keys off
pull_request.stacktherefore sees an inconsistent,order-dependent view and cannot tell "no stack" from "stacked, but this event
didn't include it."
Additionally, since
stackis not accessible from REST / GraphQL APIs, adiligent consumer cannot supplement the missing data from the server as
its not available. See #139
Consequence 2 — stacked-PR workflows sometimes don't trigger
The documented behavior is that Actions evaluates workflow triggers using the
stack's base branch, so a workflow configured for the trunk
(
on: pull_request: branches: [main]) should run for every PR in a stack. Inpractice this is not reliably honored for middle PRs: a workflow filtered to
the trunk fires for the bottom PR (its base is the trunk) and for the
last-created PR, but a middle PR — whose immediate base is another stack
branch and which was created/evaluated before the stack existed — does not get
the run, and nothing re-triggers it once the stack is formed.
The impact is more than a missing run: if that workflow is a required check,
the PR is either blocked indefinitely (the required check never reports) or
mergeable with the check silently absent.
Root cause
A PR is observable "on its own," not in a stack, between creation and
add-to-stack. Every consumer that evaluates state at creation time (webhook
deliveries, Actions trigger evaluation, anything reacting to
opened) capturesthe pre-stack reality, and there is no reliable re-evaluation when the stack is
subsequently formed.
Request
Make stack membership knowable at creation so a PR never exists outside its
stack — ideally by allowing a PR to be added to a stack atomically as part of
creating it (a single operation), so
openedand the first trigger evaluationalready reflect the stack.
If atomic creation isn't feasible, the equivalent mitigation is a reliable
membership-change signal when a PR is added to (or removed from) a stack — one
that both delivers the
stackobject and re-triggers workflow evaluation for theaffected PRs — so consumers and Actions can correct the pre-stack view.
Beta Was this translation helpful? Give feedback.
All reactions