Skip to content

Support tap trust in Brewfiles - #22772

Merged
MikeMcQuaid merged 1 commit into
mainfrom
bundle-tap-trust
Jun 18, 2026
Merged

Support tap trust in Brewfiles#22772
MikeMcQuaid merged 1 commit into
mainfrom
bundle-tap-trust

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Fixes #22756

  • 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.

  • 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.

Copilot AI review requested due to automatic review settings June 17, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

鈿狅笍 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::Trust to translate Brewfile trusted options (including tap-level trust hashes) into trust-store entries, and apply them early in bundle install.
  • Enhance brew bundle dump tap output to emit tap-level trusted: { ... } hashes for trusted items not otherwise emitted as brew/cask lines, 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.

Comment thread docs/Brew-Bundle-and-Brewfile.md Outdated
- 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
MikeMcQuaid added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit a67696c Jun 18, 2026
41 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the bundle-tap-trust branch June 18, 2026 10:20
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.

brew bundle dump fails to export trust flags for nested dependencies in untrusted taps

3 participants