Skip to content

Conversation

kingbuzzman
Copy link
Member

@kingbuzzman kingbuzzman commented Jun 3, 2025

Fixes issue where multiple PRs trying to merge into main are being blocked. When working on multiple PRs at a time.. this is a real pain point!

@kingbuzzman kingbuzzman requested review from bluetech and Copilot June 3, 2025 09:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the CI concurrency key to allow separate workflow runs per PR or branch, preventing multiple PRs from blocking each other.

  • Replaces a static “ci-main-${{ github.ref }}” group with a dynamic key using workflow name and PR number or ref.


concurrency:
group: ci-main-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Copy link
Member

Choose a reason for hiding this comment

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

The github.event.pull_request.number is redundant with github.ref isn't it? I think just ${{ github.workflow }}-${{ github.ref }} would have the same effect.

Otherwise LGTM.

Copy link
Member

Choose a reason for hiding this comment

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

@bluetech that's incorrect. I was just called in to investigate a related problem in CPython during the PyCon sprints (well, @CAM-Gerlach baited me with a "you broke the CI" 😂).

They had CI runs from unrelated PRs by different new contributors canceling each other in a way they couldn't explain.

The reason behind it was that both PRs were created from their forks' respective main branches. And so both ended up with the same cancelation group identifier.

There was an entire debate regarding what to include: python/cpython#134310. We settled on referencing PR author among other things. Some bits were included because they are useful as context in error messages, though.

@kingbuzzman kingbuzzman enabled auto-merge (squash) June 3, 2025 19:49
@kingbuzzman kingbuzzman merged commit 6c0e6b2 into main Jun 3, 2025
20 checks passed
@kingbuzzman kingbuzzman deleted the dev/fix-concurrency branch June 3, 2025 19:52
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.

3 participants