bundle: unify bundle package type classes#21766
Merged
MikeMcQuaid merged 1 commit intomainfrom Mar 19, 2026
Merged
Conversation
- move brew, cask, tap, and extension package types to single implementation classes and files - remove legacy checker, dumper, and installer wrappers plus the old bundle helper seams they kept alive - simplify checker and package type dispatch, and clean up extension package-manager caching and typing
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors brew bundle’s package-type architecture by consolidating brew/cask/tap and extension package types into unified implementation classes, removing legacy checker/dumper/installer wrapper files, and simplifying dispatch/caching behavior across bundle commands.
Changes:
- Replace legacy per-type checker/dumper/installer wrapper constants with unified
PackageType/extension implementations and updated command dispatch. - Centralize package-type typing and option handling (new
bundle/package_type.rbtype aliases and base behavior). - Update bundle command and spec suites to target the unified classes and new extension selection plumbing.
Reviewed changes
Copilot reviewed 77 out of 78 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/bundle.rb | Removes legacy which_* / *_installed? helpers now owned by extension classes. |
| Library/Homebrew/bundle/brew.rb | Uses Brew::Services directly and removes legacy compatibility aliases. |
| Library/Homebrew/bundle/brew_services.rb | Removes legacy BrewServices aliasing/shims. |
| Library/Homebrew/bundle/cask.rb | Removes legacy compatibility aliases for separate dumper/installer/checker constants. |
| Library/Homebrew/bundle/checker.rb | Simplifies check-step dispatch to use CORE_CHECKS and direct step methods. |
| Library/Homebrew/bundle/commands/cleanup.rb | Uses unified package type classes and extension cleanup directly. |
| Library/Homebrew/bundle/commands/dump.rb | Switches to a single extension_types: selection hash. |
| Library/Homebrew/bundle/commands/exec.rb | Switches service operations to Bundle::Brew::Services. |
| Library/Homebrew/bundle/commands/list.rb | Switches to a single extension_types: selection hash. |
| Library/Homebrew/bundle/dsl.rb | Adds typed readers and requires bundle/package_type for shared option types. |
| Library/Homebrew/bundle/dumper.rb | Removes legacy keyword plumbing and unifies type-selection handling. |
| Library/Homebrew/bundle/extensions.rb | Preserves legacy extension dump ordering with clearer intent. |
| Library/Homebrew/bundle/extensions/extension.rb | Rebuilds Extension base on PackageType and removes legacy checker base. |
| Library/Homebrew/bundle/extensions/cargo.rb | Moves cargo implementation fully into extension; updates executable detection. |
| Library/Homebrew/bundle/extensions/flatpak.rb | Moves flatpak implementation fully into extension; updates option typing and behavior. |
| Library/Homebrew/bundle/extensions/go.rb | Moves go implementation fully into extension; updates executable detection usage. |
| Library/Homebrew/bundle/extensions/mac_app_store.rb | Moves MAS implementation fully into extension; introduces typed App struct. |
| Library/Homebrew/bundle/extensions/uv.rb | Moves uv implementation fully into extension; updates DSL option typing. |
| Library/Homebrew/bundle/extensions/vscode_extension.rb | Moves VSCode implementation fully into extension; adds executable resolution. |
| Library/Homebrew/bundle/installer.rb | Refactors installer to use a typed InstallableEntry struct and unified call pattern. |
| Library/Homebrew/bundle/lister.rb | Simplifies signature to a single extension_types: hash and typed entries. |
| Library/Homebrew/bundle/package_type.rb | Introduces the new PackageType base, registration, and shared option type aliases. |
| Library/Homebrew/bundle/skipper.rb | Updates tap-failure skip logic to use typed entry options. |
| Library/Homebrew/bundle/tap.rb | Updates method signatures/typing and removes legacy compatibility aliases. |
| Library/Homebrew/bundle/cargo.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cargo_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cargo_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cargo_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/checker/base.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cask_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cask_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/cask_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/extension.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/flatpak.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/flatpak_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/flatpak_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/flatpak_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/formula_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/formula_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/go.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/go_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/go_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/go_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/mac_app_store.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/mac_app_store_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/mac_app_store_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/mac_app_store_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/tap_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/tap_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/tap_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/uv.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/uv_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/uv_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/uv_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/vscode_extension.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/vscode_extension_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/vscode_extension_dumper.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/vscode_extension_installer.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/brew_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/bundle/brew_service_checker.rb | Removes old compatibility require wrapper file. |
| Library/Homebrew/test/bundle/bundle_spec.rb | Drops tests for removed legacy MAS helpers. |
| Library/Homebrew/test/bundle/brew_services_spec.rb | Updates spec target to Homebrew::Bundle::Brew::Services. |
| Library/Homebrew/test/bundle/brew_spec.rb | Updates service stubs/expectations to Brew::Services. |
| Library/Homebrew/test/bundle/cargo_spec.rb | Updates requires and stubbing to new extension executable API. |
| Library/Homebrew/test/bundle/dumper_spec.rb | Updates type selection to extension_types: hash and unified dump classes. |
| Library/Homebrew/test/bundle/flatpak_spec.rb | Updates requires and installed checks to new extension API. |
| Library/Homebrew/test/bundle/go_spec.rb | Updates requires and stubbing to new extension executable API. |
| Library/Homebrew/test/bundle/installer_spec.rb | Updates installer specs to unified Brew/Cask/Tap classes. |
| Library/Homebrew/test/bundle/mac_app_store_spec.rb | Updates requires and stubbing to new MAS extension executable API. |
| Library/Homebrew/test/bundle/uv_spec.rb | Updates requires and stubbing to new uv extension executable API. |
| Library/Homebrew/test/bundle/vscode_extension_spec.rb | Updates requires and stubbing to new VSCode extension executable API. |
| Library/Homebrew/test/bundle/commands/check_spec.rbi | Updates test checker base class to PackageType. |
| Library/Homebrew/test/bundle/commands/check_spec.rb | Updates checker expectations to unified package type classes and services. |
| Library/Homebrew/test/bundle/commands/cleanup_spec.rb | Updates cleanup specs to use extension cleanup_items directly and new flags. |
| Library/Homebrew/test/bundle/commands/dump_spec.rb | Updates dump specs to new reset points and unified dump classes. |
| Library/Homebrew/test/bundle/commands/exec_spec.rb | Updates exec specs to Brew::Services. |
| Library/Homebrew/test/bundle/commands/install_spec.rb | Updates install specs to unified package type classes. |
| Library/Homebrew/test/bundle/commands/list_spec.rb | Updates list specs to pass extension selection via extension_types:. |
Files not reviewed (1)
- Library/Homebrew/test/bundle/commands/check_spec.rbi: Language not supported
💡 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.
p-linnane
approved these changes
Mar 19, 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.
brew lgtm(style, typechecking and tests) with your changes locally?Use OpenAI Codex GPT-5.4 xhigh with ~3 rounds of feedback and manual review from Fork.app.