From: Junio C Hamano <gitster@pobox.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH] ci: cancel stale pull request workflow runs
Date: Wed, 26 Aug 2026 12:54:10 -0700 [thread overview]
Message-ID: <xmqqa4q8fyjh.fsf@gitster.g> (raw)
In-Reply-To: <pull.2369.git.git.1785492641983.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Fri, 31 Jul 2026 10:10:41 +0000")
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Nobody seems interested in reviewing this patch, and I am not
happy leaving too many topics in the "Needs review" state. So
here is my attempt to think aloud, based primarily on what I read
in the proposed commit log message. Consider any misunderstanding
on my part a sign that the proposed log message is lacking.
> - group: ${{ github.sha }}
> + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
> + cancel-in-progress: ${{ github.event_name == 'pull_request' }}
We used to assign each commit to its own group. For a pull-request
event, the new configuration instead assigns it to the concurrency
group <workflow>-<pull-request-number> (e.g., "main-workflow-42"),
so if you are impatient and update an existing pull request before
the CI working on it finishes, the new request will be placed in the
same group.
For other events, <workflow>-<commit-object-name> is the group used
for the commit, which differs from the original behavior, but
arguably in a good way. If three or more workflows sharing the same
concurrency group are triggered at the same time for the same
commit, because there will be at most one active run and one pending
run in the same group, we may see some workflows fail to run on the
commit.
NOTE NOTE NOTE: The previous paragraph is based on my incomplete
understanding of how GitHub Actions works, gathered from skimming
the documentation. It needs to be verified, and if correct, it
should be added to the commit log message. If it is not correct,
a revised description discussing how this change does NOT affect
non-PR events negatively should be included in the commit log
message instead.
The original configuration did not specify 'cancel-in-progress' at
all, so these jobs did not cancel each other. Now, for pull-request
events, an earlier run in the same group is canceled when another
one is triggered. If you are impatient and update an existing pull
request before the CI working on it finishes, the new request will
cancel the currently running one and replace it.
For non pull-request events, it is as if no 'cancel-in-progress'
were specified, as it defaults to false, so there is no regression
there. We _might_ want to have two pushes back to back that causes
the CI work on the same commit to drop one of them, but that can be
left out as an independent issue.
Thanks.
next prev parent reply other threads:[~2026-08-26 19:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 10:10 [PATCH] ci: cancel stale pull request workflow runs Harald Nordgren via GitGitGadget
2026-08-21 11:14 ` Harald Nordgren
2026-08-26 19:54 ` Junio C Hamano [this message]
2026-08-30 10:59 ` [PATCH v2] " Harald Nordgren via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa4q8fyjh.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox