Re: [PATCH] ci: avoid building from the same commit in parallel
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 23, 2023, 16:08 UTC
- Message-ID
- <xmqq4jkphhco.fsf@gitster.g>
- In-Reply-To
- <1da763f3-60bf-a572-2c71-336b1fa5553d@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 26 quoted lines
> Hi Junio,
>
> On Tue, 22 Aug 2023, Junio C Hamano wrote:
>
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>>
>> > Right, we'd need that `concurrency: ${{ github.sha }}` attribute on
>> > the `config` job.
>>
>> That was my first thought, but I am not sure how it would work.
>>
>> Doesn't skip-if-redundant grab the workflow runs that have succeeded
>> and then see if one for the same commit already exists? If you used
>> concurrency on the 'config', what gets serialized between two jobs
>> for the same commit is only the 'config' phase, so 'master' may wait
>> starting (because 'config' is what everybody else 'needs' it) while
>> 'config' phase of 'main' runs, and then when it gets to the turn of
>> 'config' phase of 'master', it would not find the run for the same
>> commit being done for 'main' completed yet, would it?
>
> Yes, that's true.
>
> But there is a silver lining: the `concurrency` can not only be specified
> on the job level, but also on the workflow run level.
> I tested this, and present the corresponding patch at the end of this
> mail.Yeah, serializing the whole thing was the only way I thought that would work, and I am glad you already tested that it works.
Thanks.