Share cask upgrade download queues#22394
Merged
Merged
Conversation
- Avoid splitting cask source fetches from combined upgrade fetches - Keep language-specific caskfiles on a prefetch queue only when needed - Hide `Downloading Cask files` unless that queue will fetch new files
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors cask prefetching so source-API caskfile downloads can share the same DownloadQueue used for combined formula/cask upgrade or install fetches, while keeping an early caskfile fetch only for language-specific casks that need it before resolving the final download URL.
Changes:
- Adds cask installer prefetch helpers and splits cask source download construction from enqueue/fetch side effects.
- Updates install/reinstall/upgrade paths to pass shared download queues into cask enqueueing.
- Adds/updates specs covering shared queues, language caskfile prefetches, cached caskfiles, and changed installer double interfaces.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Library/Homebrew/cask/installer.rb |
Adds source caskfile prefetch handling and refactors prelude/enqueue flow. |
Library/Homebrew/api/cask.rb |
Introduces source_download_for factory used by both prefetch and existing source download paths. |
Library/Homebrew/install.rb |
Updates cask installer enqueueing to use a caller-provided shared queue and conditional caskfile prefetch. |
Library/Homebrew/cmd/install.rb |
Passes the shared install download queue into cask enqueueing. |
Library/Homebrew/cmd/reinstall.rb |
Passes the shared reinstall download queue into cask enqueueing. |
Library/Homebrew/cmd/upgrade.rb |
Passes the shared upgrade download queue into cask enqueueing. |
Library/Homebrew/cask/upgrade.rb |
Uses Homebrew::Install.enqueue_cask_installers for cask upgrade prefetching. |
Library/Homebrew/cask/reinstall.rb |
Uses Homebrew::Install.enqueue_cask_installers for cask reinstall prefetching. |
Library/Homebrew/test/cask/installer_spec.rb |
Adds coverage for language and non-language source-API cask prefetch behavior. |
Library/Homebrew/test/cmd/upgrade_spec.rb |
Adds coverage for shared queues and caskfile prefetch heading behavior. |
Library/Homebrew/test/cmd/install_spec.rb |
Updates installer doubles for the new enqueue contract. |
Library/Homebrew/test/cask/upgrade_spec.rb |
Updates installer doubles for the new enqueue contract. |
Library/Homebrew/test/cask/reinstall_spec.rb |
Updates installer doubles for the new enqueue contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
p-linnane
approved these changes
May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downloading Cask filesunless that queue will fetch new filesbrew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.