-
-
Notifications
You must be signed in to change notification settings - Fork 50
Add scheduled workflow to update database #74
Conversation
|
Something else that I've noticed is that some of the existing entries are outdated. I found this out because running I'm not sure how long it would take to build the entire database from scratch, but I'm assuming a while, but I wonder if we want to totally rebuild it (maybe this is run once a month). Or, we could run more regular updates that only update some of the formulae (e.g. runs once a week and checks ~25% of the formulae each time, probably alphabetically). That way the database is kept up to date but doesn't require running a huge job all the time. |
|
Thank you a lot! ❤️ One way to keep the database up to date would be to have some kind of hook on homebrew-core PRs and updated only the formulæ that were modified by these PR(s). |
Yeah, that could be an option. To be honest it would be pretty simple to add it to the existing test workflow. I think I'd be a little hesitant security-wise to do that (just because keeping the repos separate, especially when one can push to the other, seems like a good idea). Let's ask some other maintainers for their thoughts. |
lib/which_update.rb
Outdated
| if install_missing | ||
| (Formula.core_names - db.formula_names).each do |formula| | ||
| ohai "Installing #{formula}" | ||
| system HOMEBREW_BREW_FILE, "install", "--formula", formula | ||
| end | ||
| db.update! | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much disk space does this use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on how many are missing tbh. Currently, there are 55. The idea is that there will only ever be a handful when this runs (i.e. any new formulae added that day) so it won't be too big a deal to install them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I misread how this worked. Do we ever update the list of existing formulae? The binaries shipped can change from version to version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the issue I've brought up above. Currently no.
|
An alternative suggested by @carlocab would be host the Thoughts on this, @bfontaine? |
|
👍 This is a great idea! |
|
Thinking about this a little more, I think I'm a tad hesitant to move this into Homebrew/core. This would add complexity and potential slowdowns to the homebrew/core repo for a feature that exists as a totally separate entity. I wonder if it's still better to handle the automatic updates in this repo. There might be other ways around this (e.g. detecting which formulae have been updated and only working on those). Thoughts @carlocab or @alebcay? (just moving our Slack discussion to here) |
|
Store the |
Good idea, thanks. I think that probably makes more sense. That way we can regularly update but still keep this separate from homebrew/core. I'll spend some time on that today. |
How much slower would it make running a workflow? I imagine we could probably run it as a separate workflow once a day on |
Yeah, we could. But at that point, why bother putting it in homebrew/core at all when the same can be done here, keeping all of the |
|
I guess third-party taps being able to do it would be nice, but I suppose given there's not much demand for the feature we don't need to do it. Fine with doing it here. |
|
On a related note, something I've always thought would be nice is a database of files installed for each formula, like what Debian and Alpine do. Though I'm probably alone in that. Would be useful for finding conflicts and duplicated dependencies. |
|
Yeah, I could see the value in that. I'm not sure this is really the right place for it, though, as it's not directly related to the rest of what Although, |
|
You’re not alone: #37 😉 |
|
Unless there are any major concerns my plan is to merge this later today when I can monitor the workflow run (and quickly revert if needed). |
|
@bfontaine I think the automation is now in a stable state, so here's a summary of what I've done:
In general, there shouldn't be much manual intervention needed. I think the only reasons would be if a weird case somes up and the automated If you'd like to test a change to the workflow/command, this seems to be the best way to do so:
|
|
Thank you @Rylan12 for all your work here and the detailed explanation! |
This PR attempts to create a scheduled workflow to update the database using
brew which-update.It adds a new
--install-missingoption towhich-updatewhich will install missing formulae (i.e. those that arebottle :unneeded) that wouldn't otherwise be updated.For now, I decided to run this on both macOS and Linux, each time once a day. It's probably overkill to run it on each but some formulae that are only available on one platform would otherwise be missed.
Edit: I realized that we probably don't want two jobs doing mostly the same thing running at the same time because they will both changes. For now, I changed to only run on macOS. I think this will cover most cases and, as always, specific linux-only instances can be managed manually if needed. If automating on Linux is still desired, let me know and we can brainstorm how to solve the problem.
I also set up the commit signing to that these commits are signed by BrewTestBot.
See Homebrew/brew#11137