bundle add: accept fully-qualified names from untapped taps - #23266
Merged
Conversation
Signed-off-by: Patrick Linnane <patrick@linnane.io>
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates brew bundle add to accept fully-qualified formula and cask names from taps that are not currently installed, aligning its behaviour with brew install and avoiding early failures when the user is explicitly naming a tap-owned item.
Changes:
- Ensure the tap for a fully-qualified formula/cask argument is installed before attempting to load it.
- Apply item-level trust for fully-qualified formulae/casks (where applicable) before loading, to satisfy the trust model.
- Add specs covering the fully-qualified formula and cask cases from an untapped tap, including operation ordering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/bundle/adder.rb | Installs the tap (for fully-qualified items) and applies item trust before loading formulae/casks for validation/description. |
| Library/Homebrew/test/cmd/bundle/add_subcommand_spec.rb | Adds tests ensuring tap install and trust occur before loading fully-qualified formulae/casks from untapped taps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew bundle addrejected fully-qualified formula and cask names from untapped taps, failing before it wrote anything to the Brewfile (reported in #23265).brew installandbrew bundle installboth treat a fully-qualified name as explicit consent to install its tap, butbrew bundle addkept neither carve-out after the "Stop implicit tap installation" change, so the same name accepted bybrew installwas refused by the command whose whole job is writing that entry.This mirrors
brew install: for a fully-qualified formula or cask argument it installs the tap and applies formula- or cask-specific trust before loading the item for its description and validation. Unqualified names still never cause an implicit tap install, and tap and extension entries keep their existing behavior.Fixes #23265
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Opus 4.8) drafted the implementation and tests; I reviewed the diff, verified the new tests fail without the fix and pass with it, and ran
brew lgtm+ targeted specs.