Skip to content

Conversation

EliahKagan
Copy link
Owner

@EliahKagan EliahKagan commented Oct 17, 2025

This relates to GitoxideLabs#2221.

There have been multiple incompatibilities before where we needed to change something, usually in the test suite itself, so this experiement checks ahead of time, so we're not rushed.

I first tried to do this with winget but it was not successful, nor am I sure it would always get the latest version once published even if it did work properly. So I went back to the approach that has been added and removed upstream multiple times before, but I put it into a single step and used a YAML anchor to duplicate that step across jobs. See commit messages for details, including what was attempted with winget and why a YAML anchor is preferable in this specific case to extracting to a composite action.


The changes in this fork-internal PR are not meant to be merged anywhere in their current form, because we shouldn't default to upgrading or otherwise changing the version of Git for Windows to something other than what a runner provides. Nor should we test both this and the runner version of Git for Windows in every push or pull_request event, since that would incur significant delays.

But something like this could be turned off by default and made to be able to be turned on by another matrix variable, and also a workflow-dispatch parameter could be added that could let this be triggered manually. Considerations for that:

  • It may also make sense to allow the pattern to be customized, or otherwise to include other logic to allow other versions besides the latest to be selected--since occasionally it may be necessary to downgrade Git for Windows to check that a problem is triggered by a newer version of it (and maybe temporarily to work around such a problem, but hopefully not).
  • More important is that, in practice, if we need to upgrade or downgrade Git for Windows, it is often only needed for either test-fast or test-fixtures-windows and not the other (at least based on how things have gone before), so it would be good to be able to easily turn it on for just one.

Upgrading Git for Windows is not usually needed at all. The idea
here is to test `winget` to see if it can do it more simply than
the code that has been added and removed multiple times before
that downloads the installer from the GitHub release and runs it,
passing a number of non-obvious InnoSetup arguments.

If this works, then it could be a one-liner, but we would still not
want to do it by default, and also it may be that not all runners
will have `winget` installed or that not all runners will have
`winget` set up in a usable way.

This applies only to Windows, of course.
So far this only attempts to upgrade it for `test-fast` because
whatever is going to go wrong may as well be fixed for that before
extending it to `test-fixtures-windows`.

The approach followed here is similar to what was done in the past,
but some specific details differ, including trying to make it work
for both ARM64 and x64 systems and putting everything in a single
step rather than three steps.
GitHub Actions has recently started supporting YAML anchors:

- https://github.blog/changelog/2025-09-18-actions-yaml-anchors-and-non-public-workflow-templates/
- https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#yaml-anchors-and-aliases

This uses that to have the same step in two separate job
definitions without duplicating the code itself.

It would often be preferable do put the job in a composite action,
but as noted in previous commit messages (especially in the
parenthesized paragraph at the end of 9e4e3ec), this job is best
run before `actions/checkout`, yet retrieving the action definition
from the current repository at the same ref (in a way that is not
excessively complicated or slow) requires that `actions/checkout`
have been used first. So this uses a YAML anchor instead.
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