Support tap trust in Brewfiles - #22772
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
鈿狅笍 Not ready to approve
The documentation change for the Flathub beta remote URL appears incorrect and should be fixed to avoid directing users to a broken URL.
Pull request overview
This PR extends Homebrew Bundle鈥檚 trusted handling so tap-level trust can be represented in Brewfiles, preserved during brew bundle dump, and enforced/reset during brew bundle cleanup --force, with accompanying tests and documentation updates.
Changes:
- Add a
Homebrew::Trust.replace!API to overwrite the trust store from a computed set of entries. - Introduce
Homebrew::Bundle::Trustto translate Brewfiletrustedoptions (including tap-level trust hashes) into trust-store entries, and apply them early inbundle install. - Enhance
brew bundle dumptap output to emit tap-leveltrusted: { ... }hashes for trusted items not otherwise emitted asbrew/casklines, and document the syntax/behaviour.
File summaries
| File | Description |
|---|---|
| Library/Homebrew/trust.rb | Adds replace! to atomically rewrite the trust store from a provided entry set. |
| Library/Homebrew/bundle/trust.rb | New helper to convert Brewfile trusted options into [type, name] trust-store entries. |
| Library/Homebrew/bundle/installer.rb | Applies trust derived from Brewfile entries before fetch/upgrade checks load formulae/casks. |
| Library/Homebrew/bundle/subcommand/cleanup.rb | On cleanup --force, resets trust.json to match the selected Brewfile鈥檚 trust declarations. |
| Library/Homebrew/bundle/dumper.rb | Passes dumped formulae/casks to tap dumping so taps can emit trust hashes only for non-dumped trusted items. |
| Library/Homebrew/bundle/tap.rb | Emits trusted: true for fully trusted taps or trusted: { ... } for partially trusted tap items. |
| Library/Homebrew/bundle/cask.rb | Reorders method visibility blocks (private helpers moved lower) without changing behaviour. |
| Library/Homebrew/test/bundle/installer_spec.rb | Adds tests for tap trusted hash parsing/application and unsupported key rejection. |
| Library/Homebrew/test/bundle/tap_spec.rb | Adds tests for dumping partial tap trust as trusted: { ... } hashes. |
| Library/Homebrew/test/bundle/dumper_spec.rb | Adds test ensuring trusted dependencies not dumped as formulae are preserved via tap trust hashes. |
| Library/Homebrew/test/cmd/bundle/cleanup_subcommand_spec.rb | Adds test validating cleanup --force rewrites trust store from Brewfile entries. |
| docs/Tap-Trust.md | Points Brewfile trust syntax discussion to the Bundle documentation section. |
| docs/Brew-Bundle-and-Brewfile.md | Documents tap-level trust hash syntax and dump/cleanup behaviour; updates examples. |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 馃憤 or 馃憥 to tell us whether this assessment is correct.
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Preserve trusted tap dependencies when `brew bundle dump` cannot emit them as `brew` or `cask` entries. - Let `brew bundle cleanup --force` make `trust.json` match the selected `Brewfile`. - Document tap-level `trusted` hashes for formulae, casks and commands.
MikeMcQuaid
force-pushed
the
bundle-tap-trust
branch
from
June 17, 2026 13:51
b820d14 to
660d9d5
Compare
MikeMcQuaid
enabled auto-merge
June 18, 2026 08:50
SMillerDev
approved these changes
Jun 18, 2026
8 tasks
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.
Fixes #22756
brew bundle dumpcannot emit them asbreworcaskentries.brew bundle cleanup --forcemaketrust.jsonmatch the selectedBrewfile.trustedhashes for formulae, casks and commands.brew lgtm(style, typechecking and tests) with your changes locally?