upgrade: print the fetch heading before prefetching - #23640
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts brew upgrade’s interactive (ask) flow to print the “Fetching downloads for:” heading immediately after the user confirms the prompt, rather than waiting until after prefetch has determined download names. It does this by extracting heading printing into Homebrew::DownloadQueue and reusing it earlier in the upgrade command.
Changes:
- Add
Homebrew::DownloadQueue#print_headingand reuse it fromDownloadQueue#fetch. - In
brew upgrade, print the combined fetch heading before prefetching when running the shared download queue path. - Update/extend
upgradecommand specs to account for the newprint_headingcall and assert ordering.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/cmd/upgrade.rb | Prints the combined “Fetching downloads for:” heading earlier in the interactive upgrade path and avoids re-printing it later. |
| Library/Homebrew/download_queue.rb | Extracts heading emission into print_heading and reuses it in fetch. |
| Library/Homebrew/test/cmd/upgrade_spec.rb | Updates DownloadQueue doubles for the new API and adds a spec asserting heading-before-prefetch behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
krehel
approved these changes
Aug 24, 2026
p-linnane
approved these changes
Aug 25, 2026
8 tasks
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.
Alternative to #23638.
==> Fetching downloads for:heading immediately after the upgrade prompt, using the names the ask preview has already worked out, so confirming withyprints something straight away rather than after the prefetch that currently supplies them.print_headinglogic to a method so we can call it from the other site.fetchwhen it has already been printed, leaving the non-ask path and itsFetching dependency downloadsfallback unchanged.==> Downloading bottle manifestsnow outputs under the heading rather than preceding it.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?I used
claude-codewith Opus 5, to implement the change.