Skip to content

Replace brew which-update#22231

Merged
MikeMcQuaid merged 1 commit into
mainfrom
homebrew-which-update-removal
May 12, 2026
Merged

Replace brew which-update#22231
MikeMcQuaid merged 1 commit into
mainfrom
homebrew-which-update-removal

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid commented May 11, 2026

  • Keep brew which-update as the CI-facing incremental command for command-not-found database entries.
  • Remove the scheduled updater workflow and old bulk scan flags because core CI now updates touched formulae.
  • Reuse executables_db.rb for versionless database writes and bottle metadata updates.
  • Regenerate command docs, completions and Sorbet RBI for the new command interface.

@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


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with manual tweaks, review and very many approach changes.


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-update flags 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 ExecutablesDB to support versionless DB reads/writes and to populate binaries from bottle metadata (manifest path_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.

Comment thread Library/Homebrew/executables_db.rb Outdated
Comment thread Library/Homebrew/executables_db.rb Outdated
Comment thread Library/Homebrew/dev-cmd/which-update.rb
Comment thread Library/Homebrew/dev-cmd/which-update.rb Outdated
Comment thread Library/Homebrew/dev-cmd/which-update.rb
@MikeMcQuaid MikeMcQuaid force-pushed the homebrew-which-update-removal branch from 9378753 to 0c6a8db Compare May 11, 2026 12:24
Copy link
Copy Markdown
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread Library/Homebrew/dev-cmd/which-update.rb Outdated
Comment thread Library/Homebrew/executables_db.rb Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/which_update.rbi: Language not supported

Comment thread Library/Homebrew/executables_db.rb
Comment thread Library/Homebrew/executables_db.rb Outdated
Comment thread Library/Homebrew/dev-cmd/which-update.rb
@MikeMcQuaid MikeMcQuaid force-pushed the homebrew-which-update-removal branch from 34a9281 to ab9d9fc Compare May 12, 2026 09:00
- 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.
@MikeMcQuaid MikeMcQuaid force-pushed the homebrew-which-update-removal branch from ab9d9fc to dc7337a Compare May 12, 2026 10:23
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 9740107 May 12, 2026
39 checks passed
@MikeMcQuaid MikeMcQuaid deleted the homebrew-which-update-removal branch May 12, 2026 11:25
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.

Remove brew which-update

4 participants