Skip to content

Default to internal API#22546

Open
MikeMcQuaid wants to merge 1 commit into
mainfrom
internal-api-default
Open

Default to internal API#22546
MikeMcQuaid wants to merge 1 commit into
mainfrom
internal-api-default

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

Fixes #19204

  • Avoid the regular JSON API at runtime now that the internal package data is the supported default.
  • Keep public and internal JSON generation separate so website data continues to be produced.
  • Hide HOMEBREW_USE_INTERNAL_API because it is only an internal compatibility toggle now.

  • 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.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI review requested due to automatic review settings June 5, 2026 08:35
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 switches Homebrew’s runtime behavior to always use the internal packages API (instead of the public formula/cask JSON APIs), while keeping public/internal JSON generation concerns separated and de-emphasizing the now-compatibility-only HOMEBREW_USE_INTERNAL_API toggle.

Changes:

  • Route runtime API consumers (formula/cask loading, search descriptions, tap autobump metadata, API prefetch) through Homebrew::API::Internal.
  • Update brew update to download internal packages data by default and clean up legacy public API cache files.
  • Hide/remove end-user documentation for HOMEBREW_USE_INTERNAL_API and adjust tests/workflow packaging to match the new default.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
manpages/brew.1 Removes manpage documentation for HOMEBREW_USE_INTERNAL_API.
docs/Manpage.md Removes corresponding docs entry for HOMEBREW_USE_INTERNAL_API.
Library/Homebrew/env_config.rb Marks HOMEBREW_USE_INTERNAL_API as hidden and adjusts its metadata.
Library/Homebrew/brew.sh Stops auto-exporting HOMEBREW_USE_INTERNAL_API in developer/devcmd contexts.
Library/Homebrew/api.rb Makes API prefetch and names/aliases generation always use internal packages API.
Library/Homebrew/cmd/update.sh Downloads internal/packages.<tag>.jws.json by default and removes legacy API cache files.
Library/Homebrew/search.rb Uses internal packages data for description searches (formulae/casks).
Library/Homebrew/tap.rb Switches autobump candidate data sourcing to internal API hashes.
Library/Homebrew/formulary.rb Removes regular API loading path; formula API loading now uses internal structs/hashes.
Library/Homebrew/cask/cask_loader.rb Removes regular API loading path; cask API loading now uses internal structs/hashes.
Library/Homebrew/test/search_spec.rb Updates search tests to stub internal API hashes and use names key for casks.
Library/Homebrew/test/env_config_spec.rb Updates expectations around use_internal_api? interaction with HOMEBREW_NO_INSTALL_FROM_API.
Library/Homebrew/test/cmd/update_spec.rb Adds coverage that update fetches internal packages API by default.
Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb Adjusts cask loader tests to force source-loading via HOMEBREW_NO_INSTALL_FROM_API and removes regular-API contexts.
.github/workflows/release.yml Simplifies release cache population to align with internal API being the runtime default.

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

Comment thread Library/Homebrew/test/env_config_spec.rb Outdated
@MikeMcQuaid MikeMcQuaid force-pushed the internal-api-default branch from 365e588 to 573e4ab Compare June 5, 2026 08:45
@MikeMcQuaid MikeMcQuaid marked this pull request as draft June 5, 2026 09:02
@MikeMcQuaid MikeMcQuaid force-pushed the internal-api-default branch from 573e4ab to 178ba5a Compare June 5, 2026 09:16
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review June 5, 2026 09:16
@MikeMcQuaid MikeMcQuaid force-pushed the internal-api-default branch from 178ba5a to edc21bc Compare June 5, 2026 10:08
- Avoid the regular JSON API at runtime now that the internal
  package data is the supported default.
- Keep public and internal JSON generation separate so website data
  continues to be produced.
- Hide `HOMEBREW_USE_INTERNAL_API` because it is only an internal
  compatibility toggle now.
@MikeMcQuaid MikeMcQuaid force-pushed the internal-api-default branch from edc21bc to d5cd22d Compare June 5, 2026 16:53
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.

Improve JSON API for Install Performance Improvements

2 participants