Skip to content

ci(repo): key the PR title workflow's concurrency group to the PR - #2962

Merged
renefloor merged 2 commits into
masterfrom
ci/pr-title-concurrency-group
Sep 15, 2026
Merged

renefloor merged 2 commits into
masterfrom
ci/pr-title-concurrency-group

Conversation

@renefloor

@renefloor renefloor commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Linear:

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

pr_title.yml triggers on pull_request_target, where github.ref is the base branch rather than the PR. Combined with cancel-in-progress: true, that meant every PR targeting master shared a single concurrency group:

PR is Conventional and Semantic-refs/heads/master

So opening or pushing to any PR cancelled the in-flight run of whichever unrelated PR happened to be running at that moment. A cancelled run reports as a failed check, so this shows up as a red semantic_changelog_update on a PR that has nothing wrong with it, and goes green on a manual re-run — which makes it look like flake rather than a misconfiguration.

Observed instance

While pushing a merge commit to #2871, its run was cancelled 1 second in by an unrelated PR:

Run PR Head Base Created Outcome
34953790526 #2871 worktree-unread-banners master 09:40:21 cancelled at 09:40:31
34953806544 #2947 v11 master 09:40:31 success

Both have base: master, so both resolved to the same group. The cancelled job had "steps": [] — killed before it ran anything. Re-running it passed with no code change.

Fix

Key the group off the PR number, which is what check_db_entities.yml already does — this reuses that workflow’s comment verbatim so the two read the same. github.ref is kept as the fallback for any event without a pull_request payload.

Scope

I checked every workflow in the repo; this is the only one affected. check_db_entities.yml is the other pull_request_target workflow and is already fixed. The rest trigger on pull_request (where github.ref is the per-PR refs/pull/N/merge) or on push / schedule / release events, where keying off github.ref is correct.

Full audit
Workflow Trigger Group keyed on Status
pr_title.yml pull_request_target github.ref ❌ fixed here
check_db_entities.yml pull_request_target PR number ✅ already correct
e2e_test.yml pull_request github.ref ✅ per-PR ref
legacy_version_analyze.yml pull_request, push github.ref ✅ per-PR ref
pana.yml pull_request, push github.ref ✅ per-PR ref
stream_flutter_workflow.yml pull_request, push github.ref ✅ per-PR ref
distribute_external.yml release, workflow_dispatch github.ref ✅ n/a
distribute_internal.yml push, workflow_dispatch github.ref ✅ n/a
e2e_test_cron.yml schedule, workflow_dispatch github.ref ✅ n/a
release_publish.yml push, workflow_dispatch github.ref ✅ n/a
release_tag.yml push github.ref ✅ n/a

No package behavior changes, so no CHANGELOG entry (matching #2953 and other ci(repo): PRs).

Screenshots / Videos

n/a — CI configuration only.

Note that this PR is not its own smoke test: pull_request_target always runs the workflow definition from the base branch, so this PR's own conventional_pr_title / semantic_changelog_update checks still execute under the old, shared group. The fix only takes effect for PRs opened or updated after it lands on master.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved workflow concurrency handling for pull request events.
    • Added a fallback for events without an available pull request number.

Under `pull_request_target`, `github.ref` is the *base* branch, not the PR.
Every PR targeting master therefore shared the concurrency group
`PR is Conventional and Semantic-refs/heads/master`, and since the workflow
sets `cancel-in-progress: true`, opening or pushing to any one PR cancelled
the in-flight run of whichever unrelated PR happened to be running.

A cancelled run reports as a failed check, so this surfaced as a red
`semantic_changelog_update` on a PR that had nothing wrong with it, and
cleared on a manual re-run — making it look like flake rather than a
concurrency misconfiguration.

Key the group off the PR number instead, matching what check_db_entities.yml
already does (and reusing its comment). `github.ref` stays as the fallback
for any event without a pull_request payload.

The repo's other workflows are unaffected: they trigger on `pull_request`
(where `github.ref` is the per-PR `refs/pull/N/merge`) or on push, schedule,
and release events, where keying off `github.ref` is correct.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 32033f37-d00b-42d5-8b51-d7037bfbcb31

📥 Commits

Reviewing files that changed from the base of the PR and between 034fe29 and d822488.

📒 Files selected for processing (1)
  • .github/workflows/pr_title.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The pull request title workflow now scopes concurrency by workflow and pull request number when available. It falls back to github.ref when no pull request number exists.

Changes

Pull Request Title Workflow

Layer / File(s) Summary
Concurrency key update
.github/workflows/pr_title.yml
The concurrency group now combines github.workflow with the pull request number and falls back to github.ref.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Suggested reviewers: xsahil03x

Merge Risk: ⚪ Minimal · up to dc01d

The workflow now isolates pull-request runs as intended, with a fallback for non-pull-request events; no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating the PR title workflow's concurrency group to use the pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/pr-title-concurrency-group

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@renefloor
renefloor enabled auto-merge (squash) September 15, 2026 10:40
@renefloor
renefloor merged commit 51ace69 into master Sep 15, 2026
26 checks passed
@renefloor
renefloor deleted the ci/pr-title-concurrency-group branch September 15, 2026 10:45
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.

2 participants