Skip to content

brew bundle: make non-core DSLs a single file#21721

Merged
MikeMcQuaid merged 1 commit intomainfrom
brew_bundle_single_files
Mar 15, 2026
Merged

brew bundle: make non-core DSLs a single file#21721
MikeMcQuaid merged 1 commit intomainfrom
brew_bundle_single_files

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

Refactor brew bundle code such that adding a new provider e.g. go, uv in future should only require adding a single file.

I've tried to keep tests as-is for now to allow refactoring those in a future pass and to build more confidence the behaviour changes actually work.


  • 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?
  • Have you written new 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.

Use OpenAI Codex gpt-5.4 xhigh.


@MikeMcQuaid MikeMcQuaid force-pushed the brew_bundle_single_files branch 8 times, most recently from 5b62352 to 476fae2 Compare March 14, 2026 16:22
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review March 14, 2026 16:22
Copilot AI review requested due to automatic review settings March 14, 2026 16:22
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

Refactors brew bundle to support “extension” package types (e.g., Go packages and uv tools) via a shared Homebrew::Bundle::Extension base, and updates bundle command plumbing (dump/list/install/check/DSL) to use the extension registry instead of hard-coded per-type modules.

Changes:

  • Introduces an extension framework (bundle/extensions/*) and registers Go/uv as extensions (with compatibility aliases for existing constants/requires).
  • Updates brew bundle CLI flags/help text and the dump/list/install/check paths to dynamically include registered extensions.
  • Updates the Brewfile DSL to route unknown stanza methods to registered extensions via method_missing.

Reviewed changes

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

Show a summary per file
File Description
Library/Homebrew/cmd/bundle.rb Switches bundle CLI flag handling/help text to use registered extensions.
Library/Homebrew/bundle/extensions/extension.rb Adds the extension base class + registry and shared dump/install/check behavior.
Library/Homebrew/bundle/extensions/go.rb Implements Go as an extension; provides compatibility aliases.
Library/Homebrew/bundle/extensions/uv.rb Implements uv as an extension; provides compatibility aliases.
Library/Homebrew/bundle/extensions.rb Loads all extension implementations from bundle/extensions/.
Library/Homebrew/bundle/extension.rb Compatibility require shim for the new extension base.
Library/Homebrew/bundle/go.rb Compatibility require shim for Go extension.
Library/Homebrew/bundle/uv.rb Compatibility require shim for uv extension.
Library/Homebrew/bundle/go_installer.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/go_dumper.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/go_checker.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/uv_installer.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/uv_dumper.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/uv_checker.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/installer.rb Routes unknown entry types to extension installers.
Library/Homebrew/bundle/dumper.rb Includes extension dumps via registry and **extension_types options.
Library/Homebrew/bundle/lister.rb Adds extension-type filtering to list output.
Library/Homebrew/bundle/dsl.rb Routes extension stanzas through method_missing + extension registry.
Library/Homebrew/bundle/checker.rb Adds a “registered extensions” check step and resets extensions.
Library/Homebrew/bundle/checker/base.rb Compatibility require shim for checker base relocation.
Library/Homebrew/bundle/commands/list.rb Plumbs extension-type keyword args through bundle list.
Library/Homebrew/bundle/commands/dump.rb Plumbs extension-type keyword args through bundle dump.
Library/Homebrew/bundle/tap_checker.rb Broadens entry typing to align with updated checker base.
Library/Homebrew/bundle/mac_app_store_checker.rb Adds casts for stricter typing.
Library/Homebrew/bundle/flatpak_checker.rb Broadens entry typing + casts for stricter typing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Library/Homebrew/cmd/bundle.rb
Comment thread Library/Homebrew/bundle/lister.rb
Comment thread Library/Homebrew/bundle/lister.rb Outdated
Comment thread Library/Homebrew/bundle/dumper.rb Outdated
Comment thread Library/Homebrew/bundle/dumper.rb Outdated
Comment thread Library/Homebrew/bundle/commands/dump.rb Outdated
Comment thread Library/Homebrew/bundle/extensions/go.rb Outdated
Comment thread Library/Homebrew/bundle/extensions/uv.rb Outdated
Comment thread Library/Homebrew/bundle/dsl.rb Outdated
Comment thread Library/Homebrew/cmd/bundle.rb Outdated
@MikeMcQuaid MikeMcQuaid enabled auto-merge March 14, 2026 16:48
@MikeMcQuaid MikeMcQuaid force-pushed the brew_bundle_single_files branch from 476fae2 to 5754eb9 Compare March 14, 2026 16:50
Copy link
Copy Markdown
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Some feedback on the refactoring — the overall direction is solid. A few things stood out.

Comment thread Library/Homebrew/bundle/checker.rb
Comment thread Library/Homebrew/bundle/extensions/go.rb Outdated
Comment thread Library/Homebrew/bundle/extensions/extension.rb
Comment thread Library/Homebrew/cmd/bundle.rb
Comment thread Library/Homebrew/bundle/dsl.rb
Comment thread Library/Homebrew/bundle/dsl.rb
@MikeMcQuaid MikeMcQuaid force-pushed the brew_bundle_single_files branch 2 times, most recently from fe3e68d to 819f0ee Compare March 15, 2026 14:34
@MikeMcQuaid MikeMcQuaid requested a review from Copilot March 15, 2026 14:34
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

Refactors brew bundle’s non-core package support (notably Go and uv) into a generalized “extension” framework, with compatibility shims for the old *_installer/*_dumper/*_checker entrypoints and updated CLI/docs/tests.

Changes:

  • Introduces a new Homebrew::Bundle::Extension base + registration/loading mechanism and migrates Go/uv to extension implementations.
  • Updates bundle CLI argument handling, dump/list/check plumbing, and installer/dumper/lister code paths to route through registered extensions.
  • Adds/updates specs to ensure same-process dump output updates and preserves legacy dump ordering + DSL option validation.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
Library/Homebrew/test/bundle/uv_installer_spec.rb Adds coverage for uv install affecting dump output within the same process; updates stubbing.
Library/Homebrew/test/bundle/go_installer_spec.rb Adds coverage for preserving upgrade_formulae during Go bootstrap; adds same-process dump update test; updates stubbing.
Library/Homebrew/test/bundle/dumper_spec.rb Adds regression test for legacy dump ordering including extensions and Flatpak.
Library/Homebrew/test/bundle/dsl_spec.rb Adds tests for extension DSL positional option hashes and validates uv/go option errors.
Library/Homebrew/cmd/bundle.rb Adds extension-driven CLI switch generation and help text construction; refactors dump/list/add/remove type selection.
Library/Homebrew/bundle/uv.rb New compatibility require forwarding to the uv extension implementation.
Library/Homebrew/bundle/uv_installer.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/uv_dumper.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/uv_checker.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/tap_checker.rb Adjusts Sorbet types to accept generic entry arrays.
Library/Homebrew/bundle/mac_app_store_checker.rb Adds explicit T.cast for typed access to entry options.
Library/Homebrew/bundle/lister.rb Adds extension support for bundle list filtering and adjusts typing/casts.
Library/Homebrew/bundle/installer.rb Routes unknown entry types through registered extensions when install is supported.
Library/Homebrew/bundle/go.rb New compatibility require forwarding to the go extension implementation.
Library/Homebrew/bundle/go_installer.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/go_dumper.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/go_checker.rb Replaced implementation with compatibility require.
Library/Homebrew/bundle/flatpak_checker.rb Adjusts typing/casts for the checker base changes and keeps option-hash checking behavior.
Library/Homebrew/bundle/extensions/uv.rb New uv extension: parsing, normalization, dump formatting, install, and compatibility aliases.
Library/Homebrew/bundle/extensions/go.rb New go extension: package discovery/dump/install and compatibility aliases.
Library/Homebrew/bundle/extensions/extension.rb Introduces shared checker base + extension base class, plus extension registry helpers.
Library/Homebrew/bundle/extensions.rb Adds loader that requires all extension implementations from the extensions directory.
Library/Homebrew/bundle/extension.rb Compatibility require path for the new extension base.
Library/Homebrew/bundle/dumper.rb Adds extension-aware dump support and preserves legacy output ordering.
Library/Homebrew/bundle/dsl.rb Removes hardcoded go/uv DSL methods and adds extension-driven method_missing + loads extensions after DSL definition.
Library/Homebrew/bundle/commands/list.rb Threads extension keyword selection through to Lister.
Library/Homebrew/bundle/commands/dump.rb Threads extension keyword selection through to Dumper.
Library/Homebrew/bundle/checker/base.rb Compatibility require for the moved checker base.
Library/Homebrew/bundle/checker.rb Adds registered extension check step and resets extension state; refactors check steps.
Library/Homebrew/bundle.rb Adds TODO notes around go/uv helpers used by specs during the transition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Library/Homebrew/cmd/bundle.rb
Comment thread Library/Homebrew/bundle/dumper.rb Outdated
Comment thread Library/Homebrew/bundle/dumper.rb Outdated
Comment thread Library/Homebrew/bundle/lister.rb
Comment thread Library/Homebrew/bundle/lister.rb Outdated
Comment thread Library/Homebrew/bundle/dumper.rb
Comment thread Library/Homebrew/bundle/checker.rb
Comment thread Library/Homebrew/bundle/extensions/extension.rb
Comment thread Library/Homebrew/bundle/extensions/go.rb
Comment thread Library/Homebrew/bundle/extensions/uv.rb
Consolidate the bundle go and uv dumper, checker, and installer behavior into single-file extension classes and infer the shared bundle command flags, docs, and workflows for those types from the registered extensions instead of hardcoding them separately.

Keep the existing explicit plumbing for the other dependency types for now so the refactor stays focused on establishing the new extension pattern and compatibility path with a smaller review surface.
@MikeMcQuaid MikeMcQuaid force-pushed the brew_bundle_single_files branch from 819f0ee to eac1886 Compare March 15, 2026 15:30
@MikeMcQuaid MikeMcQuaid requested a review from p-linnane March 15, 2026 15:30
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 15, 2026
Merged via the queue into main with commit eda966e Mar 15, 2026
38 checks passed
@MikeMcQuaid MikeMcQuaid deleted the brew_bundle_single_files branch March 15, 2026 15:57
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.

3 participants