Skip to content

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
dscho added a commit that referenced this pull request Mar 11, 2025
The `getToken()` method does not need any parameters when being called
in `slash-commands.js` because there, the `owner`/`repo` values are
obvious. But when triggering an `upload-snapshot` workflow, we are
juggling three different repositories, therefore we absolutely need to
specify for which repository the token needs to target.

This was the _actual_ reason why the `upload-snapshot` run was not
triggered after v2.48.1 was released, the conclusions I drew in
#124 were
incorrect.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Mar 11, 2025
…sions"

A couple of weeks ago, when I analyzed why no `upload-snapshots`
workflow run was triggered after "merging" the v2.48.1 PR (for details,
see #124),
I concluded mistakenly that updating the `main` ref would not issue a
`push` webhook event.

However, the `push` webhook event _is_ triggered. It was simply not
handled correctly.

Now that I fixed these issues over the course of the preceding commits,
it will work. And therefore the code added in above-mentioned PR needs
to be dropped lest two `upload-snapshot` workflow runs are triggered to
run concurrently.

This reverts commit c2b466e (snapshot uploading: do upload the regular
Git for Windows versions, 2025-02-13).

Signed-off-by: Johannes Schindelin <[email protected]>
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.

3 participants