Repository navigation
CI: Prevent concurrent merges from cancelling CircleCI trigger - #35320
Merged
Sidnioulz merged 2 commits intoJun 30, 2026
Merged
Conversation
…cleCI trigger The Trigger CircleCI workflow's concurrency group was keyed on github.ref. For PR events that ref is per-PR (refs/pull/<n>/merge), but for push events it is the shared refs/heads/<branch>. With cancel-in-progress, two merges to next landing close together share one group, so the earlier merge's trigger job is cancelled before it POSTs to CircleCI and its `merged` workflow is silently skipped. GH Actions history shows this happening on pushes to next. Key the group on github.sha for push events while keeping per-PR grouping (and redundant-retrigger cancellation) for pull_request_target events. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthroughThe ChangesCircleCI Trigger Workflow Concurrency Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/trigger-circle-ci-workflow.yml:
- Around line 47-53: The concurrency key in the GitHub Actions workflow
currently uses github.ref for all PR-style events, which causes
pull_request_target runs to collapse onto the base branch and cancel unrelated
PRs. Update the concurrency.group expression in trigger-circle-ci-workflow.yml
so the PR path uses github.event.pull_request.number (with github.workflow and
the existing push/sha branch logic preserved), keeping pull_request_target jobs
isolated per PR.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 943a1034-f8b7-4ea8-bfc7-96f95417ec2e
📒 Files selected for processing (1)
.github/workflows/trigger-circle-ci-workflow.yml
Sidnioulz
commented
Jun 30, 2026
Contributor
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 188 | 188 | 0 |
| Self size | 79 KB | 79 KB | 0 B |
| Dependency size | 36.17 MB | 35.23 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/angular
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 185 | 185 | 0 |
| Self size | 160 KB | 160 KB | 🚨 +54 B 🚨 |
| Dependency size | 31.44 MB | 30.50 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 187 | 187 | 0 |
| Self size | 15 KB | 15 KB | 0 B |
| Dependency size | 31.52 MB | 30.57 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 533 | 533 | 0 |
| Self size | 663 KB | 663 KB | 🚨 +13 B 🚨 |
| Dependency size | 62.88 MB | 61.94 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 93 | 93 | 0 |
| Self size | 1.39 MB | 1.39 MB | 🎉 -35 B 🎉 |
| Dependency size | 24.93 MB | 23.98 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 122 | 122 | 0 |
| Self size | 30 KB | 30 KB | 0 B |
| Dependency size | 26.00 MB | 25.05 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 83 | 83 | 0 |
| Self size | 36 KB | 36 KB | 0 B |
| Dependency size | 22.70 MB | 21.76 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 274 | 274 | 0 |
| Self size | 23 KB | 23 KB | 0 B |
| Dependency size | 48.66 MB | 47.72 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 200 | 200 | 0 |
| Self size | 16 KB | 16 KB | 🎉 -12 B 🎉 |
| Dependency size | 37.43 MB | 36.49 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/tanstack-react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 84 | 84 | 0 |
| Self size | 110 KB | 110 KB | 0 B |
| Dependency size | 22.74 MB | 21.79 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 204 | 204 | 0 |
| Self size | 821 KB | 821 KB | 🎉 -84 B 🎉 |
| Dependency size | 92.62 MB | 91.66 MB | 🎉 -952 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 197 | 197 | 0 |
| Self size | 32 KB | 32 KB | 🎉 -72 B 🎉 |
| Dependency size | 91.10 MB | 90.15 MB | 🎉 -951 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 163 | 163 | 0 |
| Self size | 19 KB | 19 KB | 0 B |
| Dependency size | 33.15 MB | 32.20 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 59 | 59 | 0 |
| Self size | 1.52 MB | 1.52 MB | 🚨 +6 B 🚨 |
| Dependency size | 13.38 MB | 12.43 MB | 🎉 -942 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
ndelangen
approved these changes
Jun 30, 2026
2 tasks done
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
The Trigger CircleCI workflow sets its concurrency group to
${{ github.workflow }}-${{ github.ref }}withcancel-in-progress: true.pull_request_targetevents,github.refis per-PR (refs/pull/<n>/merge), so this correctly cancels only redundant re-triggers on the same PR. Two different open PRs never collide.pushevents (merges tonext/main),github.refis the sharedrefs/heads/<branch>. So two merges landing close together share one concurrency group, and the earlier merge's trigger job is cancelled before it POSTs to CircleCI — silently skipping that commit'smergedworkflow.This PR keys the group on
github.shaforpushevents, while preserving per-PR grouping (and redundant-retrigger cancellation) for PR events:Evidence
I queried GitHub Actions history for cancelled runs of this workflow (sampled the 500 most recent; 5,228 cancelled all-time):
pull_request_target— all same-PR self-cancellations (identical branch + timestamp clusters from burstlabeled/synchronizeevents). Bucketing by timestamp showed zero causal cross-PR cancellations, confirming open PRs are already isolated.push, all onnext— these are the genuine cross-PR interference this PR fixes. Examples:Impact
Each cancelled push-trigger meant a merged commit on
nextnever fired its CircleCImerged(post-merge validation) workflow. Low frequency (~1.2% of cancellations) but a silent gap in CI coverage. PR-event behavior is unchanged.🤖 Generated with Claude Code
Summary by CodeRabbit
Manual testing
nextci:mergedtrigger can get cancelledci:mergedper commit