Skip to content

Migrate GitGitGadget to GitHub Actions#1

Merged
dscho merged 3 commits intomainfrom
migrate-gitgitgadget-to-github-actions
Aug 28, 2025
Merged

Migrate GitGitGadget to GitHub Actions#1
dscho merged 3 commits intomainfrom
migrate-gitgitgadget-to-github-actions

Conversation

@dscho
Copy link
Copy Markdown

@dscho dscho commented Aug 18, 2025

This PR is part 5 of addressing gitgitgadget/gitgitgadget#609, and it is stacked on top of gitgitgadget/gitgitgadget#1980, gitgitgadget/gitgitgadget#1981, gitgitgadget/gitgitgadget#1982, and gitgitgadget/gitgitgadget#1983, therefore I will leave this in draft mode until those PRs are merged.

For each GitHub Actions added by those PRs, this here PR adds a corresponding, minimal GitHub workflow. These will need to be triggered via GitGitGadget's existing GitHub App.

Since I was slightly worried about a time penalty incurred by switching from the persistent gitgitgadget/git and gitgitgadget/git-mailing-list-mirror clones in the Azure Pipelines to ephemeral, partial clones in the GitHub workflows, I have run these (mostly in dry-run mode, to avoid updates that would duplicate already-existing ones), for comparison with the existing Azure Pipelines:

name test run Azure Pipeline run
handle-pr-comment 55s 58s
handle-pr-push 44s 48s
handle-new-mails 2m6s 53s
update-prs 6m27s 4m23s
update-mail-to-commit-notes 2m9s 1m10s

Caveat: The timing comparisons are not exactly apples to apples, as I haven't paid full attention to start from the exact same preconditions (for example, the Git mailing list mirror repository contained more emails during the test runs than when the Azure Pipelines ran). In some cases, I even used different PRs because the actual expensive parts were in the setup phase, anyway, the PR-specific logic took a comparatively tiny fraction of the time. In any case, I was mostly interested in ballpark estimates, to gauge roughly how much of a penalty the transition will incur.

While it'd have been fantastic if e.g. the handle-new-mails job would not have taken twice as long as the corresponding Azure Pipeline run, we need to take that time with a grain of salt: The test run probably handled many more emails than the Azure Pipeline because I "rewound" the state so that more code paths would be exercised than the "oh hey, we're up to date" one.

Having said that, the GitGitGadget functionality where swiftness is most crucial is the one where users interact directly, i.e. PR pushes and comments. In those scenarios, it seems that the difference is relatively small.

Since update-prs and update-mail-to-commit-notes are to be triggered by updates to the seen branch, which seem to be less than a dozen times per week, those time differences do not worry me much.

The most concerning difference is that of handle-new-emails, which is to be triggered by updates to the git-mailing-list-mirror repository. Looking at the monthly insights of that repository, the frequency seems to be roughly one update every 20 minutes on average. Which, during more active times, amounts to a lot more frequent updates. If it should turn out in practice that the workflow does, indeed, take around two minutes for every run, I'll need to dig in to figure out how to accelerate this. But then, the 2m6s run mentioned above handled the "What's cooking" email, and there is a 44s jump right before that which may mean that there's a lot of inefficient Git object fetching going on (getting and updating Git notes in a partial repository are usually individual roundtrips...).

@dscho dscho changed the title Migrate gitgitgadget to GitHub actions Migrate GitGitGadget to GitHub Actions Aug 18, 2025
@dscho

This comment was marked as outdated.

@dscho dscho force-pushed the migrate-gitgitgadget-to-github-actions branch 13 times, most recently from cd813b7 to b3efaa7 Compare August 19, 2025 20:09
dscho added 3 commits August 22, 2025 14:06
This is a continuation of the work done in
gitgitgadget/gitgitgadget#1392.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
One of the really nice things about the Azure Pipelines was that they
would automatically show PR Checks when they were running. This gave
some sort of pleasing, visual feedback when `/submit`-ing patch series.

Let's have the same even in the new world, where the PR comment is
handled by a GitHub workflow running in a completely separate GitHub
org, and not connected with the PR in any official capacity.

Note: If we do not specify `output[text]` in the final update, the text
that was specified when creating the Check Run will be _forgotten_. This
is arguably a bug in Actions, and given the recent history of that
product it probably won't get fixed, so we work around it here by simply
specifying the entire `output` _again_.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The newly-added workflows update global state. This global state is held
in Git notes in the `gitgitgadget/git` repository and is updated in
reaction to updates to the Git mailing list mirror and to the `seen`
branch.

