Conversation
There was a problem hiding this comment.
Pull request overview
Re-enables the HOMEBREW_USE_INTERNAL_API environment variable so users can opt into the internal API-based install/data flow again, while ensuring it’s disabled when HOMEBREW_NO_INSTALL_FROM_API is set.
Changes:
- Update
Homebrew::EnvConfig.use_internal_api?to respectHOMEBREW_NO_INSTALL_FROM_API. - Parse
HOMEBREW_USE_INTERNAL_APIas a boolean-style env var (treating common falsy values as disabled).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def use_internal_api? | ||
| return true if ENV["HOMEBREW_REALLY_USE_INTERNAL_API"].present? | ||
| return false if Homebrew::EnvConfig.no_install_from_api? | ||
|
|
||
| # TODO: re-enable this when the internal API is ready again. | ||
| false | ||
| use_internal_api = ENV.fetch("HOMEBREW_USE_INTERNAL_API", nil) | ||
| use_internal_api.present? && FALSY_VALUES.exclude?(use_internal_api.downcase) |
There was a problem hiding this comment.
This change re-enables the HOMEBREW_USE_INTERNAL_API opt-in and adds precedence for HOMEBREW_NO_INSTALL_FROM_API, but there are no specs asserting the env-var parsing/precedence. Please add coverage in Library/Homebrew/test/env_config_spec.rb for unset/empty, common falsy values (e.g. 0/false), truthy values, and the no_install_from_api? override.
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Thanks! Game for this but let's wait until after next stable release before enabling.
This PR re-enables the
HOMEBREW_USE_INTERNAL_APIenvironment variable for opting into the new internal API installation process.Previously, this was hidden behind a secret
HOMEBREW_REALLY_USE_INTERNAL_APIvariable for testing. Now that all components have been implemented and things seem to be working, let's re-enable this for everyone who had opted in before.No rush to merge this, we can do it whenever we're ready.