Replace brew which-update#22231
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors brew which-update into an incremental, CI-oriented updater for the command-not-found executables database, shifting away from the previous scheduled bulk-update model and aligning updates with “touched formulae” in core CI.
Changes:
- Reworks
brew which-updateflags and behavior to support updating/removing specific formula entries, optionally from generated bottle JSON and/or a GitHub pull request’s changed formula list. - Updates
ExecutablesDBto support versionless DB reads/writes and to populate binaries from bottle metadata (manifestpath_exec_files) with a tarball fallback. - Regenerates manpage/docs/completions/Sorbet RBI and adds/updates tests for versionless DB compatibility and bottle JSON updates.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| manpages/brew.1 | Updates manpage options for the new which-update interface. |
| Library/Homebrew/test/dev-cmd/which-update_spec.rb | Adds an integration test for bottle JSON-driven updates and removals; adjusts typing sigil. |
| Library/Homebrew/test/cmd/which-formula_spec.rb | Adds coverage for versionless DB entries in which-formula. |
| Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/which_update.rbi | Regenerates RBI for new CLI args. |
| Library/Homebrew/executables_db.rb | Implements versionless DB parsing/writing and new update sources (bottle JSON / bottle manifest). |
| Library/Homebrew/dev-cmd/which-update.rb | Replaces legacy bulk-scan flags with incremental inputs and optional PR-based formula detection; writes updated= to GITHUB_OUTPUT. |
| docs/Manpage.md | Mirrors the manpage option changes in docs. |
| completions/zsh/_brew | Updates zsh completions for the new flags. |
| completions/fish/brew.fish | Updates fish completions for the new flags. |
| completions/bash/brew | Updates bash completions for the new flags. |
| .github/workflows/command-not-found-db-update.yml | Removes the scheduled workflow for bulk updates. |
Files not reviewed (1)
- Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/which_update.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9378753 to
0c6a8db
Compare
Rylan12
left a comment
There was a problem hiding this comment.
Looks good! Let's merge, and can clean up later. I think there's lots of stuff that can be ripped out of here, I pointed a few out below.
Also, if I remember correctly, lots of the executables_db.rb code is just to create a nice, human-readable changelog for the commit message. But since we're not committing anymore, we probably don't need that nice changelog anymore
0c6a8db to
34a9281
Compare
34a9281 to
ab9d9fc
Compare
- Keep `brew which-update` as the CI-facing command because core CI now updates command-not-found entries from bottle metadata. - Drop the old bulk scan, stats and commit paths because the database is no longer refreshed by a scheduled repository commit. - Limit `executables_db.rb` updates to bottle JSON metadata and explicit formula removals. - Regenerate command docs, completions and Sorbet RBI for the narrower command interface.
ab9d9fc to
dc7337a
Compare
brew which-updateas the CI-facing incremental command for command-not-found database entries.executables_db.rbfor versionless database writes and bottle metadata updates.@Rylan12 Have tried to minimise the changes from the existing code where possible to slim the diff here. It may be we decide to rearrange things a bit later but hopefully this helps make it easier to merge.
See also Homebrew/homebrew-core#281990
Fixes #20752
Closes #21790
Closes Homebrew/homebrew-core#272976
brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with manual tweaks, review and very many approach changes.