While there is now logic in GitGitGadget's Git notes handling to allow
for "distributed updates", it makes more sense to hold off from trying
to perform (nearly-)identical updates in parallel.

Note: In the case of `handle-pr-comment` and `handle-pr-push`, let's be
mindful that it should be possible to handle different PRs concurrently,
which is definitely a change of behavior from the current Azure
Pipelines setup, where only one job can be run at any given time,
_across_ Azure Pipelines (for example, a lengthy `Update GitGitGadget's
PRs` run can easily delay any `/submit` from being processed).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the migrate-gitgitgadget-to-github-actions branch from b3efaa7 to 52c2c9d Compare August 22, 2025 12:06
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 24, 2025
This is the culmination of all the preparation: The first GitHub Action
that will be used in a GitHub workflow that will replace these trusty
Azure Pipelines we used for so long:

  - GitGitGadget PR Handler:
    https://dev.azure.com/gitgitgadget/git/_build?definitionId=3

  - GitGitGadget PR Handler (git):
    https://dev.azure.com/gitgitgadget/git/_build?definitionId=13

  - GitGitGadget PR Handler (dscho):
    https://dev.azure.com/gitgitgadget/git/_build?definitionId=12

Note that this Action receives the full `pr-comment-url` as Action
input; Readers might wonder why the Action cannot receive the
information in a more fine-grained manner, seeing as the `github`
context of a GitHub workflow triggered by a new PR comment already has
all the necessary values. But this would require adding a
GitGitGadget-specific workflow to the main `git/git` repository,
something that was considered in
gitgitgadget#861 but which would
be _extremely_ difficult to convince the core Git contributors to
accept. Therefore, the GitHub workflow using this Action will be a
`workflow_dispatch`-triggered one, for more details see
gitgitgadget-workflows/gitgitgadget-workflows#1.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 24, 2025
 This GitHub Action is designed to implement the functionality that is
currently handled when pushing to PRs by these Azure Pipelines:

- GitGitGadget PR Handler:
  https://dev.azure.com/gitgitgadget/git/_build?definitionId=3

- GitGitGadget PR Handler (git):
  https://dev.azure.com/gitgitgadget/git/_build?definitionId=13

- GitGitGadget PR Handler (dscho):
  https://dev.azure.com/gitgitgadget/git/_build?definitionId=12

This Action will be used in a GitHub workflow that will replace those
trusty Azure Pipelines we used for so long. This workflow lives in a
different org, for full details see
gitgitgadget-workflows/gitgitgadget-workflows#1.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 24, 2025
The idea is to take over the job of the "Mirror Git List to
GitGitGadget's PRs" Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=5.

This will obviously require a GitHub workflow, too, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 24, 2025
The idea is to take over the job of the "Update GitGitGadget's PRs"
Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=2.

This will obviously require a GitHub workflow, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 24, 2025
The idea is to take over the job of the "Update GitGitGadget's commit to
mail notes" Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=9, making use
of the just-ported logic in `CIHelper`.

This will obviously require a GitHub workflow, too, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@webstech
Copy link
Copy Markdown

I have finished reviewing. Will need to set up a reference implementation for other projects to model off of at some point.

dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 26, 2025
The idea is to take over the job of the "Mirror Git List to
GitGitGadget's PRs" Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=5.

This will obviously require a GitHub workflow, too, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 26, 2025
The idea is to take over the job of the "Update GitGitGadget's PRs"
Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=2.

This will obviously require a GitHub workflow, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 26, 2025
The idea is to take over the job of the "Update GitGitGadget's commit to
mail notes" Azure Pipeline over at
https://dev.azure.com/gitgitgadget/git/_build?definitionId=9, making use
of the just-ported logic in `CIHelper`.

This will obviously require a GitHub workflow, too, which is added in
gitgitgadget-workflows/gitgitgadget-workflows#1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Copy Markdown
Author

dscho commented Aug 26, 2025

Will need to set up a reference implementation for other projects to model off of at some point.

I've started that process with https://github.com/cygwingitgadget/cygwin-patches-list-mirror; My plan is to turn this into a fully-working GitGitGadget setup to contribute patches to Cygwin.

@dscho dscho force-pushed the migrate-gitgitgadget-to-github-actions branch from f183fbd to 52c2c9d Compare August 27, 2025 08:15
@dscho dscho marked this pull request as ready for review August 28, 2025 12:01
@dscho dscho merged commit 9540607 into main Aug 28, 2025
@dscho dscho deleted the migrate-gitgitgadget-to-github-actions branch August 28, 2025 12:02
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