Skip to content

ci: key PR concurrency groups by PR number, not ref - #82

Merged
gusfcarvalho merged 1 commit into
mainfrom
ra/fix-concurrency-pr-number
Oct 9, 2026
Merged

gusfcarvalho merged 1 commit into
mainfrom
ra/fix-concurrency-pr-number

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

When release-please merges its PR it relabels it (autorelease: tagged). That labeled event fires pull_request workflows, and for a closed/merged PR GitHub sets github.ref to the base branch (refs/heads/main), not refs/pull/N/merge. A github.ref-keyed group with cancel-in-progress then cancels the in-flight push-to-main run: this repo's own ci (push-to-main runs cancelled 2026-10-08 at 14:28, 21:24 and 21:36), and the documented preview.yml caller (mock-plugin-1 run 37850525371: "higher priority waiting request for preview-refs/heads/main").

Fix: key PR runs by PR number, keep the ref for push events:
group: <name>-${{ github.event.pull_request.number || github.ref }}. cancel-in-progress is unchanged.

  • .github/workflows/ci.yml: ci-${{ github.event.pull_request.number || github.ref }}.
  • README.md: preview caller snippet now uses preview-${{ github.event.pull_request.number || github.ref }}, with a one-line comment on why.

A repo-wide grep (README, docs/, .github/) found no other github.ref-keyed concurrency group; the rest use fixed names or github.repository.

No reusable workflow changes, so ci: and no release. Consuming repos' preview.yml callers need the same one-line change separately.

Checks: actionlint v1.7.12, go test -race ./..., go vet ./..., gofmt -l ., go run ./cmd/manifest on both manifests.

Task: W1-S3-FIX-CONCURRENCY (local-dev/docs/release-automation/workstream-1-foundations.md)

🤖 Generated with Claude Code

A merged PR's pull_request events (release-please's 'autorelease: tagged'
relabel, the closed trigger) carry the base branch as github.ref, so a
github.ref-keyed group with cancel-in-progress puts them in main's group
and cancels the in-flight push-to-main run. Key PR runs by PR number,
falling back to github.ref for push events.

Task: W1-S3-FIX-CONCURRENCY
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e4791d3a-460c-488a-818a-39184c9a4649

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: LGTM. Fixes the push-to-main CI cancellations on this repo (21:36, 21:24 and 14:28 on 2026-10-08). Events on a merged PR, like release-please's relabel, carry github.ref=refs/heads/main, so they shared main's ci group and cancelled its run. Keying the group by PR number keeps them apart, and cancel-in-progress is unchanged. The README preview snippet now matches the fix already merged on the 7 mock preview callers. ci / required is green on 8d4ee0f, and the ci: type means no release is needed.

@gusfcarvalho
gusfcarvalho merged commit af5b1d1 into main Oct 9, 2026
5 checks passed
@gusfcarvalho
gusfcarvalho deleted the ra/fix-concurrency-pr-number branch October 9, 2026 08:38
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.

1 participant