Skip to content

FormatCheck.yml: key concurrency group on PR number, not base ref#74

Merged
mtfishman merged 1 commit into
mainfrom
mf/formatcheck-concurrency-fix
Apr 23, 2026
Merged

FormatCheck.yml: key concurrency group on PR number, not base ref#74
mtfishman merged 1 commit into
mainfrom
mf/formatcheck-concurrency-fix

Conversation

@mtfishman

@mtfishman mtfishman commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

Small bug in the shared `FormatCheck.yml` concurrency config. The group was:

```yaml
concurrency:
group: "${{ inputs.concurrent-jobs && github.run_id || github.ref }}:${{ github.workflow }}"
cancel-in-progress: ${{ !inputs.concurrent-jobs && inputs.cancel-in-progress }}
```

For `pull_request_target` events, `github.ref` is the target branch
(`refs/heads/main`), so every open PR's format check ended up in the same
concurrency group. With `cancel-in-progress: true`, whenever any PR triggered
a new format check, it cancelled in-progress format checks on all other PRs —
which is why PRs frequently show "Format Check / Check Formatting: cancelled"
for no visible reason.

Observed concretely on ITensor/FunctionImplementations.jl#53:
the Format Check was cancelled when a different CompatHelper PR started a run
on the same repo.

Fix

Key the group on `github.event.pull_request.number` when it's available, so
each PR has its own group. Fall back to `github.ref` for non-PR triggers
(e.g. scheduled or manual dispatch).

For `pull_request_target` events, `github.ref` resolves to the target
branch (typically `refs/heads/main`), not the PR head. With
`cancel-in-progress: true`, that put every PR's format check into the
same concurrency group: any new PR would cancel in-progress format
checks on all other PRs across the repo.

Key the group on `github.event.pull_request.number` when a PR context
is available, falling back to `github.ref` otherwise. Each PR now
cancels only its own previous runs.
@mtfishman mtfishman merged commit e179427 into main Apr 23, 2026
1 check was pending
@mtfishman mtfishman deleted the mf/formatcheck-concurrency-fix branch April 23, 2026 03:33
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