Skip to content

Switch /git-artifacts and /release to trigger GitHub workflows instead#29

Merged
dscho merged 7 commits intogit-for-windows:mainfrom
dscho:switch-/git-artifacts-and-/release-to-actions
Mar 7, 2023
Merged

Switch /git-artifacts and /release to trigger GitHub workflows instead#29
dscho merged 7 commits intogit-for-windows:mainfrom
dscho:switch-/git-artifacts-and-/release-to-actions

Conversation

@dscho
Copy link
Member

@dscho dscho commented Mar 7, 2023

This is the companion to git-for-windows/git-for-windows-automation#38 that concludes Git for Windows' release process' journey off of Azure Pipelines.

With this PR, the /git-artifacts command triggers a tag-git workflow run, upon whose mirrored Check Run's conclusion the git-artifacts runs are triggered. And the /release picks up those runs and triggers the release-git workflow run.

I intend to verify the correctness of this PR (and to fix whatever is necessary) with -rc2 which is supposed to be released today.

This functionality is used already for the `/deploy` command, and we are
about to need it also in the `/git-artifacts` and `/release` commands.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
commitSHA,
workflowName
)
const succeeded = runs.filter(run => run.status === 'completed' && run.conclusion === 'success')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we encounter check runs that aren't completed at this point and unintentionally dispatch two parallel workflow runs for the same artifacts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. You mean two parallel tag-git workflow runs, or two parallel git-artifacts-<architecture> runs for the same architecture?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In either case, that's possible, but unlikely. And hard to fend against...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that we have a running git-artifacts run for for that architecture and we encounter that non-completed check run here and launch a second git-artifacts run. But I guess it is very unlikely.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. But then the running workflow would not be based on the most recent tag-git run...

I guess that a valid concern is that a previously successful git-artifacts run would block a new one based on a newer tag-git run. Hrm. Maybe I do have to encode the tag-git run ID in the git-artifacts' summaries and then match those...

@rimrul rimrul self-requested a review March 7, 2023 13:19
This is _very_ convenient: just select the "Debug" panel on the left
side of the VS Code window, select the `Debug Tests` in the drop-down
box at the top of said panel, set breakpoints at your heart's extent and
start debugging interactively, with the ability to inspect local
variables and single-stepping.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the switch-/git-artifacts-and-/release-to-actions branch from c02c8a0 to dd111c2 Compare March 7, 2023 14:27
dscho added 5 commits March 7, 2023 21:48
…git` run

This commit is part of Git for Windows' transition off of Azure
Pipelines onto GitHub workflows.

One thing that was changed during that transition is that the tasks were
split up into several workflow runs instead of having one ginormous `Git
Artifacts` Pipeline that does everything from tagging the Git version to
building the Pacman packages in matrix builds, to building the
installers/portable Gits/MinGits/etc in another set of matrix builds, to
generating the release notes as well as the announcement mail.

Now, the Git version is tagged in the `tag-git` workflow, and that
workflow also generates the release notes and announcement mail
template (the SHA-256s of the generated artifacts are part of both,
therefore the final version can only be constructed once those artifacts
are available).

Once the `tag-git` workflow has run successfully, the `git-artifacts`
workflow needs to be started multiple times, once per supported
architecture (currently x86_64 and i686, hopefully soon also aarch64).

This commit teaches GitForWindowsHelper to do that by reacting when a
`tag-git` run completed, triggering the `git-artifacts` runs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With this commit, a `/git-artifacts` command will no longer trigger the
`Git Artifacts` Azure Pipeline but instead the `tag-git` GitHub
workflow.

This relies on the previous commit which teaches the GitForWindows
GitHub App to react to a completed `tag-git` run by triggering the
corresponding `git-artifacts` runs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This concludes the transition of Git for Windows' release process off of
Azure Pipelines onto GitHub workflows.

The added code is a bit more verbose than the previous one because we
have to do all the hard work of maintaining the Check Run in the
git-for-windows/git PR manually.

This is actually a net improvement over the previous situation, where
there was _no_ update in that PR whatsoever as to the current state of
the release.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We only need to trigger a new `tag-git` run if there is no existing,
successful one yet.

If there _is_ one, we can trigger the `git-artifacts` runs right away.

This commit is best viewed with `--color-moved
--color-moved-ws=allow-indentation-change`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is not just any old Check Run that we need here, it is a `tag-git`
Check Run.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the switch-/git-artifacts-and-/release-to-actions branch from dd111c2 to 9aeb564 Compare March 7, 2023 20:55
@dscho dscho merged commit 9d914b1 into git-for-windows:main Mar 7, 2023
@dscho dscho deleted the switch-/git-artifacts-and-/release-to-actions branch March 7, 2023 20:56
@dscho
Copy link
Member Author

dscho commented Mar 8, 2023

Full disclosure: these commits were needed after merging this to release Git for Windows v2.40.0-rc2: bc586a4...961ebdb

dscho added a commit that referenced this pull request Feb 13, 2025
Git for Windows has been using GitHub workflows instead, ever since
#29 was
merged.

Therefore, the code to trigger Azure Pipelines has not been in use for
almost two years. It's time to retire it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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