You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate formula callers to explicit source APIs - #24439
Have you checked for other open Pull Requests for the same change?
Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
Have you explained why you'd like these changes included, not just what they do?
For bug fixes, have you given step-by-step brew commands to reproduce the bug?
Have you written new tests (excluding integration tests)? Here's an example.
Have you successfully run brew lgtm (style, typechecking and tests) locally?
I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.
Codex with GPT 6 Astra at High effort, with local review and testing.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: bcebc3c1-415b-4e2e-ac8f-5b0458bdac1f
Commits
Reviewing files that changed from the base of the PR and between 554e6fd and 31986b7.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Improved formula and bottle selection during installation, builds, fetching and upgrades, including support for explicitly requested local bottles.
Improved handling of formulas loaded from files, taps and installed packages across Homebrew commands.
Fixed cases where commands could select a different formula with the same name than the one specified, including when merging bottle metadata or running post-install steps.
Improved formula-specific option handling when invoking commands for a selected formula.
The changes pass selected formulas through command setup and use dedicated loaders for formula paths, bottles and installed formulae. They update formula loading across build, install, audit and developer workflows. Tests cover the corresponding loading methods and formula-source selection.
Command setup accepts or resolves a formula and passes it to the parser or command. Build, postinstall and test entry points resolve formulas from command-line arguments. Install argument conversion uses method: :bottle, with tests covering formula options and bottle resolution.
Use dedicated formula loaders Library/Homebrew/api/formula.rb, Library/Homebrew/bottle_transition.rb, Library/Homebrew/cmd/{--cache.rb,fetch.rb}, Library/Homebrew/formula.rb, Library/Homebrew/formula_info.rb, Library/Homebrew/keg_relocate.rb, Library/Homebrew/test/{bottle_transition_spec.rb,cmd/*,deprecate_disable_spec.rb,formula_creator_spec.rb,formula_info_spec.rb,formula_spec.rb,formulary_spec.rb,trust_spec.rb,livecheck/skip_conditions_spec.rb}
Runtime callers use dedicated loading methods for formula paths, bottles, tap paths and keg formulae in the listed cases. Formula lookup declares a name parameter. Tests use the corresponding loaders and cover name-based lookup.
Update developer formula workflows Library/Homebrew/dev-cmd/{advisory-match.rb,audit.rb,bottle.rb,bump-formula-pr.rb,bump-python-resources-pr.rb,bump.rb,livecheck.rb,pr-upload.rb}, Library/Homebrew/formula_auditor.rb, Library/Homebrew/test/dev-cmd/*, Library/Homebrew/test/formula_auditor_spec.rb
Developer workflows load formulas from paths in the listed cases. Tests update loader calls and cover auditing, bottle merging and upload validation with recorded formula sources.
Merge Risk: Moderate · previous review 554e6
This change moves formula loading to explicit path, bottle and installed-formula APIs. Several earlier concerns are still open and no evidence shows them fixed: post-install name handling, quadratic tap file scans, audit reload of installed formulae, and name-based bottle merge and upload checks. Resolve or explicitly accept these before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'Migrate formula callers to explicit source APIs' matches the main change. The changeset moves many call sites from Formulary.factory to explicit loaders such as Formulary.from_path, from_bo…
Description check
The description states the purpose of the change. It says the PR selects formula paths and bottles explicitly in builds, tests, postinstalls, audits and bottle workflows. It also says the selected for…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title 'Migrate formula callers to explicit source APIs' matches the main change. The changeset moves many call sites from Formulary.factory to explicit loaders such as Formulary.from_path, from_bottle, from_tap_path and from_keg. It also passes the selected formula into CLI parsing. The title is specific enough for a teammate to understand the primary change.
Full details: Description check
Explanation
The description states the purpose of the change. It says the PR selects formula paths and bottles explicitly in builds, tests, postinstalls, audits and bottle workflows. It also says the selected formula is passed to argument parsing and that fixtures and mocks are migrated. This matches the raw summary and the PR objectives.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 696fefe5-7f11-4d31-a767-ac3bcef98925
Commits
Reviewing files that changed from the base of the PR and between d89a64e and 554e6fd.
Files selected for processing: 5
Library/Homebrew/build.rb
Library/Homebrew/keg_relocate.rb
Library/Homebrew/test.rb
Library/Homebrew/test/dev-cmd/audit_spec.rb
Library/Homebrew/test/formula_creator_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
- Select source files explicitly in builds, audits and bottle workflows.
- Preserve the source recorded in bottle JSON when merging or uploading,
including local sources sharing a core formula name.
- Parse local bottle options explicitly during installation and bypass
cask name lookup for selected bottles.
- Pass selected formulae to argument parsing and mark API names passed
to post-install children so declarative steps still run.
- Reuse selected audit sources, including installed recipes, without
repeatedly scanning registered tap paths.
- Keep tap audit fixtures valid under the current zap requirements.
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
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 benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Codex with GPT 6 Astra at High effort, with local review and testing.