Skip to content

Re-enable HOMEBREW_USE_INTERNAL_API#22042

Open
Rylan12 wants to merge 1 commit intomainfrom
re-enable-homebrew-use-internal-api
Open

Re-enable HOMEBREW_USE_INTERNAL_API#22042
Rylan12 wants to merge 1 commit intomainfrom
re-enable-homebrew-use-internal-api

Conversation

@Rylan12
Copy link
Copy Markdown
Member

@Rylan12 Rylan12 commented Apr 18, 2026

This PR re-enables the HOMEBREW_USE_INTERNAL_API environment variable for opting into the new internal API installation process.

Previously, this was hidden behind a secret HOMEBREW_REALLY_USE_INTERNAL_API variable 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.

Copilot AI review requested due to automatic review settings April 18, 2026 01:29
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

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 respect HOMEBREW_NO_INSTALL_FROM_API.
  • Parse HOMEBREW_USE_INTERNAL_API as 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.

Comment thread Library/Homebrew/env_config.rb
Comment on lines 753 to +757
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)
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks! Game for this but let's wait until after next stable release before enabling.

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