Make brew bundle honour the trusted: option - #22594
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes brew bundle actually honor the trusted: true option for formulae and casks by persisting trust before any in-process operations (like conflict checks) or brew install subprocesses run, completing the intended dump ↔ install round-trip.
Changes:
- Persist formula trust earlier in
Homebrew::Bundle::Brewinstalls whentrusted: trueis set. - Persist cask trust earlier in
Homebrew::Bundle::Caskinstalls whentrusted: trueis set. - Add/extend specs to assert that trust is persisted before installation actions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Library/Homebrew/bundle/brew.rb | Adds trusted option handling for formula installs by calling Homebrew::Trust.trust! early. |
| Library/Homebrew/bundle/cask.rb | Adds trusted option handling for cask installs by calling Homebrew::Trust.trust! early. |
| Library/Homebrew/test/bundle/brew_spec.rb | Adds a spec asserting formulas are trusted before install flow proceeds. |
| Library/Homebrew/test/bundle/cask_spec.rb | Adds a spec asserting casks are trusted before install flow proceeds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage OverviewLanguages: Ruby Ruby / code-coverage/simplecovThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
MikeMcQuaid
force-pushed
the
bundle-tap-trust
branch
from
June 8, 2026 19:11
861cd9f to
fc1a494
Compare
MikeMcQuaid
force-pushed
the
bundle-tap-trust
branch
from
June 8, 2026 20:02
fc1a494 to
7ccc6aa
Compare
- `trusted: true` was parsed but ignored on install, so a formula or cask from an untrusted tap still failed to load mid-install - persist trust for the formula or cask before it is loaded so the in-process conflict check and the `brew install` subprocess see it trusted - crucially, trust the formula before `tap.ensure_installed!`: tapping loads the formula and triggers the trust check, so trusting only afterwards left the very first `brew bundle` run failing - this completes the round-trip with `brew bundle dump`, which already emits `trusted: true` for trusted entries
- the fully-qualified name check `count("/") == 2` was duplicated
across `trust.rb`, `tap.rb` and `brew bundle`
- extract it next to `name_from_full_name`/`tap_from_full_name` and
reuse it so the intent reads clearly at each call site
- the `brew bundle` integration test fetches real packages and `google-chrome` repeatedly flakes on Google's download server - `firefox` is an equivalent browser cask served from a more reliable host
MikeMcQuaid
force-pushed
the
bundle-tap-trust
branch
from
June 8, 2026 20:02
7ccc6aa to
9b3681b
Compare
p-linnane
approved these changes
Jun 8, 2026
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.
trusted: truewas parsed but ignored on install, so a formula or cask from an untrusted tap still failed to load mid-installbrew installsubprocess both see it trustedbrew bundle dump, which already emitstrusted: truefor trusted entriesbrew lgtm(style, typechecking and tests) with your changes locally?Claude Code Opus 4.8 high with local review and testing.