Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the snapshot uploading of official Git for Windows versions #124

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 13, 2025

When publishing Git for Windows v2.48.1, two bugs became obvious:

  • Directly after /git-artifacts finished, the upload-snapshot workflow was run, and it failed (because it was started before I could even validate the installers let alone release them, and therefore the corresponding commit was not yet reachable from main).
  • When I finally was ready to /release, everything worked fine except that the upload-snapshot run was not triggered (I had to manually trigger a re-run of the previously-canceled one to upload the snapshot).

This here Pull Request fixes both issues.

The logic was _exactly_ inverted. What it _did_ want to verify was that
the commit for which the snapshot was built is reachable from `main`.
What it verified instead was that `main`'s tip commit is reachable from
said commit. 🤦

I noticed this only today, when a successful `git-artifacts` run in the
v2.48.1 PR at git-for-windows/git#5411 tried to
upload a snapshot, and the (correct) ahead/behind by logic in the
`upload-artifacts` workflow failed (but then succeeded when I re-ran the
workflow after releasing Git for Windows v2.48.1).

Let's invert the logic so that it does what it is supposed to do.

Signed-off-by: Johannes Schindelin <[email protected]>
This should help with debugging in the future, should the need arise
again.

Signed-off-by: Johannes Schindelin <[email protected]>
A regular Git for Windows version is branch-deployed in a Pull Request:
It is built via the `/git-artifacts` slash command and then published
via the `/release` slash command.

Crucially, this build needs to be validated manually between the time
when the `git-artifacts` workflows are done and the time when they are
uploaded, and during that time window, the artifacts should _not_ be
published as snapshots because if validation fails, they need to be
rebuilt.

The preceding two commits fixed the bug where the `upload-snapshot`
workflow was run in that time window by mistake.

However, when _do_ we want to upload the freshly-built official version
as a new snapshot? Why, of course when the `main` branch is pushed.

Except that we do not push at all, the `/release` slash command just
updates the `main` ref, knowing fully well that no objects need to be
pushed because `main` must fast-forward to the the PR branch when
releasing a new Git for Windows version; This is enforced. And updating
the ref via the REST API does not trigger the `push` event at all.

Therefore we need to manually pretend that a `push` happened, and then
all will be good again.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho requested review from mjcheetham and rimrul February 13, 2025 16:27
@dscho dscho self-assigned this Feb 13, 2025
@dscho dscho merged commit 35cd252 into main Feb 14, 2025
1 check passed
@dscho dscho deleted the fix-snapshot-uploading-of-full-releases branch February 14, 2025 18:25
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.

2 participants