Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Homebrew’s download-queue usage to make it the default path, reduce conditional branches, and improve concurrency by fetching formulae and casks together where possible.
Changes:
- Refactors formula/cask fetching to enqueue downloads into a shared
Homebrew::DownloadQueuefor combined concurrent fetch. - Removes older “only use the download queue when concurrency > 1” logic and introduces new enqueue/prefetch helpers.
- Updates API download helpers to support enqueuing downloads into a queue (
enqueue:) and adjusts related call sites.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/upgrade.rb | Adds a fetch: toggle to allow skipping formula fetch when using prefetched downloads. |
| Library/Homebrew/install.rb | Expands fetch_formulae into a configurable helper and adds enqueue/combined-heading helpers for shared-queue prefetching. |
| Library/Homebrew/formula_installer.rb | Switches formula fetching to an “enqueue then queue.fetch” model and assumes a queue always exists. |
| Library/Homebrew/download_queue.rb | Removes conditional constructor helper and adds a global default download-queue accessor. |
| Library/Homebrew/cmd/upgrade.rb | Adds combined prefetch logic to fetch formulae and casks together with a shared download queue. |
| Library/Homebrew/cmd/reinstall.rb | Adds combined prefetch logic for reinstalling formulae+casks with shared queue. |
| Library/Homebrew/cmd/install.rb | Adds combined prefetch logic for installing formulae+casks with shared queue. |
| Library/Homebrew/cask/upgrade.rb | Adds skip_prefetch/download_queue plumbing and adjusts upgrade fetch behavior. |
| Library/Homebrew/cask/reinstall.rb | Adds skip_prefetch/download_queue plumbing for reinstall flow. |
| Library/Homebrew/cask/installer.rb | Makes download_queue non-nilable and adds defer_fetch to separate downloading from installation. |
| Library/Homebrew/brew.rb | Always prefetches API files when API installs are enabled (no longer gated by download concurrency). |
| Library/Homebrew/api/internal.rb | Adds enqueue: support and requires a non-nil download queue default. |
| Library/Homebrew/api/formula.rb | Adds enqueue: support to source/API fetch paths and removes queue params from some helpers. |
| Library/Homebrew/api/cask.rb | Adds enqueue: support to source/API fetch paths and removes queue params from some helpers. |
| Library/Homebrew/api.rb | Adds enqueue: support for JSON API downloads and always uses a download queue in fetch_api_files!. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
beeef9f to
036e8d2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
036e8d2 to
8ab8b1d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8ab8b1d to
49951e3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- cleanup various cases conditional on the download queue to always use it, now it's default and has been for a while - ensure that both casks and formulae are fetched at the same time when possible to maximise concurrency - generally DRY up the relevant download queue code
49951e3 to
c25ed8f
Compare
brew lgtm(style, typechecking and tests) with your changes locally?Generated through extensive prompting with OpenAI Codex. All code hand reviewed and in some cases edited. Manually tested and output and behaviour compared with
main.