workflows: add per-formula command-not-found DB entry update#272976
workflows: add per-formula command-not-found DB entry update#272976ooye-sanket wants to merge 4 commits intoHomebrew:mainfrom
Conversation
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Great work so far @ooye-sanket!
|
Thanks for the review @MikeMcQuaid! I've addressed all the feedback:
|
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Looks better! Let's get Homebrew/brew#21790 merged first.
|
@MikeMcQuaid Added the has-changes boolean step as suggested — all 5 repeated if: conditions now reference steps.has-changes.outputs.result == 'true'. All CI checks are passing. Ready for re-review! |
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Thanks @ooye-sanket, let's try this out!
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Actually holding merge until https://github.com/Homebrew/brew/pull/21790/changes is in!
Rylan12
left a comment
There was a problem hiding this comment.
This seems good as a first pass to me, and I think we can merge this.
I wonder if a different approach could be even better:
Instead of having this run as its own job, what if we tack this on to the publish-commit-bottles.yml job. That job already runs pr-pull to download the bottles, so I wonder if we could use actions/cache or actions/upload to very easily transfer those to a separate job that updates the actual executables file in ORAS.
Since we'd already have the bottle manifest available, we could probably skip the ruby command and just use bash's sed and sort.
| shasum --algorithm=256 executables.txt > executables.txt.sha256 | ||
| rm -f executables.txt | ||
| oras pull ghcr.io/homebrew/command-not-found/executables:latest | ||
| shasum --algorithm=256 --check executables.txt.sha256 |
There was a problem hiding this comment.
We should include the delete-old-versions job as well here IMO
https://github.com/Homebrew/brew/blob/main/.github/workflows/command-not-found-db-update.yml#L81-L94
|
@Rylan12 Thanks! I'll add the delete-old-versions job. Should I model it exactly after the existing job in command-not-found-db-update.yml#L81-94, or adapt it to run only for the changed formulae? |
Agreed with putting in an existing job. I don't feel strongly about whether it's Ruby or Bash. Unless the Bash is very very simple Ruby is probably preferable. |
I think it only needs to run if the executables file actually gets an update pushed to github packages, but it should run every time that happens |
Implements the approach discussed in Homebrew/brew#20752.
Replaces the daily batch
brew which-updatejob with a lightweight per-formula workflow that triggers on each push tomainthat touches a formula file.For each changed formula it:
sh.brew.path_exec_filesfrom the bottle manifestexecutables.txtviaorasorasKey design decisions:
cancel-in-progress: falseso rapid merges queue rather than clobber each other (per Rylan12's spec in Removebrew which-updatebrew#20752)github.sha^..github.shadiff-tree range to correctly handle merge commitsPartial implementation of Homebrew/brew#20752
brew which-updateremoval in homebrew/brew is a separate follow-up.@MikeMcQuaid can you please review it!!
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?