Skip to content

Share cask upgrade download queues#22394

Merged
MikeMcQuaid merged 1 commit into
mainfrom
cask-shared-download-queue
May 24, 2026
Merged

Share cask upgrade download queues#22394
MikeMcQuaid merged 1 commit into
mainfrom
cask-shared-download-queue

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • 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

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

- 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
Copilot AI review requested due to automatic review settings May 23, 2026 11: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 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.

@MikeMcQuaid MikeMcQuaid enabled auto-merge May 23, 2026 12:38
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 24, 2026
Merged via the queue into main with commit 9303785 May 24, 2026
41 of 44 checks passed
@MikeMcQuaid MikeMcQuaid deleted the cask-shared-download-queue branch May 24, 2026 15:27
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