Git development
 help / color / mirror / Atom feed
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 v2] ci: cancel stale pull request workflow runs
Date: Sun, 30 Aug 2026 15:54:33 -0700	[thread overview]
Message-ID: <xmqqqzjfz0ba.fsf@gitster.g> (raw)
In-Reply-To: <pull.2369.v2.git.git.1788087560290.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Sun, 30 Aug 2026 10:59:20 +0000")

"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> The CI workflow previously grouped all runs by commit hash using
> `group: ${{ github.sha }}`.  This meant every push to a pull
> request started a separate workflow run, and all workflows
> triggered by the same commit shared the same concurrency group.

That's the current status that we normally describe in the present
tense, no?

> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> ...
> +# For more details about the `concurrency` attribute, see:
>  # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
>  concurrency:
> -  group: ${{ github.sha }}
> +  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
> +  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

If a user has CI enabled on their own repository, pushes a commit
there, and opens a pull request, wouldn't GitHub Actions trigger
two events for the same commit at the tip of the pushed branch?

Before this change, both events are assigned to the same concurrency
group (the commit object name).  One waits while the other runs, and
the skip-if-redundant logic stops the second one early without
wasting cycles on the same commit.  With this change, the
concurrency groups for these two events are separate.  Would we end
up building and testing the same commit twice in parallel?

I suspect this may not be a problem in practice given how our
contributors use GitHub Actions in our official repositories (either
those owned by gitgitgadget or git).  They push to their own
repositories where CI may not be enabled, so 'push' does not
trigger.  Still, I thought it better to bring this up before the
change gets merged and wastes build cycles.

  reply	other threads:[~2026-08-30 22:54 UTC|newest]

Thread overview: 8+ 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
2026-08-30 10:59 ` [PATCH v2] " Harald Nordgren via GitGitGadget
2026-08-30 22:54   ` Junio C Hamano [this message]
2026-08-31 11:12     ` Harald Nordgren
2026-08-31 14:33       ` Junio C Hamano
2026-08-31 16:18 ` [PATCH v3] " 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=xmqqqzjfz0ba.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