Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/client-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,9 @@ jobs:
key: ${{ steps.packages.outputs.cache-primary-key }}

concurrency:
group: ci-client-sdks-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
# The event is in the key so a pull request from a fork's `main` never joins main's push group.
group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[R2.2] Nit (pre-existing): the PR group uses github.head_ref, the branch name. A fork PR and a same-repo PR with the same branch name (e.g. feature-x) both get …-pull_request-feature-x, so one cancels the other's run. Optional fix, keyed by PR number: ${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name }} in place of the event and head_ref parts.

# A running run on main is not cancelled by a newer push, and a newer push replaces only a pending
# one. Only a finished push run saves the Swift package cache (#2235, #2225). A pull request run
# still cancels the one before it.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Should fix] R1.1 A run on main can still be cancelled: the group key is github.head_ref || github.ref_name (line 259), so a pull request whose head branch is named main (a fork's main; the repo is public) has head_ref == main and lands in the same group as the push runs on main. GitHub applies the cancel-in-progress of the run that enters the group, so that PR's run (true here) cancels the running main run and replaces its pending one, which is the starvation this PR removes and contradicts the comment above ("A run on main is never cancelled"). Same for every later push to that PR. Not new, but this PR claims to close it. Fix: put the event in the key, group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}, so a push group and a pull_request group never meet. Cancellation semantics are from the docs (https://docs.github.com/en/actions/using-jobs/using-concurrency); I did not run a fork PR to show it live.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in ad0528e: the group key is now ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}, so a fork's main PR gets …-pull_request-main, never main's …-push-main. actionlint shows only the xcode-27 warning; the PR body table is updated.

Loading