Subject: Re: [PATCH v2 00/25] CI: run "make [test]" directly, use $GITHUB_ENV

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 06 Apr 2022 11:29:18 +0200

On Tue, Apr 05 2022, Johannes Schindelin wrote:

> Hi Ævar,
>
> On Fri, 25 Mar 2022, Ævar Arnfjörð Bjarmason wrote:
>
>> A re-roll of my improvements my series to simplify the CI setup a lot
>> (see diffstat), much of it was dealing with constraints that went away
>> with Travis et al.
>
> This type of work causes me a lot of follow-up work e.g. many merge
> conflicts in the latest Git for Windows rebases.

Can you elaborate a bit on why? These patches are currently in "seen"
and not "next", and I thought GFW merged git.git's "master" for new
releases, and e.g. in:

    git diff --stat -p v2.36.0-rc0..v2.36.0-rc0.windows.1 -- ci t

I don't see anything related to those sorts of CI changes.

I.e. I understand that you may have something out-of-git.git that may
conflict with this, I'm confused about the GFW reference in particular.

> Perhaps it is worth taking a step back and evaluating the return on this
> investment in the CI setup. While this can be characterized as a
> simplification taking the diffstat as proof, one could challenge that the
> diffstat does not actually measure whether the code is simple or not, it
> just measures whether there are less lines in the end.
>
> If the diffstat was a good measure, then the optimum would be one 0-byte
> `.c` file (which some C compilers compile without error). Another obvious
> way to optimize the diffstat would be to remove all code comments. Would I
> suggest to do either? Of course not.

This is a misunderstanding I really didn't expect, but no. I'm not
suggesting that the diffstat being shorter is a value in and of itself.

Clearly that's ridiculous, as we could make the code "better" by
removing subsequent newlines or whatever.

I thought it was clear in context that the v2 CL's reference to this is
a shorthand for us being able to generally "do more with less"
summarized in the v1:
https://lore.kernel.org/git/[email-masked]

> The reduction in code size of this patch series also comes at quite a
> steep cost: After all, the way Lars and Gábor set things up was already
> easy to reuse with Azure Pipeline and GitHub Actions.
>
> Removing this type of generic, easily-to-adapt code can remove a lot of
> lines at the expense of making the code less generic and harder to adapt,
> and leads us directly to CI lock-in.

It's really hard to try to come to some sort of landing with changes in
ci/ when it looks as though you haven't read my side of the patches or
why these changes were made.

So in liue of some long summary of that I'll just say briefly that the
reason for why I made those changes is covered in detail in commits you
haven't replied to, and which argue the opposite of what you do here.

Briefly: The entire reason I changed those bits is exactly to avoid the
sort of CI lock-in you're talking about, to th point where this series
effectively adds another CI target: You can run everything it's doing
with a normal "make" invocation.

> A better approach would be to use the already-generic code and adapt it
> e.g. to extend to the CirrusCI definition we have.

This series doesn't change .cirrus.yml or how it functions, but it just
does:

  build_script:
    - su git -c gmake
  test_script:
    - su git -c 'gmake test'

Which, after this series is exactly what your "main" CI does. So we're
set up to make it easier to unify the two.

> Even if you do not care about extending our FreeBSD coverage,

FWIW I do care, and I've sent in various portability patches for
FreeBSD, but I haven't used that CI in particular.

> I would like
> to ask to slow down on refactoring as it is done in this patch series. As
> indicated in my comment above, these types of refactorings lead to a lot
> of complications in Git for Windows's processes, which are time-consuming
> to resolve. I understand your motivation, but if you wouldn't mind taking
> some time to weigh the criticality of these changes against the overhead
> incurred for maintainers, it would be appreciated.

Sure, I'm happy to accommodate that.

As this v2 CL notes I'd asked you a month before submitting it in [1]
what I could do to make the parts of it you seemed to find most
objectionable easier or different for you.

>> I think just removing it is OK, we can always bring it back if needed,
>> and doing so is actually going to be simpler on top of this since the CI
>> is now less special, and leans more heavily on the logic of our normal
>> build process.
>
> Removing and re-adding things does take time, though. Again, I think it
> would be helpful to step back and try to understand the value of this
> removal versus the projected time it would take (from all involved) to
> re-add.

Having prepped this v2 + the RFC of your (then smaller) patches on top
I'm pretty sure it would be trivial for either of us compared to
continuing this verbal back & forth.

So, to that end I re-rolled the two in combination, I think it would be
much more helpful to comment on the substance of the changes here.

E.g. we can now see the sum of my patches and yours in "seen", they both
change the CI UI in what I think are complimentary ways (issues of
e.g. added slowness in your patches aside, which has been discussed).

For easy comparison I prepared this the other day, and committed the
same "make CI fail" commit on top to all of them:

 * Your original patches, just rebased on master:
   https://github.com/avar/git/tree/avar-pr-1117/dscho/use-grouping-in-ci-v2-FAIL-TEST
 * Just my v2 series here:
   https://github.com/avar/git/tree/avar/ci-unroll-make-commands-to-ci-recipe-FAIL-TEST
 * The sum of the two, i.e. the v2 + your "RFC" (the RFC label being mine) on top:
   https://github.com/avar/git/tree/avar-dscho/use-grouping-in-ci-v2-FAIL-TEST

If you've got some conflicts or whatever with something out of tree
you'd like me to accommodate or even resolve for you I'd be happy to do
so, just send me the specifics.

> Besides, given how much is shuffled around in this patch series (e.g. some
> files in ci/ are removed altogether and their equivalent code is moved
> into various other places), doubt must be cast on the idea that it would
> be simple to bring back anything here.

I'm assuming you're talking about resurrecting Azure CI, i.e. (mostly)
this would semantically conflict:

    git grep ci/ 6081d3898fe^ -- azure-pipelines.yml

One thing I can see right away that would need adjusting is that I "git
rm" the "ci/mount-fileshare.sh" script as unused. It's part of what I
asked about in [1], but I could just leave that in place, would you like
me to do that for a re-roll & would that help?

For the rest "ci/install-dependencies.sh" is the same,
"ci/run-build-and-tests.sh" would be an easy matter of making it run
"make test" instead after invoking ci/lib.sh.

We're really just talking about a few lines of boilerplate here, I
really don't see what the big deal is.

As my patches also note there's things that the azure-pipelines.yml
assumed that are no longer true (before any changes I made), so some of
this would need adjusting in any case.

It also does a test run followed by ci/print-test-failures.sh, which as
I understand you've been maintaining quite adamantly insisting is pretty
much useless compared to the new GitHub-specific output your series
adds, and which is CI-specific. Presumably most of the work of getting
Azure running again would be (in your version) to adjust that to
something Azure-specific.

Whereas on the CI portability front I noted in [2] and [3] that we could
do pretty much the same without adding CI-specific output targets.

Anyway, I really hope we can find some way past what seems to be an
impasse with these various CI changes. All the best.

1. https://lore.kernel.org/git/[email-masked]/
2. https://lore.kernel.org/git/[email-masked]/
3. https://lore.kernel.org/git/[email-masked]/