Fix CI concurrency#1213
Conversation
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.
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!