Brew: Migrate custom workflow logic into self-contained GitHub Actions

Created on 23 Jun 2020  路  14Comments  路  Source: Homebrew/brew

A detailed description of the proposed feature

Homebrew uses GitHub Actions as its continuous integration provider. There are a number of places where we have extensive custom logic written in GitHub Script or bash. We should move these into custom Actions that live in Homebrew/actions.

Some possible candidates for migration:

The motivation for the feature

  • Modularizing and centralizing the workflows in Homebrew/actions mean that there will be more cross-repository consistency in how we e.g. build bottles or set up Homebrew on CI.
  • We should be able to more easily test modularized workflows in a contained CI environment on Homebrew/actions, rather than potentially messing up workflows in Homebrew/homebrew-core or Homebrew/brew.

How the feature would be relevant to at least 90% of Homebrew users

  • Maintainers would be able to spend more time working on Homebrew rather than fixing issues with our custom workflows.
  • Maintainers who focus on ops would be able to more easily trial staged migrations via development tags on Homebrew/actions, rather than constantly updating a do not merge pull request in Homebrew/homebrew-core.
  • Maintainers of third-party taps would be able to replicate our exact workflows to have a better experience for their users, who are our users as well.
  • Users would be less likely to encounter odd breakages due to workflow quirks.

What alternatives to the feature have been considered

  • Continuing to use custom bash and GitHub-script workflows

    • This doesn't need new code, and is quite easy to iterate on since you're working directly in the repository itself. The disadvantages are listed above.

good first issue help wanted

Most helpful comment

Push with random retry

Started an implementation here: https://github.com/dawidd6/action-git-try-push. Will move to Homebrew/actions later and work on it there.

All 14 comments

Push with random retry

Started an implementation here: https://github.com/dawidd6/action-git-try-push. Will move to Homebrew/actions later and work on it there.

"Push with random retry" Action is live in homebrew-core now: https://github.com/Homebrew/homebrew-core/commit/4501ee0d440618d152b95dc024f52e11bdcc26a2

Composite actions are coming which I think will help reduce the amount of JavaScript necessary to maintain our custom Actions, though I don't know how long it will take for this to move from "experimental" to "stable":

https://github.com/actions/runner/pull/549

Seems like the last thing is:

Setting up Homebrew (ideally cross-platform and Docker/GitHub VM-agnostic)

Setting up Homebrew (ideally cross-platform and Docker/GitHub VM-agnostic)

Yup! Ideally this would be something that could be shared with e.g. Homebrew/brew, Homebrew/homebrew-core, Homebrew/linuxbrew-core and work on both self-hosted and hosted runners. Feel free to scope that back initially if it's too involved, though.

Something that's currently manually done that could be automated by a GitHub Action is the labeling of homebrew-core PRs containing "(new formula)" in the title with the new formula label.

Good point. If no one steps out to implement this, I will try in next week.

@dawidd6 that'd be great. Ideally done not on the title but the created files from the git diff in the Formula directory.

Something that's currently manually done that could be automated by a GitHub Action is the labeling of homebrew-core PRs containing "(new formula)" in the title with the new formula label.

See also https://github.com/actions/labeler. Note that this would need to be done as a scheduled task, since as that repository shows, pull requests on forked repositories don't have sufficient permissions to add labels. https://github.com/actions/stale/ is an example of a labeler that runs on a schedule.

Another idea - create/re-use a label for the homebrew-core repo that an Action applies based on having bottle :unneeded in the formula definition so that after CI passses, it gives an indication that the PR should be manually merged vs just approved and later picked up by @BrewTestBot.

@dtrodrigues That's a good idea 馃憤

Think this issue could be closed. Pointed Actions are already made.

Thanks so much for your work on this @dawidd6!! This is excellent.

Great work @dawidd6 馃憦馃徎

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdekok picture cdekok  路  4Comments

fooness picture fooness  路  4Comments

cfredhart picture cfredhart  路  4Comments

vitahlin picture vitahlin  路  4Comments

MikeMcQuaid picture MikeMcQuaid  路  3Comments