Skip to content

Commit 8094fa3

Browse files
committed
fix: serialize preview-dispatch per PR to preserve event order
A PR's events fire as independent workflow runs, so a push (synchronize) and a close could be dispatched out of order. The cloud handler's concurrency collapses by branch but can't fix arrival order — an update reaching it while a destroy is in-flight cancels the destroy and leaks the preview. Add a per-PR concurrency group (cancel-in-progress: false) so events dispatch in order; the flow is one short API call, so queuing is cheap. Addresses the Devin review note on overlapping dispatches.
1 parent 85a039f commit 8094fa3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/preview-dispatch.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ on:
66
pull_request:
77
types: [opened, reopened, synchronize, closed, labeled, unlabeled]
88

9+
# Serialize a PR's events so dispatches arrive in order. Cloud-side concurrency
10+
# collapses by branch but can't fix out-of-order arrival — e.g. a push racing a
11+
# close could cancel the in-flight destroy and leak the preview. One short API
12+
# call, so queuing is cheap; cancel-in-progress: false lets an in-flight
13+
# dispatch finish (GitHub keeps only the latest pending, the desired behavior).
14+
concurrency:
15+
group: preview-dispatch-${{ github.event.pull_request.number }}
16+
cancel-in-progress: false
17+
918
permissions: {}
1019

1120
jobs:

0 commit comments

Comments
 (0)