Skip to content

Use the internal API for developers/devcmdrun#22145

Open
Rylan12 wants to merge 1 commit intomainfrom
internal-api-developers
Open

Use the internal API for developers/devcmdrun#22145
Rylan12 wants to merge 1 commit intomainfrom
internal-api-developers

Conversation

@Rylan12
Copy link
Copy Markdown
Member

@Rylan12 Rylan12 commented May 6, 2026

Let's switch all developers and devcmdrun folks to use the internal API

Disabling the API with HOMEBREW_NO_INSTALL_FROM_API still works for these people. Non-developers can opt-in still with HOMEBREW_USE_INTERNAL_API.


  • 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration 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. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Copilot AI review requested due to automatic review settings May 6, 2026 02:55
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

This PR changes Homebrew’s internal-API selection so developer-mode users default to the internal packages endpoint instead of needing to opt in via HOMEBREW_USE_INTERNAL_API. In the codebase, this affects the central environment/configuration gate that all API consumers consult.

Changes:

  • Make EnvConfig.use_internal_api? return true for HOMEBREW_DEVELOPER users.
  • Make EnvConfig.use_internal_api? return true for persisted devcmdrun users (brew developer on / dev command run).
  • Keep HOMEBREW_NO_INSTALL_FROM_API as a higher-priority opt-out.

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

sig { returns(T::Boolean) }
def use_internal_api?
return false if Homebrew::EnvConfig.no_install_from_api?
return true if Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Rylan12 Should probably set this in brew.sh instead as then it'll take effect in update.sh and other Bash code.

sig { returns(T::Boolean) }
def use_internal_api?
return false if Homebrew::EnvConfig.no_install_from_api?
return true if Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?
Comment thread Library/Homebrew/env_config.rb
sig { returns(T::Boolean) }
def use_internal_api?
return false if Homebrew::EnvConfig.no_install_from_api?
return true if Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?
@Rylan12
Copy link
Copy Markdown
Member Author

Rylan12 commented May 6, 2026

Oof, not as simple as I thought I guess 😓

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